[Module] Yii User Management Module

Hi RossMcCaughrain, hi dbk138, hi enfield!

Thanks for your interesting Yum. Let me try to answer all your questions:

@enfield: In the original yii-user-management (<0.8) i had the tableNames configured in

the module configuration. I think this concept is outdated. The better way is to do it, to

leave the default names in the Yum-prefixed classes, and extend them to suit your project-specific

table name. A example:





```php



class User extends YumUser {

public function tableName() {

return 'my_prefixed_special_table_name_for_users';

}

}



```







@dbk138:





This is (almost) the same issue as i said to enfield. In the original yum i had a


&quot;profile field group&quot; feature and a &quot;related table&quot; column. Today i would do it 


completely different. Create a class Profile that extends YumProfile, add a


ProfileController that extends the YumProfileController, copy the example views of


YumProfileController to the new ProfileController and add a CHtml::dropDownList()


add the appropriate place, where you want your dropdownlist to appear.





@both: This is a design specific question. Since yii in general encourages you to use


OOP, i decided to make it this way. This is a _little bit_ more complex for the 


developer - but when you are using yii you most definitely _are_ a developer, and should


have some basic OOP skills.





Oh yes. I could write a exact, detailed tutorial/documentation how this works. I really should.


I have done this many times for my project, this knowledge and working code exampes should be 


shared <img src='http://www.yiiframework.com/forum/public/style_emoticons/default/smile.gif' class='bbc_emoticon' alt=':)' />





@RossMcCaughrain





The same goes for all additional columns, relations, and whatever you have in your project.





Issue 1: see answer to the other guys. But i think there _is_ a generic solution in yii. Yii


is able to automatically prefix the tables you place in relation names, but i am not sure 100% 


at the moment how that works. 





Issue2: is the friendship module activated? If not, the link should not render. If yes, then it


is a bug or just a invalid link. I will look at that and fix it in the svn.





Issue3: Thanks for reporting, will fix that in svn





Issue4: I forgot to commit that file to svn, will fix that. Its an older &quot;bug&quot;, i remember <img src='http://www.yiiframework.com/forum/public/style_emoticons/default/wink.gif' class='bbc_emoticon' alt=';)' />





Issue5: the fresh_installation.sql is a &quot;fallback&quot; for people that dont want to use the Installation 


Controller. I did not take care if it still is current, simply forgot that. So the new version will


go into svn. 





Issue6: thanks, i will fix in svn





Issue7: No, there arent yet, but i think about doing a optinal checkbox in the install controller.


If checked, he will do the constraints. Or a migration script file that adds the constraints afterwards.


Why? when developing the constraints are disturbing. you only want them on the production server. 








Now some general words:


the last months i developed this extension alone. Thats why it still has many small bugs/inconsistencies.


Everyone is invited to help&#33; I can give you committ access to the google code svn. As you will see there


already are ~15 people inserted, but unfortunately they are all inactive at the time.





Also, if you want to write documentation or a tutorial on how things work: yum still lacks documentation.


It has many features, but not well documented yet.





thanks for your time

Getting error





Parse error: syntax error, unexpected T_PUBLIC in D:\wamp\www\vusr.net\protected\modules\user\controllers\YumTextSettingsController.php on line 77







YumMessagesController cannot find the requested view "send_digest". 



On role menu access




Property "YumRole.autoassign" is not defined. 



on Statistics




Undefined variable: active_first_visit_users 



On fieldGroups





Parse error: syntax error, unexpected T_PUBLIC in D:\wamp\www\vusr.net\protected\modules\profile\controllers\YumFieldsGroupController.php on line 65




hi PeRoChAk,

thanks for reporting. All this bugs are already fixed in svn.

So many things to consider in the releases… hope i will get a

stable version that really is stable soon… :)

Hi,

For the life of me I still cannot figure out how to properly add the drop down list. I got it working using a related table in the database, but I am sure I do not need to do that. Has anyone been able to figure out how to use the dropDownList properly? Also eventually I would like to make a dependend dropDownList but I am still stuck on the former!

Is there any module from your extension which supports MongoDB database.

Thanks,

Sateesh B.

Hi, Sateesh.

I started to port Yii-user-management to mongoDb once in a while. But then i decided that this makes no sense,

since Yii2.0 will soon introduce a abstractian layer that makes the ORM workable with MongoDB, as well as relational Databases. This may be in the far future, but it will make all modules (almost) automatically

mongoDb-compatible. Almost because, of course, you have to design your models to have the schema in it, since

the db does not have it anymore. Details of all this will come when the time is near.

If you want to start porting to mongodb using the YiiMongoDbSuite - i can send you some files where i did that,

