[Module] Yii User Management Module Discussion, Bug Reports and Feature Requests for the User Management
#41
Posted 14 April 2010 - 11:26 PM
CWebUser does not have a method named "isAdmin".
#42
Posted 15 April 2010 - 03:08 AM
i added auto detection for webapplicationend to change views via end if enabled
fixed paths correctly, default layouts are now edited in default application location
here are my changes
#43
Posted 19 April 2010 - 12:00 AM
mithereal, on 15 April 2010 - 03:08 AM, said:
i added auto detection for webapplicationend to change views via end if enabled
fixed paths correctly, default layouts are now edited in default application location
here are my changes
You should contact thyseus about submitting your changes directly to the repository :-)
#44
Posted 19 April 2010 - 02:11 AM
Also i like the idea of providing a 'default front and back-end' in the Yum module that can
be switched off, if you want the module to integrate in the existing Web Application layout. Are there
any skilled backend Designers that likes to do this? (I have my skills in coding, i lack design skills...)
Would be cool to integrate your bugfixes and changes into svn trunk/
Do you know about the repository at http://code.google.c...ser-management/ ?
#45
Posted 19 April 2010 - 01:23 PM
I just downloaded 0.5 and yii 1.1.1
INSTALLED ON NEW TESTDRIVE
======================================
1) Created fresh testdrive and the database according InstallTutorial.txt
--------------------------------------
2) http://localhost/tes...?r=user/install
CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1364 Field 'match' doesn't have a default value
same goes to range,error_message,other_validator,default,timestamp fields
3) have to manually add "default '0'" to all the fields to go through installation. MySQL ver 5.0.51
--------------------------------------
4) login as admin.
5) click on manage roles
6) click on UserCreator
Error 404
The system is unable to find the requested action "role".
--------------------------------------

