[Module] Yii User Management Module

I think I answered my question above; let me know if I did miss something as I had to access

mysite/index.php/user/user/admin for a user management form.

Thanks

>>> after playing around with the menu there are a lot of errors. :(

>>> won’t be using this module until its clean.

Has promise.

Option: forced login from start page setting - perhaps its there but I did not get past the many Yum errors on a lot of the links.

Later.

Hey,

I’m trying to put the changepassword form on the profile page, so in other words put user/user/changepassword in profile/profile/view . I’m using this code:


<?php $this->renderPartial('user.views.user.changepassword');

?>

However, it gives me "Error 500 - Undefined variable: form". What am I doing wrong. I thought form was defined everywhere. please help!

Hi,

I tried installing but getting below error:

Property "YumWebUser.controllerMap" is not defined.

Here is the exact error, could anyone point me to right direction?




D:\WebServer\Apache2\htdocs\framework\web\auth\CWebUser.php(124)

112     /**

113      * PHP magic method.

114      * This method is overriden so that persistent states can be accessed like properties.

115      * @param string $name property name

116      * @return mixed property value

117      * @since 1.0.3

118      */

119     public function __get($name)

120     {

121         if($this->hasState($name))

122             return $this->getState($name);

123         else

124             return parent::__get($name);

125     }

126 

127     /**

128      * PHP magic method.

129      * This method is overriden so that persistent states can be set like properties.

130      * @param string $name property name

131      * @param mixed $value property value

132      * @since 1.0.3

133      */

134     public function __set($name,$value)

135     {

136         if($this->hasState($name))

Stack Trace #0 	+   D:\WebServer\Apache2\htdocs\framework\web\auth\CWebUser.php(124): CComponent->__get("controllerMap") 

 #1 	+   D:\WebServer\Apache2\htdocs\framework\web\CWebApplication.php(324): CWebUser->__get("controllerMap") 

 #2 	+   D:\WebServer\Apache2\htdocs\framework\web\CWebApplication.php(333): CWebApplication->createController("user/install/", YumWebUser) 

 #3 	+   D:\WebServer\Apache2\htdocs\framework\web\CWebApplication.php(271): CWebApplication->createController("user/user/install") 

 #4 	+   D:\WebServer\Apache2\htdocs\framework\web\CWebApplication.php(136): CWebApplication->runController("user/user/install") 

 #5 	+   D:\WebServer\Apache2\htdocs\framework\base\CApplication.php(158): CWebApplication->processRequest() 

 #6 	–  D:\WebServer\Apache2\htdocs\ms\index.php(13): CApplication->run() 

08 defined('YII_DEBUG') or define('YII_DEBUG',true);

09 // specify how many levels of call stack should be shown in each log message

10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);

11 

12 require_once($yii);

13 Yii::createWebApplication($config)->run();



Hello,

I’ve installed YUM successfully in my development :)

But… When the module is called, to show the "admin" page, the MBmenu widget I use, shows only 5 items (there are a few more items on "HOME" link in my application)

Is there a way to show my app complete menu on the admin page? Is there something i’m missing?.. It seems YUM layout is taking control of my entire layout… :blink:

I was “trying” to inherit the YumUserController as suggested on tutorial “Implementing a Registration…” with another controller. It didn’t help :(

Would you give me some “guide” to use YUM and avoid YUM “destroys” the render of my “main.php” layout? or any tuttorial i should read to complete the info i already have? (i’ve read Vdox folder, this thread, and tuttorial i mentioned)

Thanks a lot in advance…

Regards,

E.

PS:

a piece of my main.php config, as you suggest:


	'modules' => array(

    	'gii' => array(

        	'class' => 'system.gii.GiiModule',

        	'password' => 'IWontTellYou:P',

    	),

    	'registration' => array(),

    	'avatar' => array(),

    	'role' => array(),

    	'messages' => array(),

    	'usergroup' => array(),

    	'membership' => array(),

    	'profile' => array(),

    	'friendship' => array(),

    	'user' => array(

        	'debug' => true,

        	'baseLayout'  => 'application.views.layouts.main',

        	'layout'  	=> 'application.views.layouts.column2',//tried 'column2'

        	'loginLayout' => 'application.modules.user.views.layouts.yum',

        	'adminLayout' => 'application.modules.user.views.layouts.yum',

    	)



PS2: I attached a screenshot of both instances, up before call your module, down after.

PS3: I realized that I need to change ‘adminLayout’ to ‘application.views.layouts.column2’… Now I have to figure out how to “show” the CPanel… Was it right? :-S

PS4: this is not necesary at all…Above is the fix :slight_smile:

so i need the user->register function not to set user->status to 0 when a new user registers i need it set to -4 because when facebook users log into my site and do not have an account i need them to go through my register page,

i have set up so facebook logged on users r detetected and fwd to the reg page and that works good except user->status is always 0 and i want to automate the facebook login so i need it -4 which i have set as yumuser::STATUS_NOCONTRACT = -4;

here are links to my current pages:

yumuser - http://pastebin.com/sJfsFB2a

yumregistrationcontroller- http://pastebin.com/MQvbbxAF

also there seems to be the yumregistration model, which seems to me to be a placeholder i dont see it doing anything.

After seeing your issue seems like it is more than a CSS thing than Yum related. Try to add a




<div style="clear: both;"></div>



just after your menu. That might solve your problem.

@chirvo: just as you suspected, it IS a CSS issue

@thyseus: please accept this small contribution, thanks Chirvo for "suspecting"

@all: if you are using MBmenu, with no YUM update available, modify the lines above indicated to fix the issue

in protected/modules/user/components/YumMenu.php:




 	..........

11:    	Yii::app()->clientScript->registerScript('menutoggle', "

12:   			$('.YUM_MENU_parent').click(function() { $(this).next().toggle(500);});

13:    			$('.YUM_MENU_parent').next().hide();

14:    			$('.YUM_MENU_active.YUM_MENU_parent').next().show();

15:    			");

 	..........

57:				$items[$i]['linkOptions']['class'] .= 'YUM_MENU_parent';

 	..........

73:				$items[$i]['linkOptions']['class'] .= 'YUM_MENU_active';



Thanks!!!!

BTW,

Other "fix"

in protected/modules/user/views/statistics/statistics.php, I replaced:




8: Yum::register('statistics.css');



with:




 8: Yii::app()->clientScript->registerCssFile(

 9:     	Yii::app()->getAssetManager()->publish(

10:     		Yii::getPathOfAlias('YumAssets').'/css/statistics.css'));



To fix an error about wrong header on css file.

Thanks!

Hello all, @thyseus

I’m going to do a fresh Yii/Yum install to fix issues/improve some stuff that crosses my way. It’s like a solo-CodeFest. Yikes! Hooray! ;)

If you find/found issues please report them here: http://code.google.com/p/yii-user-management/issues/list

I’ll be up coding all next week. Mon-to-Fri. (Not 24h/day. My computer is not at a Drugstore nor a Gas station grocery store :) And damn, I need to sleep from time to time!)

Found a bug? Want it squashed by the end of the week? Report it.

C ya.

P.D.: If you have patches/documentation or wanna help, it’ll be appreciated. So, go ahead.

Ok, I managed to make the module 100% navigable with no errors. Didn’t have the chance to see all the report bugs nor close those already fixed. A client ask me to code some stuff so the free time I had has gone.

@mithereal, Do you have any ideas to solve your report in a generic way?

Please, download from SVN, test, report.

Thanks.

This is best extension! I am use this in my first project on yii. Author respect!

I just prepackaged a new 0.8rc4 version. Please test, and give me a sign if all errors are removed.

If so, its time for the 0.8 final release, some advertising, and a fresh forum thread :)

Thanks to chirvo for fixing many bugs and keeping me motivated!

This is Great Extension, specially in bugs production, missing tables, missing views, and hell of errors, but i love it and need it thanks to creator and developers.

i downloaded 8rec4 may be 3 days ago from the trunk, i made my own fix for errors … i mean quick fix some of them just comment cuz have no time anyway i will post them here.

