This is a modular User Management Module for easy integration in your Yii Framework Web Application.
It has the following features:
* An automated Installer
* User Administration
* Role Administration
* Permission System with a mixture of RBAC and ACL (see docs)
* Profiles & Profile history & Profile Comments & Profile Fields Administration
* Messaging System (send/receive Messages between Users) Submodule
* User groups (user can add new groups, other users can join)
* User Avatar upload
* User Registration
* Password Recovery
* Friendship system
* Mailing component (users can choose which messages he gets by email)
* Base Language: English
* Complete Translations to german, french
* Almost complete Translation to spain thanks to bigchirv@gmail.com
* Incomplete Translations to russian and polish
What it is not:
* A complex RBAC like srbac. However, it is possible to use srbac together with the User Management Module without problems. The contributed Permission System may be powerful enough for your Web Application, just give it a try.
Community ¶
Yii-user-management is hosted at github: github.com/thyseus/yii-user-management
Donations are possible by bitcoin: 1AzhCYHrX7c7exBB89qfhbEvUaW6RThB1E
Documentation ¶
Requirements ¶
- minimum of Yii 1.1.8 since DAO caching techniques are used
Installation ¶
- Extract the release file under
protected/modules
Read docs/Install_tutorial.txt
Enjoy
I found some bugs in Yii-user-management
in /user/views/user/profile-edit.php
need append to $profile -> $profile[0] - and page where profile edit will work
Missings files in dir /user/views/profile/
I copied /roles/admin.php - and change it little - and it's work
Warning!
Make stable build plz .. i cant use it! totally damaged!!!
Missing files?
0.7 seems to be missing files from views/profile/
Also tried the SVN which has a single file called myprofile.php but not the expected 'admin', 'create', '_form' etc.
Sorry, that's ok now
I can install the module now. The module is great!
can not install
very strange, I can install in one application, but can not in another one.
use the url below follow installTutorial.txt index.php?r=user/install index.php? r=user/install/installation index.php? r=user/installation/start
can install
very strange, I can install in one application, but can not in another one.
use the url below follow installTutorial.txt
index.php?r=user/install
index.php?r=user/install/installation
index.php?r=user/installation/start
Good ext
But in last build there is no view for YumProfileController !!
cannot find the requested view
error installing default data
The $profileFieldsTable has all columns marked as "NOT NULL" yet the default data being inserted only supplies values for 5 of the 15 fields.
I tried unchecking the box to 'Install Profile submodule' (and its related tables) and removed that 'profiles' from the submodules array in the application configuration, however, then the application blows up with:
The table "profiles" for active record class "YumProfile" cannot be found in the database.
So it appears that the profiles tables are required even when not desired.
So:
1) the installation code should be revised to install the correct data in the $profileFieldsTable
2) the extension should be revised to check for desired use of the submodules (based on the Application Configuration file) before accessing them.
another one
Description
The table "{{profile_fields}}" for active record class "YumProfileField" cannot be found in the database.
Source File
/home/****/framework/db/ar/CActiveRecord.php(1976)
01964: private $_model;
01965:
01966: /*
01967: Constructor.
01968: @param CActiveRecord the model instance
01969: /
01970: public function __construct($model)
01971: {
01972: $this->_model=$model;
01973:
01974: $tableName=$model->tableName();
01975: if(($table=$model->getDbConnection()->getSchema()->getTable($tableName))===null)
01976: throw new CDbException(Yii::t('yii','The table "{table}" for active record class "{class}" cannot be found in the database.',
01977: array('{class}'=>get_class($model),'{table}'=>$tableName)));
01978: if($table->primaryKey===null)
01979: $table->primaryKey=$model->primaryKey();
01980: $this->tableSchema=$table;
01981: $this->columns=$table->columns;
01982:
01983: foreach($table->columns as $name=>$column)
01984: {
01985: if(!$column->isPrimaryKey && $column->defaultValue!==null)
01986: $this->attributeDefaults[$name]=$column->defaultValue;
01987: }
01988:
quite some errors
I just installed the latest version of this extension and ran into the following erros:
disableEmailActivation has not being declared withing the UserModule.php.
After creating a new account and clicking on the activation link it confirms that the account is activated and than when you attempt to login it says your account is not active...
I am still testing it...
found it
sorry,
found it, it was a typo :/
component instead of components in the main.php config file
my bad
--iM
Follow up on problems
thyseus committed the fix to the project within an hour of my issue being raised. All is well.
OK I found some problems now
But they look like they are being addressed on the SVN project.
Notably the email address gets lost on the registration form (issue ID 52).
Still great work though.
Great so far
No problems installing it (version 0.5). Not tried all the features so far but no errors yet.
Looking forward to the next version with OpenID.
Great work.
InstallController.php bugs
Missing default values in following lines
97, 79-83
default '0' for the int value
default '' for varchar values
Line 97:
timestamp
int(11) NOT NULL default '0'Lines 79-83:
match
varchar(255) NOT NULL default '',range
varchar(255) NOT NULL default '',error_message
varchar(255) NOT NULL default '',other_validator
varchar(255) NOT NULL default '',default
varchar(255) NOT NULL default '',Bugs
If you permit to change the name of the table at the install page the extention must use these name after.
I have rename all the table at the install page with add the prefix "users_", the install script create all table with the prefix but, don't save the new name and after the "user extention" fail to run because it use the old table name.
Continue it a great and very usefull extention, thank a lot for your good work. ;-)
great potentials
hello,
this module has great potentials - the installation for 1.1.1 was pretty straight forward (after reading the docs)
still has some bugs, though!
keep up the good work :)
--iM
GPL V3 ????
Whats with the reference to GPL V3 when this isn't even a standalone software and Yii is BSD licensed??
There was no license with my download, so I will happily accept the "No rights reserved" instead.
Bugs
If you are keen to use this module and can't wait for the updates, you will find fixes to many of the bugs - in the forums here:
http://www.yiiframework.com/forum/index.php?/topic/7591-module-yii-user-management-module/
Bug: changepassword not working
When I click on Change Password, I get a blank page - how can I debug this?
CWebUser - returnLogoutUrl not a method
I've got an exception... back to 0.2 that is working for me....
One more bug in Role
Please use in relations function {{user_has_role}} instead of user_has_role. If you rename this table during installation current relation will not be working.
One more bug is in already mentioned:
view/user/view isAdmin() is not a method of CWebUser
Some bugs found after installation
I'm using: latest SVN release and PHP option: error_reporting(-1);
With above, following appears:
License
CC-BY-SA (Creative Commons) is not really a license for software.
CWebUser does not have a method named "encrypting".
When I use recovery page then got this error
CWebUser does not have a method named "encrypting".
Source File
framework/base/CComponent.php(237)
is there any bug?
0.2 Bug -- Tables created ignored my "prefix" seeting on the DB connection
I've noticed that the tables created, did not have the "prefix" ( tbl_ ) that I had enabled on my testdrive application. It would be nice to have this checked as well.
Great Job
Thanks for updating the module so quickly.
This is ideal for projects were RBAC might be a bit overboard.
I like the messaging feature also :)
Good contribution.
0.2 Bug
the view for "role update" action is missing.
CException
Description
RoleController cannot find the requested view "update".
Everything else seems to be working quite good.
Fixes in 0.2, Tutorial and Forum Thread
Hey, just released 0.2 which contains all bug fixes. Thanks again for reporting to all.
This is the Tutorial on how to install it on a freshly installed yii App:
http://www.yiiframework.com/doc/cookbook/68/
This is the Link to the Forum Thread:
http://www.yiiframework.com/forum/index.php?/topic/7591-module-yii-user-management-module/
Discussion in the Forum
Yeah, you are right. I will release 0.2 today and i will open up a forum thread.
I will test it with the skeleton app of yii-1.1-dev.
btw: also take a look at yii-user and grbac, since they are also User-Management Tools. yii-user was the codebase for this User Management Tool and is being developed in parallel by mishamx. Maybe we will merge the features of both projects someday.
Bugs
It is great!!! I plan to use this module soon. For now, I am investigating the Yii framework as a my next platform for wen development.
I think discussing things here, increases the visibility of the module. At the forum, it probably gets more coverage by experts.
I am looking forward to use it.
Bugs
@thyseus: I had followed your install instructions and therefore also replaced the UserIdentity.php with the one from module/user/components/UserIdentity.php. So this can't be the reason for my problems. I think the best would be if you could try to get it running one with a newly created application. Looking forward to the new revision.
By the way.. wouldn't it be better to open a topic in the forum for this extension. I somehow have the feeling that discussing the bugs in the review area is the wrong place..
Bugs
@outrage: Thank you for your Bug reports. It will be fixed in the new Version.
@Ignatius: Please try to copy over the module/user/components/UserIdentity.php to the components/UserIdentitiy.php of your Web Application. I am thinking about if this step should be automated by the installer (backing up the original File first)
This should work - if not please tell me the new error message.
@ Rossimildo:
Your idea with hooks to LDAP/... is nice. LDAP Authentification is not hard to accomplish in yii by hand, anyway.
yii-user0.2 will be released tomorrow, i will give this module a lot of polishing first ;)
Some more information about the problems
Hi thyseus,
I investigated the problems I'm facing with your extension a bit more in detail.
First problem was, that I expexted to be able to login after clicking on the "Login" links in a newly created yii application after adding your extension. So what I did was
But this login is the one of the scaffolded yii application and not the one of your extension, which leads to the "CWebUser.hash" error described above. The correct login link is index.php?r=user/user/login
But even this correct login page does not work because in the view it tries to access the property Yii::app()->User->registrationUrl. But Yii::app()->User is in my case the CWebUser Class from the yii core and not the User controller of your module (and the class from the yii core library does not have the registrationUrl property). So I assume it needs some more configuration in the yii main.php config file and that's the point where I lost the path with my limited knowledge of the yii framework.
It seems to me, that the problem is currently the lack of a good step by step documentation which describes how to use this extension with a newly generated yii application and how it fits together with the User controller from the yii core.
I'm facing the same problems as user "outrage"
The idea of this extension is great, but at the current stage it seems not to be usable.
I'm using the yii.1.1-dev version and I fixed the problem with the hardcoded tablenames in the sourcecode, so I could complete the installation and the two demo users were added correctly.
But when I try to login I'm getting also the 'Property "CWebUser.hash" is not defined.' error.
Unfortunately I'm a newbie to Yii, so I don't yet have the big overview of what's going on. But it looks to me as if yii tries to access the "user" core component which comes with the framework instead of the one which is deliverted with this extensions.
I'm really looking forward to give this extension a try. Is there any proposed workaround or fix for this problem?
Nice, the bugs will be worked out in the next few weeks!!!
I would guess that hooks for easy integration with external authentication systems, like LDAP would be nice.
More bugs
After fixing the db problems, when logging in I get an error:
Property "CWebUser.hash" is not defined.
After fixing this and going to /myapp/user/ I get another error:
CWebUser does not have a method named "isAdmin".
I've managed to hack my way around these problems to get it working but hit other problems such as an error because no roles were setup in the database.
There are many things that need ironing out before this is suitable for release I'm afraid.
Easy Fix
After looking further into the above problem, in the InstallController.php there are various places where you have used hard-coded values instead of the previously defined variables.
Bug?
On a fresh install of 1.1-dev, after the 'user' install I get the following error:
CDbCommand failed to execute the SQL statement: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'latest.tbl_users' doesn't existINSERT INTO
tbl_users(
id,
username,
password,
email,
activkey,
createtime,
lastvisit,
superuser,
status) VALUES (1, 'admin', '21232f297a57a5a743894a0e4a801fc3', 'webmaster@example.com', '', 0, 1266571424, 1, 1), (2, 'demo', 'fe01ce2a7fbac8fafaed7c982a04e229', 'demo@example.com', '', 0, 1266543330, 0, 1)
Obviously you are inserting a couple of users into the database table 'tblusers' but the tables that you initially created do not have the 'tbl' prefix.
yii-1.1-dev
This is because you have to use the newest yii-1.1-dev (or yii-1.1.1 as soon as it is released) for this Module, since in 1.1stable the $menu is missing in the Controller.php base Class.
As a workaround, just put 1 line
public $menu = array();
at the beginning of the controllers/InstallController.php (and maybe other Controllers that needs this)
Sorry for this.
Error
I got this error when run install Property "InstallController.menu" is not defined. Source File
/srv/www/htdocs/test/protected/modules/user/views/layouts/column2.php(15)
00003:
00004:
00005: <?php echo $content; ?> 00006:
00007:
00008:
00009:
00010: <?php 00011: $this->beginWidget('zii.widgets.CPortlet', array( 00012: 'title'=>'Operations', 00013: )); 00014: $this->widget('zii.widgets.CMenu', array( 00015: 'items'=>$this->menu, 00016: 'htmlOptions'=>array('class'=>'operations'), 00017: )); 00018: $this->endWidget(); 00019: ?> 00020:
00021:
00022:
Error
I got this error when run install
Property "InstallController.menu" is not defined.
Source File
/srv/www/htdocs/imsptools/protected/modules/user/views/layouts/column2.php(15)
00003:
00004:
00005: <?php echo $content; ?>
00006:
00007:
00008:
00009:
00010: <?php
00011: $this->beginWidget('zii.widgets.CPortlet', array(
00012: 'title'=>'Operations',
00013: ));
00014: $this->widget('zii.widgets.CMenu', array(
00015: 'items'=>$this->menu,
00016: 'htmlOptions'=>array('class'=>'operations'),
00017: ));
00018: $this->endWidget();
00019: ?>
00020:
00021:
00022:
00023: <?php $this->endContent(); ?>
toli
I got the exception:
CException Description YumProfileController cannot find the requested view "admin". Source File C:\work\xampp\www\yii\framework\web\CController.php(807) 00795: { 00796: if(($viewFile=$this->getViewFile($view))!==false) 00797: { 00798: $output=$this->renderFile($viewFile,$data,true); 00799: if($processOutput) 00800: $output=$this->processOutput($output); 00801: if($return) 00802: return $output; 00803: else 00804: echo $output; 00805: } 00806: else 00807: throw new CException(Yii::t('yii','{controller} cannot find the requested view "{view}".', 00808: array('{controller}'=>get_class($this), '{view}'=>$view))); 00809: } 00810: 00811: /** 00812: * Renders dynamic content returned by the specified callback. 00813: * This method is used together with {@link COutputCache}. Dynamic contents 00814: * will always show as their latest state even if the content surrounding them is being cached. 00815: * This is especially useful when caching pages that are mostly static but contain some small 00816: * dynamic regions, such as username or current time. 00817: * We can use this method to render these dynamic regions to ensure they are always up-to-date. 00818: * 00819: * The first parameter to this method should be a valid PHP callback, while the rest parameters Stack Trace
:) bad module :P
Mates, please make a correct release! This one has missing files .....
It is a pearl, a masterpiece!
Can't understand other comments. Works perfectly out-of-the-box without need of ANY changes. Just make sure you follow EXACTLY step-by-step instructions in either:
http://www.yiiframework.com/wiki/68/installing-and-configuring-the-yii-user-management-module-under-a-fresh-skeleton-application-generated-by-yiic/
or user\docs\installTutorial.txt found in archive.
The ONLY thing that is really missing is a lack of support of DB systems other than MySQL. But since this is quite popular RDBMS (most popular?) and since this extension is contributed as a free work of it's author we can't cry. Don't like it? Build your own one!
MySQL only support
Once again an reminder - this module supports ONLY MySQL database!
Attempt to "foul" it by providing other database configuration for Yii:app()->db component in config.php will fail with exceptions in CDbCommand while trying to prepare SQL statements.
If you need RBAC support for your app which uses other DB than MySQL unfortunatelly you have to look after another yii extension or build it your own one. Sorry!
Missing files
The profile view folder is empty. Copying other folder files is not the solution. The release file should be complete to begin with.
And also, in the installation file, the 'profile' table should have the fields 'street' and 'about' set to "NOT NULL default ''" because if not, checking a profile results to the error: "Property "YumUser.street" is not defined." as am example.
Test it thoroughly before declaring it that it works perfectly out of the box.
I find this extension very promising, and somehow frustrating at the moment.
Download from SVN
To avoid the frustrations that you can get when you download the public release 0.7, download directly from the checkout. Trust me, it will save you time and saves your hair from growing all white.
This module is going to be fat!
Coupling too much features
zzz
Too much features.. and also too much bugs...
the vest extension
imho, one of the best user admin extension.
unable to login after install
With db tablePrefix = 'tbl_'
The table "tbl_tbl_users" for active record class "YumUser" cannot be found in the database.
with db tablePrefix = ''
The table "users" for active record class "YumUser" cannot be found in the database.
Will be looking into it myself, but be aware that there is some issue here.
missing file YumActivityController.php
Changelog.txt says this:
New User activity logging subsystem (see YumActivityController) - logging of login, logout, wrong password attempt, recovery and registration into database and Yii log file
Such a file does not exist in your archive.
error in the YUM code
After install and login try, I get following error: "The table "{{users}}" for active record class "YumUser" cannot be found in the database." even if the table users exist.
Solution to the error in comment #3182
Edit all models and remove the {{ and }}
easier solution
add
"tableprefix" => "",
to your db component configuration. This is a bug in Yii, and documented
in the installation.txt tutorial. Sorry for that
"YumWebUser.logoutUrl" not defined
set in config, but not work
components=array( 'user'=>array( 'class' => 'application.modules.user.components.YumWebUser', 'allowAutoLogin'=>true, 'loginUrl' => array('/user/user/login'), 'logoutUrl' => array('/user/user/logout'), 'profileUrl' => array('/user/user/profile'), ), ),
profileUrl also not defined
at bitshine
@bitshine: you need to set the configuration options in the modules section, not in the components section.
@thyseus
I have already installed by follow docs in the pakage, not the instruction in the web page here.
Thank you!
V 0.8rc1 / YumSettingsController.php Error
When opening index.php?r=user/yumSettings/update, I got this error:
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in C:\xampp\htdocs\test\yii\yii-user-management\protected\modules\user\controllers\YumSettingsController.php on line 98
Remove the closing } in line 96 of protected/modules/user/controllers/YumSettingsController.php.
Why I just couldn't make it work!
The install manual says it takes 5 min for normal tradesman to install, I am not that good. But it takes me 2 hours still couldn't make it work!
nettrinity: wheres the problem?
nettrinity: wheres the problem? maybe we can help
good app but quite some errors still
Hi,
Quite good application but still some errors like:
Error 404
Unable to resolve the request "user/activities/index".
I cannot see any activities folder in the package. Should there be any?
Have you used this app in a production website?
Regards,
bettor
Too much Issues !
Please create a new version dude.
Too much Issues !
I did not critique this app in a bad way bur rather to help make it better. There is no need for a better one but just clear the errors of this one and it will be the perfect app. I am using it as well and I love it.
User Menu Component
Hi,
in order to get a pointer cursor in the user menu for the parent
<li>
items, you can add$items[$i]['linkOptions']['class'] .= ' parent';
at line 58 in modules/user/components/YumMenu.php .
Best regards,
Joachim
User Menu Component
Sorry, the line should be
$items[$i]['linkOptions']['style'] .= 'cursor:pointer';
Empty views in profile
I have been working with v. 0.7 and I noticed the views/profile directory is empty, Where are the files? This causes and error on the admin dashboard when clicking on Manage Profiles
use module with 'tablePrefix'
comment lines 104 to 110 on user/models/Yum.php and it will no longer check for the prefix.
Property "YumWebUser.logoutUrl" is not defined.
I install. http://localhost/index.php?r=user/install
but I get following error:
Property "YumWebUser.logoutUrl" is not defined.
..........
I set config
components=array(
'user'=>array( 'class' => 'application.modules.user.components.YumWebUser', 'allowAutoLogin'=>true, 'loginUrl' => array('/user/user/login'), 'logoutUrl' => array('/user/user/logout'), 'profileUrl' => array('/user/user/profile'),
),
still not work. what's the problem ? anybody help me,please ?
Sol to Comment # 3720
set the url format in urlManager
Few Bugs in latest version
Found a good few errors in the latest version just from clicking through the menus. I did Bagulhos comment above to get round table prefix issue but i seesm to be affecting other places as well maybe:
Can figure out how to fix some of them myself but just to make you aware of them.
Thanks!
@RossMcCaughrain
Although there are bugs due to missing files, some that you mentioned can be resolved through open the model and check for the table name.
you can change it to the correct name, or, if you installed it without changing the default value {{classname}} could work.
To mcgiwer
I think you are using latest version of yii framework. just remove {{ and }} from your model from where it is returning table name. It will work then.
Request
It will be helpful if it is Updated with SEO settings
I would like that it should have a base field URL or profile_url or slug.
Model not working with tableprefix
Thanks for this module and I was able to install without any problem, though when I try login I an error table mwa_mwaYumUser can't be found in the model YumUser. When I checked my database all tables have mwa as my tableprefix which is right but why there is extra tableprefix in the model(mwa_mwaYumUser). my tableprefix is 'tableprefix' => 'mwa' in the config file.
Thanks
I had to remove the {{}} in the models section of the module. and some tables I had to add my tableprefix.
Problem
Hey, I get this error when I update my main.php file according to the instructions in the install_tutorial.txt :
CException
Alias "user.UserModule" is invalid. Make sure it points to an existing PHP file.
What could possibly the the problem? Please help!!
Does not work!
I get the exact same problem as Aryan.
More exactly:
If the directory structure is
protected modules avatar friendship membership .... etc
then I get:
If it is like:
protected modules user avatar friendship membership .... etc
Then I get the:
Alias "application.modules.user.components.YumWebUser" is invalid. Make sure it points to an existing PHP file.
Is anyone reading these posts...?
Stratos
Solved
Hey Stratosgear,
I solved the problem. I had made a very stupid mistake. I copied the extension folders to /protected/models instead of /protected/modules. It's now working for me.
Check your URL route setup in your index.php file. Also check main.php for syntax errors. It's really easy to miss a character in that file and ruin the whole thing. ;)
Still more problems
Ok,
After another try to install this module, I succeeded this time.
Unfortunately, during install, I choose to:
This means that once again, I had a lot of errors getting this to work.
I had to manually edit the {{tablename}} in the model files to the table names that I chose (I had prepended the suggested table names with yum). This was on top of the db table prefix that I was using (yii_). For example the final table was yii_yum_users and I had to find (for example) the reference to {{users}} and change it to {{yum_users}}
Also, although I did not use the profile module I was getting errors inside the profile module...
At this time I gave up since I find it a better use of time to implement my own version of user registration than to continue debugging yum for the second time.
Thanks for your reply though...
Stratos
Good job!
Thanks for this stuff, looks very nice :-)
Any updates soon?
Broken extension
This extension needs some serious TLC as its broken, and needs alot of work to even get it close to functional. It ws great in previous versions and I'm using it, but since its been split into several modules, nothing is working anymore. the paths in the install are wrong (user/install) should now be (user/user/install) etc. Please give it some love and upload a new release.
as bettor said Too much Issues! Why do you publish broken code?
There is no sense at all!
The closest thing to a decent user management system for Yii, and it's seriously broken.
@ismail about half of the information in that wiki is outdated or wrong. I'm done trying to make this thing work... every time it feels like I've got it debugged enough to make it work I find something new.
Like it or not
I find it ridiculous that people are using this comment section to degrade the author's work. If you don't like it no one is forcing you to use it. If you like it but think improvements can be made, offer your help rather than speak badly of someone making an attempt to make your life easier by giving you free code. Making demands of someone offering to help you for free is not a very motivating thing.
RE: Like it or not
Although I generally agree with what swisscheese says here, I see the previous comments under a different perspective.
I have really tried to make the offered extension work, but it simply does not work as advertised. I tried debugging it and couldn't make it work. Maybe I was not good enough to fix it, I'm not trying to say that the code in unfixable.
The point, though, is that people express the impressions they got from the offered code. Apparently for many people it just didn't work. That should work as a warning to other people that might want to try out this extension. It's a shame to waste their time to try fix code that is not ready yet.
Although I applaud the generosity of the original author to share his work, there is nothing wrong with plenty of warnings on what someone is about the embark when trying to use this extension.
I ma following this thread on the hope that someday to code will be fixed and there will be two or three posters saying: "Yes, it works fine now." As long as I keep seeing these problems people keep having, I know that I should wait a little longer before trying again.
There is benefit in praise but there is equal (and sometimes more important) benefit in complaining.
I was harsh and for that I'm sorry
@swisscheese perhaps I was a bit harsh, but I think it should be noted that I have tried to do what I can. I've made very specific bug notes, I've made comments on the wiki pages hoping they'll be updated (it's not a real wiki so there's no way for a user to make the corrections), I've posted to the Yii facebook page that it would be nice to get a significant amount of people behind a reusable user management system and that YUM is the best thought through implementation I see.
But it was broken. I don't mean that in a mean way, or a snide way... not even an ungrateful way... it just was. Is it still? I don't know yet. The YUM Google Code feed is on the top of my RSS feeds. I saw a few days ago that a new release is out and I'll be putting it in ASAP because like I said before, it's the best there is!
@ismail I'd happily get more involved if you have the space for another developer... or documentor... or bottle washer... anything to help.
@swisscheese not sure if you've got some pull in the developer community, maybe you could help get some momentum behind this module? You might not like my comments, I don't really care for them myself now that I've re-read them, but can you help?
clarification
@stratosgear and @jasendorf don't get me wrong there is a reason to note broken code / enhancements / and so forth. There is no room to make personal attacks on someone trying to help the community. I would not put you guys in the front of the line there as doing so.
Personally I am still interested in this extension and got it working for me in one app by scaling down the included functionality and building it up from there for the custom purpose. Still saved me a ton of time even with reworking code.
In a couple of current projects I am using another ext from nickcv. Different approach and although not a 100% cookie cutter solution (as nothing will fit the bill for everyone 100% of the time) for my work it still saves a ton of time customizing to what will work for me. Instead of going after either one of these gracious developers I just decided to say thanks and use what I can use and build the rest and hopefully provide some good input when possible.
Like I said before constructive criticism is cool and respected, if you are capable of providing help even better, personal attacks are unnecessary.
I know first hand that thyseus has provided a lot to this community and it is cool to have people like that around to step up and try to help others out.
Quality assurance
I do not feel anyone did get personal in the recent comments. On the other side,
i also do not feel anyone did motivate me, except for one Person, that committed a lot of bug fixes into the google code svn repository. Working full-time on other projects, on which some use yii & yum, i dont have the time to be a 100% perfect, clean quality-assurance Team when packaging releases. Unfortunately such show-stopper bugs are always occuring :-(.
I hope a clean, working version will be released. Anyone interested please just join the google code svn repository, i can put you on the commit list, thank you.
Also: please ignore all wiki pages for now and follow the install instructions contributed in user/docs/install.txt - this is always the most recent. When a release is done and the installation process is clear, i will update the wiki pages (on google code and on yii framework extension pages)
Support
Debugging takes time and people should be patient. I only contributed one small bug fix. Its a great module - keep up the inspired work. Dont stop I want to see the masterpiece when released.
How can we help thyseus
Below comment is some kind of... confession.
First time, a lot of bugs appears, was time when I joined project (release 0.4 or something around). At this time, this extension was quite simple and... working well.
Unfortunately, to Thyseus, I appear. Young brain full of ideas. You know...
I bring a lot of ideas that at the end was good but... for next two releases cause a lot of problems and... negative comments.
On the other hand this extension is still above release 1.0, therefore you can assume (even expect) that a lot of aspects will be changing and sometimes something just not working. Sorry, this is a real project! It is complicated, has a lot of feature... and therefore may happen that they will not work (in some configuration)!
I kindly ask you... if you have any problem which you can reproduce with blog application - please try and send! Believe me, this is so simple and can REALLY help to find out bugs. Moreover, your nervousness can be somehow... reassured :)
P.S. If someone put negative comment and... with new release is happy is kindly aksed to update own feedback.
P.P.S. I'm not involved, actively, into this extension any more
install error
when I install the user module,something wrong:
CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.. The SQL statement executed was: CREATE TABLE IF NOT EXISTS
user_group
(id
int(11) NOT NULL AUTO_INCREMENT,owner_id
int(11) NOT NULL,participants
text NULL,title
varchar(255) NOT NULL,description
text NOT NULL,PRIMARY KEY (
id
)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
——I think PDO can't execute serial create table sentence,but how to fix it?
thx!
YUM UserModule.profileTable not defined
Hi thyseus,
I'm using YII 1.1.8, downloaded YUM yii-user-management_0.8rc5.tar.bz2 and started following the included install tutorial.
When launching installer, I receive error:
CException
Property "UserModule.profileTable" is not defined
I'm trying to understand what's wrong but I'm wondering if anybody else had same problem or could help out.
Edit: I've also checked bug tracker, where this error is marked solved in r402; more, I do load module in my config/main.php. So, I'm trying with ver. 0.8rc5 now.
Edit&solution: yep, ver. 0.8rc5 solves it! :-):-):-) Thank you!
TIA,
rash*
Trying to get property of non-object
I check database that user has role has data. Don't know why it cannot extract the data.
When I remark 354, I can login. Where can I fix it?
C:\inetpub\wwwroot\medappt\cmis\protected\modules\user\models\YumUser.php(354)
354 'roles' => array(self::MANY_MANY, 'YumRole', Yum::module('role')->userHasRoleTable . '(user_id, role_id)'),
create a link for every profile
Hi, first thing I want to thank you for your work ..
second, I want to know how to create link for each user or each profile .. like this
www.mysite.com/username
in config/main.php
The missing link
Just installed 0.8rc5.
In spite of the instructions being a bit broken everything went through pretty smoothly.
I have one question about the instructions, can anyone give me the missing step between step 8 and step 9.
Step 8 talks about logging in as admin and Step 9 talks about changing the admin's password by clicking the "'update Icon' (the pencil)". After Step 8 there is no page with a pencil icon. I think the author has gone to a different page but there is no clue what it is! Can anyone tell me?
Thanks muchly
components not loaded
It says that in order to install it I need to overwrite the default
Authentification Method in the Application Configuration:
'components'=>array(
'user'=>array(
'class' => 'application.modules.user.components.YumWebUser',
'allowAutoLogin'=>true,
'loginUrl' => array('//user/user/login'),
),
But for some reason this has absolutely no effect. It is as if Yii would completely ignore that I'm loading this component and changing the loginURL and it is still using the standard UserIdentity.php.
Any suggestions are appreciated.
Login page
I found my mystery "'update Icon' (the pencil)". You can only get too it from the new login page. After following the instructions the login link still points to: /index.php?r=site/login but if you point it too /index.php?r=user/auth then you get the correct login page which takes you through to the mystery pencil bit. Unfortunately, I don't know enough about how yii works to know how to change this.
Hurray
Found it!
The login link is hard coded and the layout file doesn't match what the module expects.
Edit webapp/protected/views/layouts/main.php
change line 34 from
array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
to
array('label'=>'Login', 'url'=>array('/user/auth'), 'visible'=>Yii::app()->user->isGuest),
Phew!
pencil mystery solved....
if(you reach the step where you are logged in and finding pencil)
after you find that you cannot see the pencil... no problem.. follow as below
logout FIRST and then use the link /index.php?r=user/auth instead. once logged in successfully retype the url of /index.php?r=user/auth
Stop looking for pencil you would not find it that easy. click Users on right hand side and then try to find it... the pencil. :)
Intallation notes
When you logged in your app and run user/install, you will get error :
CWebUser and its behaviors do not have a method or closure named "data".
Just log out and install it again.
First extension
I am junior yii developer, I'm like this extension.. it's really easy to installation and use
Great Work!
Despite the very tiny issues during installation I have to say that you have done a great work (in progress, though).
Keep coding!!
HOW to use this within accessRules Function
Hi, I'm using this extension.
I use this to use within accessRules function.
array('allow', 'actions'=>array('generate'), 'users'=>array('@'), 'expression'=>'$user->hasRole("admin")' ),
I hardcoded the role, but is ok form me know !
filtering by Role
It depends if you want to use the full ACL system provided by yum or only use roles.
If you use the ACL system, you can filter by the 'can' function,
for example:
if(YumUser::model()->find('username = bob')->can('removeUsers')) { ...
} else { // he can´t }
or, if you want to check if the current logged in user can:
if(Yii::app()->user->data()->can('removeUsers')) { ... }
Read docs/Install_tutorial.txt
I didn´t find it . download the last version 0.8 rc-5
ok i found it /user/docs/Install_tutorial.txt
error - The table "{{users}}" for active record class "YumUser" cannot be found in the database.
I set the ['tablePrefix' => '',]
but i'm getting the error
The table "{{users}}" for active record class "YumUser" cannot be found in the database.
Somebody had the same problem?
Import the yum tables
@cksaito is the user table in the database?
You might need to import the .sql file into your MySQL db
Check the install document again
user table is in the database
tariqc,
yes, the user table is in the database. I run the script to create tables.
Registration tutorial does not work
Hi i have followed the registration tutorial but it gives me lots of errors.
First of all the doc needs to be changed for registration. I have edited the controller accordingly and the changes the doc requires as follows
if (isset($_POST['Profile'])) {
to
if (isset($_POST['YumProfile'])) {
But still it gets errors and doesn't save to the Profile field as it says firstname and lastname are compulsory
Thanks
How does this work?
Hi, following the exact steps of the tutorial i reach to step 5 and i receive an error
"
CException
Alias "user.UserModule" is invalid. Make sure it points to an existing PHP file.
"
I'm testing this on a wamp server, any ideas of what i'm doing wrong?
solved: i just realized that this needs to be extracted to a "modules" directory instead of the "models" directory
WebDevPT
Make sure the module and the sub module is configured properly in the main.php file. I had the same issue when I was trying this new version and there were many configuration so I had to switch back to the previous one I had which I use in my apps. The older version was not divided into submodules.
refactor needed yesterday
I really appreciate all your hard work on these modules but please stop adding new features and rather start refactoring the source code so it can be more dynamic, flexible and extensible!
Thank you!
Please correct the russian charset
Please correct the russian charset, because UTF-8 is not correct
If success in login, redirect to the requested url
You can implement the redirection, in case of successful authentication, to the requested url, not to the profile page.
You can modify the code:
if($model->validate()) { $this->lastViset(); if (strpos(Yii::app()->user->returnUrl,'/index.php')!==false) $this->redirect(Yii::app()->controller->module->returnUrl); else $this->redirect(Yii::app()->user->returnUrl); }
To
if($model->validate()) { $this->lastViset(); $this->redirect(Yii::app()->user->returnUrl); } else $this->redirect(Yii::app()->user->returnUrl);
Fatal error: Call to a member function get()
Just tried to install 0.8rc6 .Followed the instructions and every thing was fine till i reached the login screen .But when i tried to login i got the following error :
( ! ) Fatal error: Call to a member function get() on a non-object in
\yiifolder\protected\modules\user\models\YumUser.php on line 365
Can you please help me out.
Thanks
Rathan
Thanks
I loved the extension.Thank You
Exception on install YUM: CWebUser and its behaviors do not have a method or closure named "data"
Hi !
how to avoid this exception, when installing YUM.
first, this exception occurs when you try to install YUM, running action: index.php?r=user/install, the exception occurs when a user is currently logged on.
how to avoid this exception ? first, prior to install user module, first logoff your currently logged on user.
cause:
when you invoke "index.php?r=user/install", the beforeAction method in YumController.php detects a logged on user, so, it tries to get a "data()" method from it, obviously, if your module is not installed then an exception occurs because data() is null or inexisting.
// YumController.php // abstract class YumController extends CController { // ... public function beforeAction($action) { if(Yum::module()->enableOnlineStatus && !Yii::app()->user->isGuest) Yii::app()->user->data()->setLastAction(); return parent::beforeAction($action); } // ... }
YumUser.php::tableName() don't recognize the userTable passed argument from config
This is the case in PHP 5.2.6, (please reproduce on other versions)
My user table is named "users" (with extra S at end), when you setup config and specify in users module the "userTable" argument specifying value: "users" then and exception occurs because table "user" (without the "s") is not present in database. It looks like YumUser model dont recognize the passed argument: "users", instead using "user" by default.
you can observe in YumUser, the "user" argument is specifyed by default, assuming no other value is present, but, the value "IS PRESENT" in config, why it dont recognize ?, please continue reading.
Looking deeply in YumUser.php, i set some debug lines in YumUser that demostrate what's happening in that method. As you can observe, the problem is "if (isset(Yum::module()->userTable))" who is always returning false, no matter if the config value is present or not.
Then a simple solution is not using "isset", but it can derive in an exception (try/catch ?) if user dont specify the userTable argument in it own config file.
in file : \code\ecommerce\protected\modules\user\models\YumUser.php, method:
public function tableName() { if (isset(Yum::module()->userTable)) { $this->_tableName = Yum::module()->userTable; Yii::log("tableName MARK #1,","info"); } else { $this->_tableName = 'user'; // fallback if nothing is set Yii::log("tableName MARK #2,","info"); } Yii::log("tableName is: ".$this->_tableName,"info"); throw new Exception("STOP HERE - EXCEPTION",500); return Yum::resolveTableName($this->_tableName, $this->getDbConnection()); }
The table "{{users}}" for active record class "YumUser" cannot be found in the database.
I'm using YUM 0.8rc6.
I am still getting the error: The table "{{users}}" for active record class "YumUser" cannot be found in the database.
I have set tablePrefix => ''. The issue seems to be if I change the default table names when running /index.php/user/install. Originally, I set the table names to "Users" and "MessageTranslations" and got this error. When I ran install again and set the table names to "user" and "messageTranslation," I no longer got the error.
This is a fine workaround for now, but kind of a pain not to be able to change my table names.
Blank default value using UWrelBelongsTo widget
I use the UWrelBelongsTo widget in profile for a field with a value from related model. However, the value can be NULL as well. By default UWrelBelongsTo widget assigns a "0" value for empty fields with the label set by Empty item name attribute ('emptyField' param).
Thus I needed to change the editAttribute method of the widget to assign NULL value for the empty field. Perhaps somebody will find it useful:
public function editAttribute($model, $field, $htmlOptions = array()) { $list = array(); if ($this->params['emptyField']) $htmlOptions['empty'] = $this->params['emptyField']; $models = CActiveRecord::model($this->params['modelName'])->findAll(); foreach ($models as $m) $list[$m->id] = (($this->params['optionName']) ? $m->getAttribute($this->params['optionName']) : $m->id); return CHtml::activeDropDownList($model, $field->varname, $list, $htmlOptions); }
Instead of adding a 0 value at the beginning of the list I set the value by using an 'empty' htmlOption.
Bad Code
Spaghetti inc
Registration Activation Not Working
Hello,
I'm registering and receiving the email to Activate my registration but when I click on the link to activate I get this message:
Activation did not work
Profile found, but no associated user. Possible database inconsistency. Please contact the System administrator with this error message, thank you
Can you guys help me please?
having issues while installing...
I have configured as it shown in install_tutorial.txt file. I have created modules folder under protected folder.and i have added
//user management 'user' => array( 'debug' => true, ),
inside main.php file. but still im getting this error.
Alias "user.UserModule" is invalid. Make sure it points to an existing PHP file.
please help me.. :(
its working for me now thanks...
why this
Fatal error: Call to a member function get() on a non-object in C:\xampp\htdocs\test\protected\modules\user\models\YumUser.php on line 365 why am i getting this after install ????
Code is broken after installation
I did installation with lot of effort. First thing you shall tell users to use shorttag on in apache settings or you can replace <? with <?php in all your files. After all hassels of installation and make it work till to "Administrate your Users" . when i tried to login using admin admin . it directs me to broken page with error "Invalid argument supplied for foreach()". I am tired of fixing it again. Can anyone have same problemo? any one has fixes for it?
<? <?php tags
Future releases will contain <?php tags for backward compatibility. In the github code, we use <? though.
Can you append a stack trace for the foreach() error? A issue in the github tracker would be good, thank you.
@gunnit: You need to activate a caching component, at least CDummyCache for yii-user-management to work. (config/main.php 'components' => array('cache' => array('class' => 'CDummyCache'))
Works with changes
I used this GIT REPO and it installed perfectly with a couple changes but so far no errors.
GIT REPO
I know this might be trivial but when you download it extract all the contents to your modules folder. This "module" actually consist of 9 modules. So extract Avatar, Friendship, Membership, Message, Profile, Registration, Role, and Usergroup to your protected modules folder.
If you don't have cache add something like this to your main.php
// application components 'components'=>array( .... other components 'cache'=>array( 'class'=>'CDummyCache', ), ..... other components
user/components/relations.php
change
public function handleAjaxRequest($_POST) { print_r($_POST); }
to
public function handleAjaxRequest($POST) { print_r($POST); }
user/controllers/YumTranslationController.php
just copy and paste this whole thing. A lot easier to explain. You can do a side by side comparison if you like.
<? class YumTranslationController extends YumController { public function filters() { return array( 'accessControl', // perform access control for CRUD operations ); } public function accessRules() { return array( array('allow', 'actions'=>array('create','update', 'admin', 'delete'), 'expression' => Yii::app()->user->isAdmin() ), array('deny', // deny all users 'users'=>array('*'), ), ); } public function actionCreate() { $this->actionUpdate(); } public function actionUpdate($category = null, $message = null, $language = null) { $models = array(); foreach(Yum::getAvailableLanguages() as $language) { $tmpModel = new YumTranslation(); // added $tmpModel->category = $category; // added $tmpModel->message = $message; // added $tmpModel->language = $language; // added //$models[] = $this->loadModel($category, $message, $language); // changed $models[] = $this->loadModel($tmpModel); } if(isset($_POST['YumTranslation'])) { $category = $_POST['YumTranslation']['category']; $message = $_POST['YumTranslation']['message']; foreach($_POST as $key => $translation) { if(substr($key, 0, 11) == 'translation') { $lang = explode('_', $key); if(isset($lang[1])) { $lang = $lang[1]; foreach(Yum::getAvailableLanguages() as $language) { if($language == $lang) { $model = YumTranslation::model()->find( 'category = :category and message = :message and language = :language ', array( ':category' => $category, ':message' => $message, ':language' => $lang)); if(!$model) $model = new YumTranslation(); if($translation != '') { $model->message = $message; $model->category = $category; $model->translation = $translation; $model->language = $lang; $model->save(); } } } } } } Yum::setFlash('Translations have been saved'); $this->redirect(array('admin')); } $this->render('update',array( 'models'=>$models, )); } public function actionDelete($id) { if(Yii::app()->request->isPostRequest) { // we only allow deletion via POST request $this->loadModel($id)->delete(); // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser if(!isset($_GET['ajax'])) $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin')); } else throw new CHttpException(400,'Invalid request. Please do not repeat this request again.'); } public function actionAdmin() { $model=new YumTranslation('search'); $model->unsetAttributes(); // clear any default values if(isset($_GET['YumTranslation'])) $model->attributes=$_GET['YumTranslation']; $this->render('admin',array( 'model'=>$model, )); } public function loadModel($model = false) { $newmodel=YumTranslation::model()->find('category = :category and message = :message and language = :language', array( ':category' => $model->category, ':message' => $model->message, ':language' => $model->language)); if($newmodel===null) { $translation = new YumTranslation; $translation->category = $model->category; $translation->message = $model->message; $translation->language = $model->language; return $translation; } return $newmodel; } protected function performAjaxValidation($model, $form) { //if(isset($_POST['ajax']) && $_POST['ajax']==='translation-form') if(isset($_POST['ajax']) && $_POST['ajax'] == $form) { echo CActiveForm::validate($model); Yii::app()->end(); } } }
Also, If you would like to use your own theme add the flowing to your main.php file. You will have to obviously go into the view files and css to restyle them to your needs.
'moduels'=> array( other module settings....... 'user' => array( ....other settings 'baseLayout'=>'//layouts/column2', /// THIS IS FOR THEMING ), other module settings.......
run YUM
why I can't still Run the User Management Installer in my Web-Browser:
http://localhost/testdrive/index.php/user/install
or
http://localhost/testdrive/index.php?r=user/install
please..help me
RE: Help
Did you add the following to your main.php config file first?
'modules' => array( 'user' => array( 'debug' => true, ) ), 'components'=>array( 'user'=>array( 'class' => 'application.modules.user.components.YumWebUser', 'allowAutoLogin'=>true, 'loginUrl' => array('//user/user/login'), [...] ), 'import'=>array( 'application.modules.user.models.*', [...]
Also, you should use whatever route that your currently using for your url setup. Using a route that your not using will not do any good.
throw exception "include(UserModule.php): failed to open stream: No such file or directory "
Hi experts,
when I install this extension,my web app throw exception "include(UserModule.php): failed to open stream: No such file or directory",this is my config in main.php:
'import'=>array( 'application.models.*', 'application.components.*', 'application.modules.user.models.*', 'application.modules.srbac.controllers.SBaseController', ), 'modules'=>array( 'user' => array( 'debug' => true, ), 'Admin'=>array( 'class'=>'application.modules.admin.AdminModule', ), ), 'components'=>array( 'user'=>array( 'class'=>'application.modules.user.components.YumWebUser', 'allowAutoLogin'=>true, 'loginUrl' => array('//user/user/login'), ),
Extract dir
Have you extracted the files to protected/modules?
Note that it's not "models"!
I have extracted the user folder to protected/modules/
yes,I have extracted the "user" folder to protected/modules/
waiting your help..
RE: Help
>RE: Help
thankyou skworden but too many bugs on it. sorry
YUM on GitHub
Guys, be sure to use the last GitHub version !
i will release a new "stable" version (0.8) soon
with long <?php tags for maximal compatibility and all
the bugfixes and features of the stable github version.
Default login/password not working
Just made a clean install to testdrive app, everything was fine, but when i tries to login as noticed in intructions admin/admin or demo/demo it returns with "Login is not possible with the given credentials" and "Login or Password is incorrect".
Tries on the last version 0.8. Looking for help! Thanks!
url route
Did you use the ?r=/user/auth url? you need to adjust the /site/login urls in the layouts/main.php of the testdrive demo application.
2thyseus - it was done
As intructed, I pointed to ?r=user/auth (and that IS the yum module - the error messages are from it). I tries to "hack" a bit and temporarily set in YumAuthController.php option to override password check
$identity->authenticate(true);
After that I was able to login but still cannot change password. It seems that there some errors in validatePassword or encrypt functions, but I cannot find it out.
Sorry for my English.
Installed latest GIT, some errors
Hi there,
first of all: This is probably the best and most comlete extension out there for yii. Well done!
I have just installed the modules from the latest git into an othewise empty yii-app (I use the latest boilerplate).
I can login and logout, so the basics are working.
But when I try to access /user/user/admin/ wihtout beeing logged in I get this error:
Trying to get property of non-object modules/user/components/YumWebUser.php(29) Line 29 is: if(Yum::module('role')->adminIsGod && Yii::app()->user->isAdmin())
Any Ideas?
thanks for any hints,
gb5256
adminIsGod
Make sure to have the 'role' submodule enabled in your config/main.php.
also try to append :
if(Yum::hasModule('role') && [...]
to line 29. I think this will fix it. This will go into github master. Thanks for reporting!
Some more issues...
Hello,
thanks for menting the role submodule.
I have activated it and it is now working.
Next step is the avatar module. After enabling it, I have problems with the right path to setup as a avatar path. I am running on boilerplate, but the structure is the same, so within the www is a images folder. But yum is not accessing it. If I change the avatar path to something stupid, like ".." then it puts the file into the project root (as expected). But that means that the script is working. So I have my doubts about the path settings and the boilerplate.
Does anybody has experience with yum and boilerplate?
thanks,
gb5256
Use something like this
realpath(Yii::getPathOfAlias('backend or www or frontend').DIRECTORY_SEPERATOR.'uploads')
problems i have
first of all thanks for your work.
as "admin":
1. when i hit "create new role" i get empty screen with no errors.
2. from "Manage profiles" if i try to delete a profile a popup message says "Error 404: The system is unable to find the requested action "delete"." (why is delete active in profiles if i can only remove users from "User administration"?)
3. "Last visit" should be set to "never" instead of 01-01-1970 :)
i have changed in admin.php value to
'value'=>'$data->lastvisit == 0 ? "never" : date(UserModule::$dateFormat,$data->lastvisit)'
any user:
1. i activated "avatar", it works but if i change "public $avatarMaxWidth" from 0 to any other value when i try to upload any kind of accepted formats it says "The file "xx.jpg" is not an image." although it accepts the same image with 0 value.
2. also when i activate max value, on the form always appears "The image should have at least 50px and a maximum of 200px in width and height" no matter value i set so i change it in edit_avatar.php from 200 to
' . Yum::module('avatar')->avatarMaxWidth . '
3. in user menu in "Misc" appears "Upload avatar for admin" and "Change admin Password" no matter who is logged in so i changed in YumAdminMenu.php to "Change Password" and "Upload avatar"
please help me with avatar and roles
[solved] create role error
i have found the error on line 29 in _form.php
<?php echp Yum::t('Higher is usually more worthy. This is used to determine downgrade possibilities.'); ?>
it is misspelled echo as echp
regarding the avatar issue
i only realized it checks the file then starts a new loop and because there is no data on the 2nd loop it stops at the 1st step
if(!$info)
please help
temp solution for avatar
Seems like nobody is interested into this extension and this is not good.
there is a bug in YumAvatarController.php and even if the avatar is saved it does not report that so
if($model->save()) // does not activate
you can either comment out this if clause or change it to
if($model->save(false)) // and now is working fine
there's another problem i found. if someone change it's avatar, old one(s) remain on the server and because you don't have the possibility to choose between them it's waste of space.
so there are 2 ways to solve this. you can either change the name of any new picture so it always overwrites existing one
$filename = Yum::module('avatar')->avatarPath .'/'. $model->id . '_avatar.'. pathinfo($_FILES['YumUser']['name']['avatar'], PATHINFO_EXTENSION);
or when you upload a new one tell the action to remove the old one.
GitHub
I think if you open issues for this at github:
https://github.com/thyseus/yii-user-management
your changes and suggestions will be recognized in development.
Facebook login
is there any pacth to integrate facebook login to yum
Fatal error: Call to a member function get() on a non-object.
Hi there,
Successfully installed yii user module but when click on login, http://localhost/yii_user_management/index.php/user/auth/login
Give this error,
Fatal error: Call to a member function get() on a non-object in D:\wamp\www\yii_user_management\protected\modules\user\models\YumUser.php
on line 374
and
at line 374 this code:
$relations = Yii::app()->cache->get('yum_user_relations');
How can I fix this error?
Solved : Fatal error: Call to a member function get() on a non-object.
Solved with install_tutorial (8)
8.) Make sure to set a caching component. Yum relies on it. If you do not
want to cache, add
'components' => array( 'cache' => array('class' => 'system.caching.CDummyCache'),
to your config/main.php.
installation error
Tried installing the module multiple times/ways..fresh as well as in existing app. No luck still get same error
Alias "user.UserModule" is invalid. Make sure it points to an existing PHP file and the file is readable.
updated the short tag in php ini as well ..no luck.any solution?
Extremely buggy
This is a very buggy extension, even when following the install tutorial to the T. Steer clear until the developer shows clear intentions to give it an overhaul. The fact alone that he uses short php tags should tell you something.
User groups
Is at possible to assign permissions to groups?
stucked on this Please activate the registration submodule in your config/main.php....
Guys I have installed User management module ..
And stucked on this message ..
Error : 401
"Please activate the registration submodule in your config/main.php. See the installation instructions or registration/RegistrationModule.php for details"
What to do next??
Please Help....
Bug with using HybridAuth
Because the HybridAuth adapter (specifically the getUser method in YumAuthController.php) only accounts for the username as determined by the OpenID provider's data, there seems to be a bug where a user could find an existing account (say, 'admin') and register themselves at an OpenID provider in such a way that the username included in the OpenID response is 'admin'.
The user will then be logged in as admin.
This is even worse if custom OpenID providers are allowed, because they could just setup their own and claim any username.
I believe the fix would be to include the provider's name and the unique identifier in the user table, and verify using this rather than a generated username.
@Ne0nx3r0
Thanks for reporting this critical security problem! I will fix it as soon as possible !
Allowing Multiple Social Associations
The common pattern for using social login is to allow users to use multiple providers for authentication - which should have a separate table for storing associations.
This would be the table that login should reference as well, by provider and provider_identifier - to avoid the security issue identified by @Ne0nx3r0.
See hybridauth yii-ext for an example.
Read docs/Install_tutorial.txt?
Where is it? Where can i find that installation tutorial?
Read docs/Install_tutorial.txt?
Hai jhejhekukuzaizai, you can find it on C:\xampp\htdocs\app_name\protected\modules\user\docs
Not work for me
Hi,thank's for reference but as i want it's don't work....here no any where define how to use translation table in translation or convert multiple language site.?
If any reference or guide for same then please let me know.
Caching not working
Resolved:
I had added "cache" under "user" but now added under "components" section and it's working fine.
6.) Make sure to set a caching component in your application components
section. Yum relies on it. If you do not want to use a cache, add
'components' => array( 'cache' => array('class' => 'system.caching.CDummyCache'),
inside the components section of your config/main.php.
I am following to this step and stuck with lots or error
Property "YumWebUser.cache" is not defined.__
I have set 'cache' => array('class' => 'system.caching.CDummyCache') in config/main.php file as stated in install_tutorial.txt file but could not succeeded.
Can anybody help me for this?
Issue with create / update of user / role etc
Hey,
Every thing seems to be fine in terms of viewing the default info, but cannot update or create new users/roles etc. Page is not loading properly, anyone see anything like this?
I have also tried with an earlier version of the Yii framework, but seems to have the same issue.
As noted further down this page there is at least one fairly obvious error. With the spelling of the word echo.
http://www.yiiframework.com/extension/yii-user-management/#c12667
Module vs core user
I'm using yii-user module. And one thing that is not quite understandable to me is UserIdentity.php
When I call
I get the right user ID. Before this module I used core way of logging in. and with the same code I got the right user ID. But what bugging me is: why now that code takes information from module (I removed old way of logging in). It is the same line of code and it knows that it has to use module. Is it because UserIdentity extends CUserIdentity which is part of yii core?
How to allow controller without login
Hi, can YUM allow me to config a controller/action that allow me to access without auth, because I wana run a crontab, but the code is inside the YumUserController, can I do that, everytime I execute that action without login?
errror 404
where is tutorial ?
i was follow installation instruction in folder docs
result is error 404
how to resolve ?
How do you change redirectUrl after successfull login
Am trying to redirect user to a new controller but the module is set to redirect to site/index i have change all the parameters in the UserModule for redirection but still nothing happens
is it possible ban user by ip address?
is it possible ban user by ip address? And how implement this option?
instalation method
Tutorial for installing and configuring the Yii User Management
Module.
In this Tutorial we will learn how to use the User
Management Module on a fresh created Yii Web Application. Installation
under an existing application is identical to these instructions.
1.) Generate your Webapp:
$ php yii-1.1.10/framework/yiic webapp testdrive
Create a Web application under '/var/www/testdrive'? [Yes|No] Yes
[...]
Your application has been created successfully under /var/www/testdrive.
2.) The Yii User Management Module needs a Database Connection to work. You
now have to setup your MySQL Database and insert the connection
URI in your Application configuration, like this:
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=testdrive', 'emulatePrepare' => true, 'username' => 'root', 'password' => '', 'charset' => 'utf8', // prior to yum0.8rc7 tablePrefix is not necessary anymore, but it can not hurt 'tablePrefix' => '', ),
$ mysql -u root localhost
> CREATE DATABASE
testdrive
;3.) Extract the Yii User Management Module under the modules/ directory
of your new Web Application. Replace the _0.8 with the latest Version
available.
$ cd testdrive/protected
$ mkdir modules
$ cd modules
$ wget http://www.yiiframework.com/extension/yii-user-management/files/User_Management_Module_0.8.tar.bz2
$ tar xvf User_Management_Module_0.8.tar.bz2
4.) The Yii-user-management module contains submodules that you just extracted
into your application's modules/ directory. The installation script will provide
$ [youreditor] protected/config/main.php
Add these lines:
'modules' => array(
'user' => array( 'debug' => true, ) ),
The debug option is needed for the installation and should be set to false
after the installation.
5.) To let your Web Application use the Authentification Methods of
the User Management Module, we need to overwrite the default
Authentification Method in the Application Configuration:
'components'=>array(
'user'=>array(
'class' => 'application.modules.user.components.YumWebUser', 'allowAutoLogin'=>true, 'loginUrl' => array('//user/user/login'), [...] ),
'import'=>array(
'application.modules.user.models.*',
This tells our Web Application that is can access the Model 'User'
even when not in the modules/user environment. This is needed for calling
User::hasRole($role) in your Code to check if the logged in User belongs to the
role. This is explained in the detailed Documentation. It is good to let this
line occur as the first included Model, so you can extend the User-Model with
your own in your Application models/ Directory if you like.
6.) Run the User Management Installer in your Web-Browser:
http://localhost/testdrive/index.php/user/install
or
http://localhost/testdrive/index.php?r=user/install
depending on your URL route setup.
7.) Now the Installer of the User Management Module should appear.
To the right you can set up alternate Table Names used by the
Module. In most cases this is not needed and you can keep this
Settings. If you do change this, be sure to set up the correct table
Names in your Application Configuration, so the User Module can access
them.
Click 'Install Module'. After clicking it, the install script will
create the database tables needed by the module(s). Then it will show
you the neccesary modifications to be made. Add the Modules you need to your
Application Configuration as provided by the install script in config/main.php.
You can also remove the Yum modules you don't want to use.
8.) Make sure to set a caching component. Yum relies on it. If you do not
want to cache, add
'components' => array( 'cache' => array('class' => 'system.caching.CDummyCache'),
to your config/main.php.
Also see http://www.yiiframework.com/doc/guide/1.1/en/caching.overview about
some general information about caching in yii.
9.) Congratulations, you have installed the User Management Module! Lets
tidy up a little bit:
10.) Login as admin/admin and navigate to index.php?r=user/user/admin.
This is your user management administration panel. Click on "Administrate your Users"
Now you are taken to the default Front-End Login-Screen of the User
Management Module. Log in with the Username admin and Password admin.
11.) Click on the 'update Icon' (the pencil) of your administrator User.
Change the Password to something more safe than 'admin'. Click Save.
12.) If you already didn't do it, remove the 'debug' => 'true' line from youri
Application Configuration so your new data doesn't get overwritten accidentally
by the installation process.
Configuration of your freshly installed User Management Module:
Language:
The Yii-User Management Module uses the language that is set in
the Application Configuration. For example, you can add a
'language' => 'de',
in your config/main.php to get German Language strings. At the moment
English, German, French and Polish are supported.
Quick Login Widget:
If you want to display a quick login widget somewhere in your Web Application,
just call in your view file:
<? $this->widget('application.modules.user.components.LoginWidget'); ?>
Password Requirements:
You can setup the password Requirements within the 'passwordRequirements'
option of the Module, for example:
'user' => array(
'passwordRequirements' => array( 'minLen' => 4, 'maxLen' => 16, 'maxRepetition' => 2, 'minDigits' => 3, ),
Please see components/CPasswordValidator.php for possible password
requirement options
User Registration:
Set the Variable 'enableActivationConfirmation' to false in the module configuration to
let users register for your application without needing to receive/click an emailed confirmation link.
Role Management:
You can add up new roles in the Role Manager. To check for access
to this roles, you can use this code Snippet everywhere in your
Yii Application. Most likely it will be used in the ACL Filter of
your Controllers:
if(Yii::app()->user->can('action'))
{
// user is allowed
}
else
{
// user is not allowed to do this
}
Please see the file docs/logging.txt for information on how to set up
the logging functions of the Yii User Management module.
Where to go from now on?
There are some examples on how to extend from the Yii User Management
Module and how to implement project-specific stuff. See the files in
the docs/ directory for all this.
FAQ:
Q: I get an exception when running the Installer
A: Please make sure to log out from any session. Clear your cookies to make
sure you are not logged in in your Web Application anymore.
Q: I get the error Message: CWebUser does not have a method named "isAdmin":
A: Please make sure that you have the following in your application configuration:
'components'=>array( 'user'=>array( 'class' => 'application.modules.user.components.YumWebUser',
Q: I get the error Message: the table "{{users}}" for active record class "YumUser" cannot be found in the database.
A: Please make sure that you have the following in your application configuration:
'db'=>array( 'tablePrefix' => '', [...]
Q: Why doesn´ t the yii-user-management have submodules?
A: Submodules are supported by yii, but having a path like
application.modules.user.modules.role.controllers.YumRoleController
really looks strange, so we decided it is better to keep all modules inside
the root modules/ directory.
Q: I get the following error while installing:
General error: 2014 Cannot execute queries while other unbuffered queries are active
A: thanks to NetDabbler, there is a workaround:
Comment the folowing lines in YumInstallController.php
// $sql = file_get_contents(Yii::getPathOfAlias('application.modules.user.docs') . '/yum_translation.sql');
// $db->createCommand($sql)->execute();
Insert the translation data manually in a cmd window as:
mysql -u yourusername -p testyum < docs/yum_translation.sql
Q: I still got errors !
A: Make sure to enable a caching component, at least CDummyCache, in your config/main.php:
'cache'=>array( 'class'=>'system.caching.CDummyCache', ),
Q: I still got errors !
A: Try to add this in your config/main.php:
'session' => array(
'sessionName' => 'SiteSession', 'class' => 'CHttpSession', 'autoStart' => true, ),
doesn't seem to work
Hi,
this step...
6.) Run the User Management Installer in your Web-Browser: http://localhost/testdrive/index.php/user/install or http://localhost/testdrive/index.php?r=user/install depending on your URL route setup.
leaves me with a blank page.
When I remove
'user' => array( 'debug' => true, ) ),
from the modules section in main.php I get......
user->data()->profile->firstname; public function data() { if($this->_data instanceof YumUser) return $this->_data; else if($this->id && $this->_data = YumUser::model()->findByPk($this->id)) return $this->_data; else return $this->_data = new YumUser(); } public function checkAccess($operation, $params=array(), $allowCaching=true) { if(!Yum::hasModule('role') || Yum::module('role')->useYiiCheckAccess ) return parent::checkAccess($operation, $params, $allowCaching); return $this->can($operation); } public function can($action) { Yii::import('application.modules.role.models.*'); foreach ($this->data()->getPermissions() as $permission) if ($permission == $action) return true; return false; } /** * Checks if this (non-admin) User can administrate some users */ public static function hasUsers($uid = 0) { if($uid == 0) $uid = Yii::app()->user->id; $user = YumUser::model()->cache(500)->findByPk($uid); return isset($user->users) && $user->users !== array(); } public static function hasRoles($uid = 0) { if($uid == 0) $uid = Yii::app()->user->id; $user = YumUser::model()->cache(500)->findByPk($uid); $flag = false; if(isset($user->roles)) foreach($user->roles as $role) if (isset($role->roles) && $role->roles !== array()) $flag = true; return $flag; } public function getRoles() { $t = ' '; $user = Yii::app()->user->data(); $roles = $user->roles; if($user instanceof YumUser && $roles) foreach($roles as $role) $t .= $role->title .' '; return $t; } /** * Checks if this (non-admin) User can administrate the given user */ public static function hasUser($username, $uid = 0) { if($uid == 0) $uid = Yii::app()->user->getId(); // Every user can modify himself if($username == $uid) return true; $user = YumUser::model()->cache(500)->findByPk($uid); if(!is_array($username)) $username = array ($username); if(isset($user->users)) foreach($user->users as $userobj) { if(in_array($userobj->username, $username) || in_array($userobj->id, $username)) return true; } return false; } /** * Checks if the user has the given Role * @mixed Role string or array of strings that should be checked * @int (optional) id of the user that should be checked * @return bool Return value tells if the User has access or hasn't access. */ public function hasRole($role, $uid = 0) { if(Yum::hasModule('role')) { Yii::import('application.modules.role.models.*'); if($uid == 0) $uid = Yii::app()->user->id; if(!is_array($role)) $role = array ($role); if($uid && $user = YumUser::model()->with('roles')->find( 't.id = '.$uid)) { // Check if a user has a active membership and, if so, add this // to the roles $roles = $user->roles; if(Yum::hasModule('membership')) $roles = array_merge($roles, $user->getActiveMemberships()); if(isset($roles)) foreach($roles as $roleobj) { if(in_array($roleobj->title, $role) || in_array($roleobj->id, $role)) return true; } } } return false; } public function loggedInAs() { if($this->isGuest) return Yum::t('Guest'); else return $this->data()->username; } /** * Return admin status. * @return boolean */ public function isAdmin() { if($this->isGuest) return false; else return Yii::app()->user->data()->superuser; } } ?>
as browseroutput when I visit... http://beebuy.nl/webapp/index.php?r=user/install
visiting http://beebuy.nl/webapp/index.php
gets me
PHP warning include(YumWebUser.php): failed to open stream: No such file or directory and more
This is how I put the extension in my tree
What am I missing?
Sincerely,
Patrick
update to problem
I found an error in my main.php which I corrected and now
http://beebuy.nl/webapp/index.php?r=user/install
leads to:
PHP warning include(UserModule.php): failed to open stream: No such file or directory /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/YiiBase.php(427) 415 { 416 include($classFile); 417 if(YII_DEBUG && basename(realpath($classFile))!==$className.'.php') 418 throw new CException(Yii::t('yii','Class name "{class}" does not match class file "{file}".', array( 419 '{class}'=>$className, 420 '{file}'=>$classFile, 421 ))); 422 break; 423 } 424 } 425 } 426 else 427 include($className.'.php'); 428 } 429 else // class name with namespace in PHP 5.3 430 { 431 $namespace=str_replace('\\','.',ltrim($className,'\\')); 432 if(($path=self::getPathOfAlias($namespace))!==false) 433 include($path.'.php'); 434 else 435 return false; 436 } 437 return class_exists($className,false) || interface_exists($className,false); 438 } 439 return true; Stack Trace #0 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/YiiBase.php(427): YiiBase::autoload() #1 unknown(0): YiiBase::autoload("UserModule") #2 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/YiiBase.php(206): spl_autoload_call("UserModule") #3 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/base/CModule.php(282): YiiBase::createComponent("user.UserModule", "user", null, array("debug" => true)) #4 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/web/CWebApplication.php(337): CModule->getModule("user") #5 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/web/CWebApplication.php(276): CWebApplication->createController("user/install") #6 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/web/CWebApplication.php(141): CWebApplication->runController("user/install") #7 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/base/CApplication.php(180): CWebApplication->processRequest() #8 – /Library/Server/Web/Data/Sites/beebuy.nl/webapp/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(); 14 15
http://beebuy.nl/webapp/ leads to:
PHP warning include(YumWebUser.php): failed to open stream: No such file or directory /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/YiiBase.php(427) 415 { 416 include($classFile); 417 if(YII_DEBUG && basename(realpath($classFile))!==$className.'.php') 418 throw new CException(Yii::t('yii','Class name "{class}" does not match class file "{file}".', array( 419 '{class}'=>$className, 420 '{file}'=>$classFile, 421 ))); 422 break; 423 } 424 } 425 } 426 else 427 include($className.'.php'); 428 } 429 else // class name with namespace in PHP 5.3 430 { 431 $namespace=str_replace('\\','.',ltrim($className,'\\')); 432 if(($path=self::getPathOfAlias($namespace))!==false) 433 include($path.'.php'); 434 else 435 return false; 436 } 437 return class_exists($className,false) || interface_exists($className,false); 438 } 439 return true; Stack Trace #0 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/YiiBase.php(427): YiiBase::autoload() #1 unknown(0): YiiBase::autoload("YumWebUser") #2 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/YiiBase.php(217): spl_autoload_call("YumWebUser") #3 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/base/CModule.php(386): YiiBase::createComponent(array("class" => "application.modules.user.components.YumWebUser", "allowAutoLogin" => true, "loginUrl" => array("//user/user/login"))) #4 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/base/CModule.php(103): CModule->getComponent("user") #5 – /Library/Server/Web/Data/Sites/beebuy.nl/webapp/themes/bootstrap/views/layouts/main.php(25): CModule->__get("user") 20 'class'=>'bootstrap.widgets.TbMenu', 21 'items'=>array( 22 array('label'=>'Home', 'url'=>array('/site/index')), 23 array('label'=>'About', 'url'=>array('/site/page', 'view'=>'about')), 24 array('label'=>'Contact', 'url'=>array('/site/contact')), 25 array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest), 26 array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest) 27 ), 28 ), 29 ), 30 )); ?> #6 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/web/CBaseController.php(126): require("/Library/Server/Web/Data/Sites/beebuy.nl/webapp/themes/bootstrap...") #7 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/web/CBaseController.php(95): CBaseController->renderInternal("/Library/Server/Web/Data/Sites/beebuy.nl/webapp/themes/bootstrap...", array("content" => "<div id="content"> <div class="hero-unit"><h1>Welcome to My Be..."), true) #8 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/web/widgets/CContentDecorator.php(76): CBaseController->renderFile("/Library/Server/Web/Data/Sites/beebuy.nl/webapp/themes/bootstrap...", array("content" => "<div id="content"> <div class="hero-unit"><h1>Welcome to My Be..."), true) #9 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/web/widgets/CContentDecorator.php(54): CContentDecorator->decorate("<div id="content"> <div class="hero-unit"><h1>Welcome to My Be...") #10 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/web/widgets/COutputProcessor.php(44): CContentDecorator->processOutput("<div id="content"> <div class="hero-unit"><h1>Welcome to My Be...") #11 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/web/CBaseController.php(206): COutputProcessor->run() #12 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/web/CBaseController.php(300): CBaseController->endWidget("CContentDecorator") #13 – /Library/Server/Web/Data/Sites/beebuy.nl/webapp/protected/views/layouts/column1.php(6): CBaseController->endContent() 1 <?php /* @var $this Controller */ ?> 2 <?php $this->beginContent('//layouts/main'); ?> 3 <div id="content"> 4 <?php echo $content; ?> 5 </div><!-- content --> 6 <?php $this->endContent(); ?> #14 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/web/CBaseController.php(126): require("/Library/Server/Web/Data/Sites/beebuy.nl/webapp/protected/views/...") #15 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/web/CBaseController.php(95): CBaseController->renderInternal("/Library/Server/Web/Data/Sites/beebuy.nl/webapp/protected/views/...", array("content" => " <div class="hero-unit"><h1>Welcome to My BeeBuy Web Application..."), true) #16 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/web/CController.php(784): CBaseController->renderFile("/Library/Server/Web/Data/Sites/beebuy.nl/webapp/protected/views/...", array("content" => " <div class="hero-unit"><h1>Welcome to My BeeBuy Web Application..."), true) #17 – /Library/Server/Web/Data/Sites/beebuy.nl/webapp/protected/controllers/SiteController.php(32): CController->render("index") 27 */ 28 public function actionIndex() 29 { 30 // renders the view file 'protected/views/site/index.php' 31 // using the default layout 'protected/views/layouts/main.php' 32 $this->render('index'); 33 } 34 35 /** 36 * This is the action to handle external exceptions. 37 */ #18 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/web/actions/CInlineAction.php(49): SiteController->actionIndex() #19 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/web/CController.php(308): CInlineAction->runWithParams(array()) #20 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/web/CController.php(286): CController->runAction(CInlineAction) #21 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/web/CController.php(265): CController->runActionWithFilters(CInlineAction, array()) #22 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/web/CWebApplication.php(282): CController->run("") #23 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/web/CWebApplication.php(141): CWebApplication->runController("") #24 + /Library/Server/Web/Data/Sites/beebuy.nl/yii/framework/base/CApplication.php(180): CWebApplication->processRequest() #25 + /Library/Server/Web/Data/Sites/beebuy.nl/webapp/index.php(13): CApplication->run()
Please help:-)
fix for problems:)
short_open_tag was the issue. I found the tip to put short_open_tagS = on in my php.ini but that didn't help;-) I tested the short open tag and found out.
I removed the S in my php.ini, restarted Apache and it works:-)
?
Okay I'm only a beginner, but I do as the instructions and it simply doesn't work for me.
"The table "{{user}}" for active record class "YumUser" cannot be found in the database."
Wher is it told that I have to make one? And do I have to make a model also?
But when I have a user table I get another error message.
UPDATE: I got closer to the solution. a translation table is needed but this is mentioned nowhere. link
next, a users table is needed, i've made one with a few usual fields. now the installer appeared.
now I get a "Trying to get property of non-object" in modules\user\views\user\login.php(124)
You can register <?php echo CHtml::link('here', Yum::module('registration')->registrationUrl);?>what next?! this gets me crazy.
UPDATE_2: if I comment out the registration link, it seems to work. somehow it needs to be fixed, but I don't know if I'm able to do that yet.
otherwise, it's a mess. I don't think it's a usable thing. I finish dealing with this.
install Bugs
I just tried this out today and hit a bunch of errors here are just a few that i ran into in the first few minutes of using it.
Before you run the installer you must create the translation table
CREATE TABLE IF NOT EXISTS translation ( `message` varbinary(255) NOT NULL, `translation` char(255) NOT NULL, `language` char(5) NOT NULL, `category` char(255) NOT NULL, PRIMARY KEY (`message`,`language`,`category`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
after you run the installer you will get an array of items to add to your config->main->modules along with that code add
'registration' => array( 'registrationUrl' => '../registration/registration/registration', ),
You dont have to comment anything out like @cappadochian suggested. This could cause problems later just add the above line to your config main.
Also, while in your config->main add all of the user modules you wish to use in the import section. Once the module gets updated you shouldn't have to import all of them. until then...auto load them all.
'import'=>array( ...other imports... 'application.modules.user.models.*', 'application.modules.membership.models.*', 'application.modules.registration.models.*', 'application.modules.friendship.models.*', 'application.modules.profile.models.*', 'application.modules.role.models.*', 'application.modules.usergroup.models.*', ),
or you will get a bunch of errors for not being able to find models.
Also, another point is this modules uses <? in some places and <?php, I'd recommend changing all of the <? to <?php because if your like me you will just get a bunch of php code on the screen that doesn't render correctly.
You can see all the current Issues on github here is the one for the comment below this.
https://github.com/thyseus/yii-user-management/issues/194
Also, you can use your own layouts by overriding the default ones i.e. in your config main under module->users you can do something like the following
'user' => array( 'debug' => false, 'passwordRequirements' => array('minLen' => 9, 'maxLen' => 30, 'maxRepetition' => 5, 'minDigits' => 3,), 'userTable' => 'user', 'translationTable' => 'translations', 'layout' => '//layouts/column2', 'loginLayout' => '//layouts/column2', 'adminLayout' => '//layouts/column2', ),
By using //layouts/yourLayoutFileName yii will first look in your theme (if you are using one) then look in your protected/site/views/layouts/.
Note that this might not show any of the buttons associated with the module. You can create your own layouts under your theme or where ever and use them with the modules menus etc and leave the module alone since it will probably change frequently. You would have to do the same for every module you are using under the module. For newbies you can almost always override any $public variable in the modules main file..this is one of the reasons it's public.
Other Errors I found
line 23 of modules/profile/views/profile/views.php
'user.friendship.views.friendship.friends', array( and needs to be 'friendship.views.friendship.friends', array(
line 442 of modules/user/friendship/models/YumFriendship.php
is Yii::import('user.friendship.models.YumFriendship'); needs to be Yii::import('friendship.models.YumFriendship');
line 32 in modules/friendship/views/friendship/friendship.php
Yii::import('user.friendship.controllers.YumFriendshipController'); needs to be Yii::import('friendship.controllers.YumFriendshipController');
lines 46-57 in modules/profile/controllers/yumPrivacysettingController.php
if (isset($_POST['YumProfile'])) { $profile = $model->user->profile; $profile->attributes = $_POST['YumProfile']; $profile->validate(); } if (!$model->hasErrors()) { $profile->save(); $model->save(); Yum::setFlash('Your privacy settings have been saved'); $this->redirect(array('//profile/profile/view', 'id' => $model->user_id)); } Needs to be if (isset($_POST['YumProfile'])) { $profile = $model->user->profile; $profile->attributes = $_POST['YumProfile']; $profile->validate(); if (!$model->hasErrors()) { $profile->save(); $model->save(); Yum::setFlash('Your privacy settings have been saved'); $this->redirect(array('//profile/profile/view', 'id' => $model->user_id)); } } still doesn't save after this though
unfortunately I need a user management / RBAC by tomorrow and it's going to be faster to write my own then to try and fix this/wait for updates :(. Along with hitting errors on almost every page this is doing upwards of 14-15 queries per page in some of the user views and that is absolutely crazy for what it's doing. It also stores the translations in the db which I don't like either (just personal preference). Needless to say I won't be updating this.
This looks promising and hopefully the bugs will get worked out.
Compatible with Yii 2?
Is it?
Is someone going to update this great extension?
Yum development
I still develop yii-user-management on github:
https://github.com/thyseus/yii-user-management
a lot of bugfixes have happened there, and its really time for a new stable release.
Bugs will be fixed for all time, but no new features will go into yii-user-management (at least not from me, i accept pull requests of course !)
In the long-term i will contribute to existing yii 2 user modules.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.