9) create role
10) able to save.
I logout from the default testdrive menu...not the one under operations menu. I think a note in your installation guide to remind users to change the menu login url is great for new users like myself. Otherwise it cause some frustration login/out and seeing thinks don't work
--------------------------------------
11) Operation Menu -> Manage "p"rofile Fields
======================================
INSTALLED ON EXISTING BLOG DEMO
======================================
When I tried installing this on "blog" demo (with db and tables all created) I got these error:
Error 500
The table "users" for active record class "User" cannot be found in the database.
Please make this installable on blog demo rather than fresh testdrive because it will be a more complete base application for us to understand yii better..
--------------------------------------
THANK YOU VERY MUCH!!
#46
Posted 27 April 2010 - 11:14 PM
This looks like a very good module. I installed it, but modified the names of the tables and I can't get it to work.
In the Install Tutorial included, step 7 says:
Quote
To the right you can set up alternate Table Names used by the
Module. In most cases this is not needed and you can ignore 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.
What and where should I change this for the module to work?
Thank you.
#47
Posted 29 April 2010 - 06:30 PM
I've took a brief overview of the extension's code and it looks really impressive. Congrats for that!
I have the same problem as @transistor. The exception fired is: 'The table "users" for active record class "User" cannot be found in the database.'
Can we download or checkout the db tables structure, or should we retrieve it from the code or should it be created automatically from the install page?
Thanks in advance!
Regards,
mirrorps
e-commerce website built with Yii
#48
Posted 19 May 2010 - 07:56 PM
The fix for this was to edit user/models/Profile.php around line 45 you need to change:
if ($field->field_type =='VARCHAR') ||$field->field_type=='TEXT') { $field_rule = array($field->varname, 'length', 'max'=>$field->field_size, 'min' => $field->field_size_min); if ($field->error_message) $field_rule['message'] = Yii::t("UserModule.user", $field->error_message); array_push($rules,$field_rule); }
To:
if ($field->field_type =='VARCHAR') { $field_rule = array($field->varname, 'length', 'max'=>$field->field_size, 'min' => $field->field_size_min); if ($field->error_message) $field_rule['message'] = Yii::t("UserModule.user", $field->error_message); array_push($rules,$field_rule); } if ($field->field_type=='TEXT') { $field_rule = array($field->varname, 'length', 'min' => $field->field_size_min); if ($field->error_message) $field_rule['message'] = Yii::t("UserModule.user", $field->error_message); array_push($rules,$field_rule); }
VARCHAR and TEXT fields cannot have the same rules because a Profile Field of type TEXT has the "Max Length" field set to '0' and it is readonly so we cannot edit it.
Hope this helps some people out there.
I found a bunch of other small bugs but can't remember them all. If you want to give me access to the SVN I will go through a clean install and submit bug fixes for you.
#49
Posted 20 May 2010 - 10:53 PM
there were many table fields with {{ prefixing the tables which caused issues so they were removed.
there is a bug in the registration page where ccapthca widget is called not displaying anything, could someone please review this and tell me how you would fix it (im not the best with widgets).
installed on vanilla yii 1.1.2.
Attached File(s)
-
user.zip (267.91K)
Number of downloads: 34
#50
Posted 21 May 2010 - 01:21 AM
Please take a look on the SVN repository to see what the new yii-user0.6 will bring. I think the overall quality of the module has been improved a lot, and many of these small bugs should have been fixed.
Especially since i got some much appreciated help from Poland

http://code.google.c...ser-management/
#51
Posted 21 May 2010 - 07:58 AM
Source File /home/hoppin/public_html/framework/base/CComponent.php(237) 00225: * @since 1.0.2 00226: */ 00227: public function __call($name,$parameters) 00228: { 00229: if($this->_m!==null) 00230: { 00231: foreach($this->_m as $object) 00232: { 00233: if($object->getEnabled() && method_exists($object,$name)) 00234: return call_user_func_array(array($object,$name),$parameters); 00235: } 00236: } 00237: throw new CException(Yii::t('yii','{class} does not have a method named "{name}".', 00238: array('{class}'=>get_class($this), '{name}'=>$name))); 00239: } 00240: 00241: /** 00242: * Returns the named behavior object. 00243: * The name 'asa' stands for 'as a'. 00244: * @param string the behavior name 00245: * @return IBehavior the behavior object, or null if the behavior does not exist 00246: * @since 1.0.2 00247: */ 00248: public function asa($behavior) 00249: { Stack Trace #0 [internal function]: CComponent->__call('hasUsers', Array) #1 /home/hoppin/public_html/framework/base/CComponent.php(587) : eval()'d code(1): CWebUser->hasUsers() #2 /home/hoppin/public_html/framework/base/CComponent.php(587): eval() #3 /home/hoppin/public_html/framework/web/auth/CAccessControlFilter.php(337): CComponent->evaluateExpression('Yii::app()->use...', Array) #4 /home/hoppin/public_html/framework/web/auth/CAccessControlFilter.php(240): CAccessRule->isExpressionMatched(Object(CWebUser)) #5 /home/hoppin/public_html/framework/web/auth/CAccessControlFilter.php(111): CAccessRule->isUserAllowed(Object(CWebUser), Object(UserController), Object(CInlineAction), '173.65.219.135', 'GET') #6 /home/hoppin/public_html/framework/web/filters/CFilter.php(39): CAccessControlFilter->preFilter(Object(CFilterChain)) #7 /home/hoppin/public_html/framework/web/CController.php(999): CFilter->filter(Object(CFilterChain)) #8 /home/hoppin/public_html/framework/web/filters/CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) #9 /home/hoppin/public_html/framework/web/filters/CFilterChain.php(126): CInlineFilter->filter(Object(CFilterChain)) #10 /home/hoppin/public_html/framework/web/CController.php(283): CFilterChain->run() #11 /home/hoppin/public_html/framework/web/CController.php(257): CController->runActionWithFilters(Object(CInlineAction), Array) #12 /home/hoppin/public_html/framework/web/CWebApplication.php(320): CController->run('admin') #13 /home/hoppin/public_html/framework/web/CWebApplication.php(120): CWebApplication->runController('user/user/admin') #14 /home/hoppin/public_html/framework/base/CApplication.php(135): CWebApplication->processRequest() #15 /home/hoppin/public_html/index.php(12): CApplication->run() #16 {main}
Any idea's what could be causing this? It's a clean installation of 0.5 w/ a clean Yii framework install.
#52
Posted 21 May 2010 - 08:03 AM
CException Description CWebUser does not have a method named "isAdmin". Source File /home/hoppin/public_html/framework/base/CComponent.php(237) 00225: * @since 1.0.2 00226: */ 00227: public function __call($name,$parameters) 00228: { 00229: if($this->_m!==null) 00230: { 00231: foreach($this->_m as $object) 00232: { 00233: if($object->getEnabled() && method_exists($object,$name)) 00234: return call_user_func_array(array($object,$name),$parameters); 00235: } 00236: } 00237: throw new CException(Yii::t('yii','{class} does not have a method named "{name}".', 00238: array('{class}'=>get_class($this), '{name}'=>$name))); 00239: } 00240: 00241: /** 00242: * Returns the named behavior object. 00243: * The name 'asa' stands for 'as a'. 00244: * @param string the behavior name 00245: * @return IBehavior the behavior object, or null if the behavior does not exist 00246: * @since 1.0.2 00247: */ 00248: public function asa($behavior) 00249: { Stack Trace #0 [internal function]: CComponent->__call('isAdmin', Array) #1 /home/hoppin/public_html/protected/modules/user/controllers/YumUserController.php(26): CWebUser->isAdmin() #2 /home/hoppin/public_html/framework/web/CController.php(998): YumUserController->accessRules() #3 /home/hoppin/public_html/framework/web/filters/CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) #4 /home/hoppin/public_html/framework/web/filters/CFilterChain.php(126): CInlineFilter->filter(Object(CFilterChain)) #5 /home/hoppin/public_html/framework/web/CController.php(283): CFilterChain->run() #6 /home/hoppin/public_html/framework/web/CController.php(257): CController->runActionWithFilters(Object(CInlineAction), Array) #7 /home/hoppin/public_html/framework/web/CWebApplication.php(320): CController->run('login') #8 /home/hoppin/public_html/framework/web/CWebApplication.php(120): CWebApplication->runController('user/user/login') #9 /home/hoppin/public_html/framework/base/CApplication.php(135): CWebApplication->processRequest() #10 /home/hoppin/public_html/index.php(12): CApplication->run() #11 {main} 2010-05-21 09:35:23 Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8e-fips-rhel5 mod_mono/2.6 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_perl/2.0.4 Perl/v5.8.8 Yii Framework/1.1.2
#53
Posted 23 May 2010 - 05:46 AM

#54
Posted 03 June 2010 - 06:06 PM
but now have a problem mentioned above:
when trying to login index.php/user/user/login
"CWebUser does not have a method named "isAdmin"."
here's the Stack Trace
#0 [internal function]: CComponent->__call('isAdmin', Array)
#1 C:\wamp\www\***\protected\modules\user\controllers\YumUserController.php(26): CWebUser->isAdmin()
#2 C:\wamp\www\framework\web\CController.php(998): YumUserController->accessRules()
#3 C:\wamp\www\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain))
#4 C:\wamp\www\framework\web\filters\CFilterChain.php(126): CInlineFilter->filter(Object(CFilterChain))
#5 C:\wamp\www\framework\web\CController.php(283): CFilterChain->run()
#6 C:\wamp\www\framework\web\CController.php(257): CController->runActionWithFilters(Object(CInlineAction), Array)
#7 C:\wamp\www\framework\web\CWebApplication.php(320): CController->run('login')
#8 C:\wamp\www\framework\web\CWebApplication.php(120): CWebApplication->runController('user/user/login')
#9 C:\wamp\www\framework\base\CApplication.php(135): CWebApplication->processRequest()
#10 C:\wamp\www\***\index.php(12): CApplication->run()
#11 {main}
#55
Posted 13 June 2010 - 11:30 PM
First of all, I'm completely new to Yii, as a matter of fact, this is my first PHP framework ever, but thanks to all the "pain" and "suffering" that your extension has caused me, I've got a better understanding of it, than by reading the tutorials :-D
Now, the "pain and suffering" were due to the following problem:
- In 0.6, if you install it on a completely new webapp, after going step by step through the install documentation, everything goes well, login, go to "Manage Profile Fields" and you will get an error:
The table "{{profile_fields}}" for active record class "YumProfileField" cannot be found in the database.
I spent quiet some time trying to figure this out, but due to my "noobiness" in Yii, I was unsuccessful.
However, in 0.5 it doesn't happen, but I also noticed, huge difference in directory structure between 0.5 and 0.6:
0.5: ../protected/modules/user/modules will have:
- messages/
- profiles/
- role/
0.6: ../protected/modules/user/modules will have exact same directories as modules/user/*
Any thoughts? So far I'm enjoying Yii and definitely benefiting from your extension, which I find to be awesome! :-)
#56
Posted 18 June 2010 - 09:39 AM
I'm new in the use of Yii and I've choosen to use Yum for the user management (from SVN r89),
here are a few difficulties (and suggestion) that I encountered during the setup process:
* The online wiki is outdated, it should reference the txt file in the docs directory
* The "Install Demo data" has a few bugs due to missed insertion of NOT NULL fields (without default value) as:
+ `timestamp` in profileTable
+ `hint`, `match`, `range`, `error_message`, `other_validator`, `default` in profileFieldsTable
I solved these modifiing the YumInstallController.php
if(isset($_POST['installProfiles']))
{
$sql = "INSERT INTO `".$profileTable."` (`profile_id`, `timestamp`, `user_id`, `lastname`, `firstname`, `email`) VALUES
(1, 1, 0, 'admin','admin','webmaster@example.com'),
(2, 2, 0, 'demo','demo','demo@example.com')";
$db->createCommand($sql)->execute();
$sql = "INSERT INTO `".$profileFieldsTable."` (`varname`, `title`, `field_type`, `field_size`, `required`, `visible`, `hint`, `match`, `range`, `error_message`, `other_validator`, `default`) VALUES
('email', 'E-Mail', 'VARCHAR', 255, 1, 2, '', '', '', '', '', ''),
('firstname', 'First name', 'VARCHAR', 255, 1, 2, '', '', '', '', '', ''),
('lastname', 'Last name', 'VARCHAR', 255, 1, 2, '', '', '', '', '', '')";
$db->createCommand($sql)->execute();
}
+ I used different table names in the install process and:
- I had to discover myself wich parameters to put in the module configuration. It was specified only in submodules.txt
- In the YumUser.php Model there was a duplicate line that I had to comment to let my personalized name work:
public function tableName()
{
if (isset(Yii::app()->controller->module->usersTable))
$this->_tableName = Yii::app()->controller->module->usersTable;
elseif (isset(Yii::app()->modules['user']['usersTable']))
$this->_tableName = Yii::app()->modules['user']['usersTable'];
else
$this->_tableName = '{{users}}'; // fallback if nothing is set
//$this->_tableName = 'users'; // fallback if nothing is set <<------- THIS IS THE LINE
return YumHelper::resolveTableName($this->_tableName,$this->getDbConnection());
}
After this simple issues my understanding stopped because I'm still very new to yii,
but I think there is some problem with the profiles when the view tries to access the ->profile.
I hope I've been usefull, good work ;-)
#57
Posted 19 June 2010 - 09:32 PM
great module, I love it!
I'm using the Yii dev branch for development (because it has the theming bug fixed) and I'm getting this error message after my user session expires:
trim() expects parameter 1 to be string, array given
If I log in again, it's fine ...
00225: { 00226: unset($params[$this->routeVar]); 00227: foreach($params as &$param) 00228: if($param===null) 00229: $param=''; 00230: if(isset($params['#'])) 00231: { 00232: $anchor='#'.$params['#']; 00233: unset($params['#']); 00234: } 00235: else 00236: $anchor=''; 00237: $route=trim($route,'/'); // !!!!!!!!!!!!!! THIS IS THE LINE !!!!!!!!! 00238: foreach($this->_rules as $rule) 00239: { 00240: if(($url=$rule->createUrl($this,$route,$params,$ampersand))!==false) 00241: return $rule->hasHostInfo ? $url.$anchor : $this->getBaseUrl().'/'.$url.$anchor; 00242: } 00243: return $this->createUrlDefault($route,$params,$ampersand).$anchor; 00244: } 00245: 00246: /** 00247: * Contructs a URL based on default settings. 00248: * @param string the controller and the action (e.g. article/read) 00249: * @param array list of GET parameters
--iM
The maker rests. The wheel’s in motion.
-- Imre Madách
check out Yii2 Theme Factory at https://yii2.themefactory.net
#58
Posted 20 June 2010 - 11:12 AM
Thanks for the great module! It's very usefull!
Yet i encountered a problem: It is told, that integrating with SRBAC should not be a problem. Yet I had to realize that there is a huge problem:
I'm trying to use Yii-user-management module for everything it offers - except roles. Thus i have to overwrite the default Authentication Methods:
'components'=>array( 'user'=>array( 'class' => 'application.modules.user.components.WebUser', // enable cookie-based authentication 'allowAutoLogin'=>true, 'loginUrl' => array('/user/user/login'), ),
and autoload all classes:
'import'=>array( 'application.modules.user.models.*', [...]
doing so Yum overwrites the checkAccess()-Method with it's own. Trying to use this Method as follows:
if(Yii::app()->user->checkAccess('View Post')) { echo "This is a Test!"; }
does not work anymore with the rules specified in SRBAC.
Is there any solution to my problem? I'm trying to avoid changing to much in the source code of Yum to be able to upgrade easily once a new version is released. Hope you can help!
regards
#59
Posted 20 June 2010 - 11:36 AM
renaming the Method checkAccess() in components\WebUser.php to yumCheckAccess() - or anything else - solves the problem. I submitted a Issue. I hope this will be fixed to avoid future problems.
Also I'm not shure if I ask to much here, but it would really be great if the authors of yii-user-management and SRBAC would join efforts. Eg it'd be great if SRBAC could be enabled as a module of yii-user-management.
regards
#60
Posted 21 June 2010 - 12:13 AM
May be user/profile, user/logout, user/login ?