two errors i couldnt fix or work around them i hope you help me with them,

1.YumMessagesController cannot find the requested view "send_digest".

it is missing in all versions don’t know what the contents was

2.translation

i contrbuted to this module by making full translation for ARABIC language i hope it will help but i translate the messages files and doen’t work for me and the translation table views doesn’t allow to add new language i really didn’t have time to check to figure out how it work …

i will attach arabic translation and bug fixes, if you can help me with better solutions please do that, i’m waiting

thank you

Errors:

1981

yum_errors01.txt

Arabic Language Translation:

1982

yum_activities.php

1983

yum_avatar.php

1984

yum_fields.php

1985

yum_friendship.php

1986

yum_messages.php

1987

yum_privacy.php

1988

yum_registration.php

1989

yum_role.php

1990

yum_user.php

thanks for the arabic translation, i will include them in the release ASAP(which

could be up to ~ 1 week, i have a lot of projects on my desk right now). But i

will not forget them !

I also had uploaded a rc5 fixing the installer. Damn showstopper-Bugs. Thanks for

keeping the patience. And everyone is always invited to help developing!! I can

send google code commit permission to everyone who want. Some Quality assurance

Manager who has more time left than me would definitely help…

I hope somebody has an answer for this problem

I find few others asking a similar question , but no answer found.

to get the current user’s email or username I have to use this:


YumUser::model()->findByPk(yii::app()->User->id)->profile->email;

which seems very inefficient.

why can not I use yii::app()->User->email and end story?

regards

The email attribute is stored in the profile table. This is to make the user management flexible, in case your

application does not need a email field - or not a profile at all.

Since the profile data is fetched with with() it is not really inefficient. There is only 1

SQL query done, and only once. In the newer releases of yum they are even cached, so no

query is executed at all as long as the cache is valid.

Update: you can cache the data for yourself with YumUser::model()->cache(500)->findByPk …

Hello again…

I realize that I was discouraged a litlle bit my first attempt to use YUM but checking the correction for some past error that has been done, I’ll take some time to implement it on my development.

Since table name personalization it’s now possible (its a detail, but…) i managed to keep the “naming rule” I’ve been using so far, but I had some issues. I fixed it in this way:




class YumTranslation extends CActiveRecord{

    //I don't know why, but I had to declare it

	public $_tableName;


  ....


	public function tableName()

	{//copied/adapted from YumUser

		if (isset(Yum::module()->translationTable))

			$this->_tableName = Yum::module()->translationTable;

		elseif (isset(Yii::app()->modules['user']['translationTable']))

			$this->_tableName = Yii::app()->modules['user']['translationTable'];

		else

			$this->_tableName = '{{translation}}'; // fallback if nothing is set


		return Yum::resolveTableName($this->_tableName, $this->getDbConnection());

	}

...



I hope it’s helpful.

By the way: the issue that appears using MBMenu (YUM interference) still remains unsolved, i suggested a solution some lines above.

Regards…

E.

Something is missing? I’ve done each one of the steps you mention on this tutorial, but still not working… is there anything else that i can do or try to implement it?

Perhaps, in the config file (main.php where the modules are parametrized?.. I tried with:




'registration' => array(   //'registrationUrl'  => array('/registration'),

//'registrationUrl'  => array('/registration/registration'),  

 'registrationUrl'  => array('//registration/registration'),  

  //'registrationView' => '/views/registration',  

  //'registrationView' => '//views/registration',  

  //'registrationView' => '/registration',  

  //'registrationView' => '/views',  

  //'registrationView' => array('/views/registration'),  

  //'registrationView' => array('//views/registration'),   

  //'registrationView' => array('/registration'),   

  //'registrationView' => array('/views'), 

),



But the “registration” procedure it’s working as default.

PS: I tried all variants, including the "crazy" ones :S

If some one has a full implemented and working installation, my humble offer is to write how to use the YUM, but I need some kind of support from the author (from YUM or who offer his implementation)

What do you mean with "not working"? How far do you came in the tutorial, which step made problems?