so you can adjust them to your needs.

Thank you for the fast reply. It would be great help for me if you send those files to me. Please send the files to bbalasateesh@gmail.com. Do I need to change any code or settings for that code. Also, if possible please provide the installation details.

Once again thank you so much…

Password Recovery Process Bug




YumRegistrationController cannot find the requested view "/user/changepassword". 



Bug on Role




Property "YumRole.autoassign" is not defined. 



Got Error when using


YumUser::hasRole('my role')




include(YumMembership.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory 



Hi and thanks for greate module. One thing I couldn’t make to work is translation. I added ‘language’ => ‘de’ to module configuration, but no translation took place. I’ve seen that in every folder, files names are different, for example in ‘pl’ folder there are only ‘user.php’ and ‘YumPasswordValidator.php’ and in ‘de’ folder there is more files like yum_user.php, yum_statistis.php and so on.

Did I miss something in configuration or there is other way to translate it, btw I tried all languages but no luck.

regards

lukBB

Hello thyseus,

It is been 2 months. I haven’t heard that the bug is fixed.

I also face with the same problem.

This module is SQLInjection.

Check Profile section with username value.

I just did fresh install from SVN and used the fresh_installation.sql for my database and get the following errors:

Users->Statistics

Undefined variable: active_first_visit_users

Roles->Roles

Property "YumRole.autoassign" is not defined.

Profile->Manage Field Groups

Profile->Create New Field Groups

The table "{{profile_fields_group}}" for active record class "YumProfileFieldsGroup" cannot be found in the database.

This extension has over 9,200 downloads. I am sure that there’s load of people using it in production and have done there own fixes for these bugs.

Is it recommended for me to fix these errors myself and the submit the code to SVN?

I’d report them as issues first on the google code site so they can be tracked appropriately…since it’s between releases, they may be byproducts of the ongoing development being done…

http://code.google.com/p/yii-user-management/issues/list

Hello, new to yii.

Here are my steps to install extension but it fails. Help appreciated. Thanks in advance.

  • Install YII latest, and used yiic to MakeApp

  • Tested and working - able to log in, add table to db and use gii for module creation.

  • Download extension and unpacked.

  • Made modules folder with permissions for access

  • Made assumption and copied unpacked folder to \protected\modules\user - Install doc perhaps.

  • Modified main.php according to install doc

  • ran the index.php/user/install and get this…

Alias "user.UserModule" is invalid. Make sure it points to an existing PHP file.

see below for 311.

311 throw new CException(Yii::t(‘yii’,‘Alias “{alias}” is invalid. Make sure it points to an existing PHP file.’,array(’{alias}’=>$alias)));

 if(&#036;isClass &amp;&amp; (class_exists(&#036;className,false) || interface_exists(&#036;className,false)))

300 return self::$_imports[$alias]=$className;

301

302 if(($path=self::getPathOfAlias($alias))!==false)

303 {

304 if($isClass)

305 {

306 if($forceInclude)

307 {

308 if(is_file($path.’.php’))

309 require($path.’.php’);

310 else

311 throw new CException(Yii::t(‘yii’,‘Alias “{alias}” is invalid. Make sure it points to an existing PHP file.’,array(’{alias}’=>$alias)));

312 self::$_imports[$alias]=$className;

313 }

314 else

315 self::$classMap[$className]=$path.’.php’;

316 return $className;

317 }

318 else // a directory

319 {

320 if(self::$_includePaths===null)

321 {

322 self::$_includePaths=array_unique(explode(PATH_SEPARATOR,get_include_path()));

323 if(($pos=array_search(’.’,self::$_includePaths,true))!==false)

Try unpacking all the folders directly into /protected/modules.

Currently you have:

/protected/modules/user/user

/protected/modules/user/friendship, etc.

they are all modules and need to be:

/protected/modules/user

/protected/modules/friendship, etc.

Wow, thanks for a quick response!

I was just going to post a note that I did get it installed… I made the novice mistake of copying the main package folder to the modules dir and naming it user - not good (wasted so much time).

For those novice out there the correct documentation for install instructions is in the /Unzip_Package_Folder/user/doc/ folder, not the web site various links which is a little vague. Also, and to be really clear, copy the various /Unzip_Package_Folder/folders to the protected/modules dir that you create.

Sorry for the bother, and thanks again.

See next post - answered, I think.

Perhaps I can save some effort by asking this time around.

In the install docs, Click on “Administrate your Users” - but I don’t have this link after login, just the normal default.

I did change my layout\main.php to point login to /user/user/login and logout. (not sure if that was the right move)

Am I missing something?

Thanks in advance.