hi!
I’m not sure, but i think for this to work all the view files need to be in ‘/view/default’ or directly in ‘/view’
regards
hi!
I’m not sure, but i think for this to work all the view files need to be in ‘/view/default’ or directly in ‘/view’
regards
@raphi: Your issue arrived and i will think about this issue in the next release.
to put SRBAC and YUM together is a good idea, maybe we will do this for a 1.0 “stable” release in the long-term future but there is no problem with using both modules in your web application at the moment.
this is the route system of yii that defaults to module/controller/view. so it is user/user/admin, for example. if you want to avoid these, you can set URL rewrite rules to let it look like user/admin or whatever you like.
i will soon release yii-user 0.7 cause i have found a lot of small flaws in the 0.6 release.
Had some troubles installing this module on Blog demo. Got an error
YiiBase::include(User.php) [<a href='function.YiiBase-include'>function.YiiBase-include</a>]: failed to open stream: No such file or directory
So i’ve changed
'author' => array(self::BELONGS_TO, 'User', 'author_id'),
to
'author' => array(self::BELONGS_TO, 'YumUser', 'author_id'),
in /models/Post.php. Am I right? Maybe there should be a correct way?
You already use two-level route (user/install), so the module can have controller(s) for profile, logout, login, … with default action(s)
Hi,
Great Module!, Thanks for your great job.
When trying to create a new user (registration) I got this error:
CException
Description
Property "UserModule.disableEmailActivation" is not defined.
Source File
D:\MOI\yii-1.1.2.r2086\framework\base\CModule.php(88)
00076: /**
00077: * Getter magic method.
00078: * This method is overridden to support accessing application components
00079: * like reading module properties.
00080: * @param string application component or property name
00081: * @return mixed the named property value
00082: */
00083: public function __get($name)
00084: {
00085: if($this->hasComponent($name))
00086: return $this->getComponent($name);
00087: else
00088: return parent::__get($name);
00089: }
00090:
00091: /**
00092: * Checks if a property value is null.
00093: * This method overrides the parent implementation by checking
00094: * if the named application component is loaded.
00095: * @param string the property name or the event name
00096: * @return boolean whether the property value is null
00097: */
00098: public function __isset($name)
00099: {
00100: if($this->hasComponent($name))
Stack Trace
#0 D:\MOI\yii-1.1.2.r2086\framework\base\CModule.php(88): CComponent->__get('disableEmailAct...')
#1 D:\MOI\yii-1.1.2.r2086\yiiregalos\protected\modules\user\UserModule.php(101): CModule->__get('disableEmailAct...')
#2 D:\MOI\yii-1.1.2.r2086\yiiregalos\protected\modules\user\models\YumUser.php(120): UserModule->__get('disableEmailAct...')
#3 D:\MOI\yii-1.1.2.r2086\yiiregalos\protected\modules\user\controllers\YumUserController.php(94): YumUser->register('moi', 'moi12', 'noanonimo@gmail...')
#4 D:\MOI\yii-1.1.2.r2086\framework\web\actions\CInlineAction.php(32): YumUserController->actionRegistration()
#5 D:\MOI\yii-1.1.2.r2086\framework\web\CController.php(300): CInlineAction->run()
#6 D:\MOI\yii-1.1.2.r2086\framework\web\filters\CFilterChain.php(129): CController->runAction(Object(CInlineAction))
#7 D:\MOI\yii-1.1.2.r2086\framework\web\filters\CFilter.php(41): CFilterChain->run()
#8 D:\MOI\yii-1.1.2.r2086\framework\web\CController.php(999): CFilter->filter(Object(CFilterChain))
#9 D:\MOI\yii-1.1.2.r2086\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain))
#10 D:\MOI\yii-1.1.2.r2086\framework\web\filters\CFilterChain.php(126): CInlineFilter->filter(Object(CFilterChain))
#11 D:\MOI\yii-1.1.2.r2086\framework\web\CController.php(283): CFilterChain->run()
#12 D:\MOI\yii-1.1.2.r2086\framework\web\CController.php(257): CController->runActionWithFilters(Object(CInlineAction), Array)
#13 D:\MOI\yii-1.1.2.r2086\framework\web\CWebApplication.php(320): CController->run('registration')
#14 D:\MOI\yii-1.1.2.r2086\framework\web\CWebApplication.php(120): CWebApplication->runController('user/user/regis...')
#15 D:\MOI\yii-1.1.2.r2086\framework\base\CApplication.php(135): CWebApplication->processRequest()
#16 D:\MOI\yii-1.1.2.r2086\yiiregalos\index.php(12): CApplication->run()
#17 {main}
2010-06-23 12:17:31 Apache/2.2.8 (Win32) DAV/2 mod_ssl/2.2.8 OpenSSL/0.9.8g mod_autoindex_color mod_fastcgi/2.4.6 PHP/5.2.5 Yii Framework/1.1.2
Look into /protected/modules/user/UserModule.php
on Line 16 there should be
public $disableEmailActivation = false;
isn’t there?
regards
I posted a solution to disable new registrations in the issue tracker. It mainly just disables the registration action and the view by redirecting the user to the home page (right now). I hope you’ll find it useful and integrate something similar in the next version
See Here
regards
Yii-user 0.7 is out. http://www.yiiframework.com/extension/yii-user-management/#download
registration can now be enabled/disabled (this was broken in 0.6, but worked in earlier versions, and now again).
that route trim() bug is also fixed.
please give me much feedback so i can prepare a ‘stable’ 1.0 release soon!
I have installed YiiUserManagement_0.7 with other names of database tables
,so in config:
‘modules’ => array(
'user' => array(
...
'usersTable' => "yum_users",
'messagesTable' => "yum_messages",
'profileFieldsTable' => "yum_profile_fields",
'profileFieldsGroupTable' => "yum_profile_fields_group",
'profileTable' => "yum_profiles",
'rolesTable' => "yum_roles",
'userRoleTable' => "yum_user_has_role",
'userUserTable' => "yum_user_has_user",
And at attempt to login I have an error:
The table "users" for active record class "YumUser" cannot be found in the database.
Source File
D:\xampp\htdocs\Yii_Site\yii\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:
Stack Trace
#0 D:\xampp\htdocs\Yii_Site\yii\framework\db\ar\CActiveRecord.php(342): CActiveRecordMetaData->__construct(Object(YumUser))
#1 D:\xampp\htdocs\Yii_Site\!UserManagementModuleTest\protected\modules\user\models\YumUser.php(41): CActiveRecord::model(‘YumUser’)
#2 D:\xampp\htdocs\Yii_Site\!UserManagementModuleTest\protected\modules\user\components\YumUserIdentity.php(17): YumUser::model()
#3 D:\xampp\htdocs\Yii_Site\!UserManagementModuleTest\protected\modules\user\models\YumUserLogin.php(56): YumUserIdentity->authenticate()
#4 D:\xampp\htdocs\Yii_Site\yii\framework\validators\CInlineValidator.php(39): YumUserLogin->authenticate(‘password’, Array)
#5 D:\xampp\htdocs\Yii_Site\yii\framework\validators\CValidator.php(176): CInlineValidator->validateAttribute(Object(YumUserLogin), ‘password’)
#6 D:\xampp\htdocs\Yii_Site\yii\framework\base\CModel.php(150): CValidator->validate(Object(YumUserLogin), NULL)
#7 D:\xampp\htdocs\Yii_Site\!UserManagementModuleTest\protected\modules\user\controllers\YumUserController.php(208): CModel->validate()
#8 D:\xampp\htdocs\Yii_Site\yii\framework\web\actions\CInlineAction.php(32): YumUserController->actionLogin()
#9 D:\xampp\htdocs\Yii_Site\yii\framework\web\CController.php(300): CInlineAction->run()
#10 D:\xampp\htdocs\Yii_Site\yii\framework\web\filters\CFilterChain.php(129): CController->runAction(Object(CInlineAction))
#11 D:\xampp\htdocs\Yii_Site\yii\framework\web\filters\CFilter.php(41): CFilterChain->run()
#12 D:\xampp\htdocs\Yii_Site\yii\framework\web\CController.php(999): CFilter->filter(Object(CFilterChain))
#13 D:\xampp\htdocs\Yii_Site\yii\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain))
#14 D:\xampp\htdocs\Yii_Site\yii\framework\web\filters\CFilterChain.php(126): CInlineFilter->filter(Object(CFilterChain))
#15 D:\xampp\htdocs\Yii_Site\yii\framework\web\CController.php(283): CFilterChain->run()
#16 D:\xampp\htdocs\Yii_Site\yii\framework\web\CController.php(257): CController->runActionWithFilters(Object(CInlineAction), Array)
#17 D:\xampp\htdocs\Yii_Site\yii\framework\web\CWebApplication.php(320): CController->run(‘login’)
#18 D:\xampp\htdocs\Yii_Site\yii\framework\web\CWebApplication.php(120): CWebApplication->runController(‘user/user/login’)
#19 D:\xampp\htdocs\Yii_Site\yii\framework\base\CApplication.php(135): CWebApplication->processRequest()
#20 D:\xampp\htdocs\Yii_Site\!UserManagementModuleTest\index.php(12): CApplication->run()
#21 {main}
I have created the new user and at attempt to remove it I have the same error, as in the previous version.
Issue 69
Error in "Manage profile fields groups":
Error 404
Unable to resolve the request "user/fieldsGroup/admin".
Error after I have sent the message and click "Back to inbox" (r=user/messages/index):
Description
YiiBase::include(Yum.php) [<a href=‘function.YiiBase-include’>function.YiiBase-include</a>]: failed to open stream: No such file or directory
Source File
D:\xampp\htdocs\Yii_Site\yii\framework\YiiBase.php(338)
00326: * @param string class name
00327: * @return boolean whether the class has been loaded successfully
00328: */
00329: public static function autoload($className)
00330: {
00331: // use include so that the error PHP file may appear
00332: if(isset(self::$_coreClasses[$className]))
00333: include(YII_PATH.self::$_coreClasses[$className]);
00334: else if(isset(self::$_classes[$className]))
00335: include(self::$_classes[$className]);
00336: else
00337: {
00338: include($className.’.php’);
00339: return class_exists($className,false) || interface_exists($className,false);
00340: }
00341: return true;
00342: }
00343:
00344: /**
00345: * Writes a trace message.
00346: * This method will only log a message when the application is in debug mode.
00347: * @param string message to be logged
00348: * @param string category of the message
00349: * @see log
00350: */
Stack Trace
#0 D:\xampp\htdocs\Yii_Site\yii\framework\YiiBase.php(338): autoload()
#1 unknown(0): autoload()
#2 D:\xampp\htdocs\Yii_Site\yii\framework\base\CComponent.php(587) : eval()'d code(2): spl_autoload_call()
#3 D:\xampp\htdocs\Yii_Site\yii\framework\base\CComponent.php(587): eval()
#4 D:\xampp\htdocs\Yii_Site\yii\framework\zii\widgets\grid\CDataColumn.php(125): CDataColumn->evaluateExpression()
#5 D:\xampp\htdocs\Yii_Site\yii\framework\zii\widgets\grid\CGridColumn.php(135): CDataColumn->renderDataCellContent()
#6 D:\xampp\htdocs\Yii_Site\yii\framework\zii\widgets\grid\CGridView.php(447): CDataColumn->renderDataCell()
#7 D:\xampp\htdocs\Yii_Site\yii\framework\zii\widgets\grid\CGridView.php(420): CGridView->renderTableRow()
#8 D:\xampp\htdocs\Yii_Site\yii\framework\zii\widgets\grid\CGridView.php(333): CGridView->renderTableBody()
#9 D:\xampp\htdocs\Yii_Site\yii\framework\zii\widgets\CBaseListView.php(152): CGridView->renderItems()
#10 unknown(0): CGridView->renderSection()
#11 D:\xampp\htdocs\Yii_Site\yii\framework\zii\widgets\CBaseListView.php(135): preg_replace_callback()
#12 D:\xampp\htdocs\Yii_Site\yii\framework\zii\widgets\CBaseListView.php(121): CGridView->renderContent()
#13 D:\xampp\htdocs\Yii_Site\yii\framework\web\CBaseController.php(174): CGridView->run()
#14 D:\xampp\htdocs\Yii_Site\!UserManagementModuleTest\protected\modules\user\views\messages\index.php(37): YumMessagesController->widget()
#15 D:\xampp\htdocs\Yii_Site\yii\framework\web\CBaseController.php(119): require()
#16 D:\xampp\htdocs\Yii_Site\yii\framework\web\CBaseController.php(88): YumMessagesController->renderInternal()
#17 D:\xampp\htdocs\Yii_Site\yii\framework\web\CController.php(748): YumMessagesController->renderFile()
#18 D:\xampp\htdocs\Yii_Site\yii\framework\web\CController.php(687): YumMessagesController->renderPartial()
#19 D:\xampp\htdocs\Yii_Site\!UserManagementModuleTest\protected\modules\user\controllers\YumMessagesController.php(97): YumMessagesController->render()
#20 D:\xampp\htdocs\Yii_Site\yii\framework\web\actions\CInlineAction.php(32): YumMessagesController->actionIndex()
#21 D:\xampp\htdocs\Yii_Site\yii\framework\web\CController.php(300): CInlineAction->run()
#22 D:\xampp\htdocs\Yii_Site\yii\framework\web\filters\CFilterChain.php(129): YumMessagesController->runAction()
#23 D:\xampp\htdocs\Yii_Site\yii\framework\web\filters\CFilter.php(41): CFilterChain->run()
#24 D:\xampp\htdocs\Yii_Site\yii\framework\web\CController.php(999): CAccessControlFilter->filter()
#25 D:\xampp\htdocs\Yii_Site\yii\framework\web\filters\CInlineFilter.php(59): YumMessagesController->filterAccessControl()
#26 D:\xampp\htdocs\Yii_Site\yii\framework\web\filters\CFilterChain.php(126): CInlineFilter->filter()
#27 D:\xampp\htdocs\Yii_Site\yii\framework\web\CController.php(283): CFilterChain->run()
#28 D:\xampp\htdocs\Yii_Site\yii\framework\web\CController.php(257): YumMessagesController->runActionWithFilters()
#29 D:\xampp\htdocs\Yii_Site\yii\framework\web\CWebApplication.php(320): YumMessagesController->run()
#30 D:\xampp\htdocs\Yii_Site\yii\framework\web\CWebApplication.php(120): CWebApplication->runController()
#31 D:\xampp\htdocs\Yii_Site\yii\framework\base\CApplication.php(135): CWebApplication->processRequest()
#32 D:\xampp\htdocs\Yii_Site\!UserManagementModuleTest\index.php(12): CWebApplication->run()
Error after I click "Manage profiles" in Administration panel (r=user/profile/admin):
Description
YumProfileController cannot find the requested view "admin".
Source File
D:\xampp\htdocs\Yii_Site\yii\framework\web\CController.php(757)
00745: {
00746: if(($viewFile=$this->getViewFile($view))!==false)
00747: {
00748: $output=$this->renderFile($viewFile,$data,true);
00749: if($processOutput)
00750: $output=$this->processOutput($output);
00751: if($return)
00752: return $output;
00753: else
00754: echo $output;
00755: }
00756: else
00757: throw new CException(Yii::t(‘yii’,’{controller} cannot find the requested view “{view}”.’,
00758: array(’{controller}’=>get_class($this), ‘{view}’=>$view)));
00759: }
00760:
00761: /**
00762: * Renders dynamic content returned by the specified callback.
00763: * This method is used together with {@link COutputCache}. Dynamic contents
00764: * will always show as their latest state even if the content surrounding them is being cached.
00765: * This is especially useful when caching pages that are mostly static but contain some small
00766: * dynamic regions, such as username or current time.
00767: * We can use this method to render these dynamic regions to ensure they are always up-to-date.
00768: *
00769: * The first parameter to this method should be a valid PHP callback, while the rest parameters
Stack Trace
#0 D:\xampp\htdocs\Yii_Site\yii\framework\web\CController.php(687): CController->renderPartial(‘admin’, Array, true)
#1 D:\xampp\htdocs\Yii_Site\!UserManagementModuleTest\protected\modules\user\controllers\YumProfileController.php(99): CController->render(‘admin’, Array)
#2 D:\xampp\htdocs\Yii_Site\yii\framework\web\actions\CInlineAction.php(32): YumProfileController->actionAdmin()
#3 D:\xampp\htdocs\Yii_Site\yii\framework\web\CController.php(300): CInlineAction->run()
#4 D:\xampp\htdocs\Yii_Site\yii\framework\web\filters\CFilterChain.php(129): CController->runAction(Object(CInlineAction))
#5 D:\xampp\htdocs\Yii_Site\yii\framework\web\filters\CFilter.php(41): CFilterChain->run()
#6 D:\xampp\htdocs\Yii_Site\yii\framework\web\CController.php(999): CFilter->filter(Object(CFilterChain))
#7 D:\xampp\htdocs\Yii_Site\yii\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain))
#8 D:\xampp\htdocs\Yii_Site\yii\framework\web\filters\CFilterChain.php(126): CInlineFilter->filter(Object(CFilterChain))
#9 D:\xampp\htdocs\Yii_Site\yii\framework\web\CController.php(283): CFilterChain->run()
#10 D:\xampp\htdocs\Yii_Site\yii\framework\web\CController.php(257): CController->runActionWithFilters(Object(CInlineAction), Array)
#11 D:\xampp\htdocs\Yii_Site\yii\framework\web\CWebApplication.php(320): CController->run(‘admin’)
#12 D:\xampp\htdocs\Yii_Site\yii\framework\web\CWebApplication.php(120): CWebApplication->runController(‘user/profile/ad…’)
#13 D:\xampp\htdocs\Yii_Site\yii\framework\base\CApplication.php(135): CWebApplication->processRequest()
#14 D:\xampp\htdocs\Yii_Site\!UserManagementModuleTest\index.php(12): CApplication->run()
#15 {main}
Errors when I try to view user Profile history.
1)When I try to view initial profile (2010-06-25 19:20:46: Profile number 3):
Username user1
Fatal error: Call to a member function getAttribute() on a non-object in D:\xampp\htdocs\Yii_Site\!UserManagementModuleTest\protected\modules\user\views\user\foreignprofile.php on line 33
2)When I try to view changed profile (2010-06-25 19:56:45: Profile number 4) (r=user/user/profile/view&id=4):
Error 404
The requested User does not exist.
Just trying to set this up (YUM 0.7 on Yii 1.1.2) and running into a number of issues:
A. While attempting install with default data:
[indent]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.
It appears that the profiles tables are required even when not desired.
So:
the installation code should be revised to install the correct data in the $profileFieldsTable
the extension should be revised to check for desired use of the submodules (based on the Application Configuration file) before accessing them.
[/indent]
B. After modifying the install code to NOT install the default data in the $profileFieldsTable:
[indent]An error was received when clicking on "Manage Profile" on the User administration Panel:
YumProfileController cannot find the requested view "admin".
No files exist under \modules\user\views\profile, which is where I am assuming the missing file should be.
[/indent]
C. Neither the "Manage Profile Fields" nor the "Manage Profile Field Groups" options allow you to add anything to the appropriate tables
D. Registration, by default, doesn’t prompt for an email address, so an error is received when trying to register: `Email is not set when trying to send Registration Email’
BTW, how do the Profile related tables work? There’s no documentation that I can find that talks about the groups table and what it’s supposed to do nor what the fields in the profile_fields table are for (hint, match, range, etc).
That’s all for now.
Users are not assigned any role by default, so when trying to manage user without a role, an error is received:
Fields with * are required.
( ! ) Fatal error: Call to a member function getErrors() on a non-object in C:\xampp\htdocs\yii-1.1.2.r2086\framework\web\helpers\CHtml.php on line 1529
Call Stack
# Time Memory Function Location
1 0.0014 318440 {main}( ) ..\index.php:0
2 0.0315 1733296 CApplication->run( ) ..\index.php:12
3 0.0315 1733296 CWebApplication->processRequest( ) ..\CApplication.php:135
4 0.0362 1921704 CWebApplication->runController( ) ..\CWebApplication.php:120
5 0.0503 2661080 CController->run( ) ..\CWebApplication.php:320
6 0.0514 2683320 CController->runActionWithFilters( ) ..\CController.php:257
7 0.0530 2760496 CFilterChain->run( ) ..\CController.php:283
8 0.0536 2761400 CInlineFilter->filter( ) ..\CFilterChain.php:126
9 0.0536 2761464 CController->filterAccessControl( ) ..\CInlineFilter.php:59
10 0.0651 3146688 CFilter->filter( ) ..\CController.php:999
11 0.1198 4992136 CFilterChain->run( ) ..\CFilter.php:41
12 0.1199 4992136 CController->runAction( ) ..\CFilterChain.php:129
13 0.1200 4992136 CInlineAction->run( ) ..\CController.php:300
14 0.1201 4992192 YumUserController->actionUpdate( ) ..\CInlineAction.php:32
15 0.1579 5724456 CController->render( ) ..\YumUserController.php:549
16 0.1580 5724520 CController->renderPartial( ) ..\CController.php:687
17 0.1588 5724816 CBaseController->renderFile( ) ..\CController.php:748
18 0.1589 5724880 CBaseController->renderInternal( ) ..\CBaseController.php:88
19 0.1593 5778176 require( 'C:\xampp\htdocs\newskel\protected\modules\user\views\user\update.php' ) ..\CBaseController.php:119
20 0.2262 6084960 CController->renderPartial( ) ..\update.php:27
21 0.2267 6085168 CBaseController->renderFile( ) ..\CController.php:748
22 0.2268 6085232 CBaseController->renderInternal( ) ..\CBaseController.php:88
23 0.2276 6182352 require( 'C:\xampp\htdocs\newskel\protected\modules\user\views\user\_form.php' ) ..\CBaseController.php:119
24 0.2345 6662080 CHtml::errorSummary( ) ..\_form.php:11
It appears that a default role should be created during the installation process (independent of decision to install default/sample data), and the registration process should be modified to create that ‘user_has_role’ record unless the form is overridden by the developer providing users with choice roles upon registration.
hi iThank,
thanks for your interest in Yum.
i will write a more detailed documentation on how the relations work, and on how to use the profile fields
functionality soon(the next time i am motivated). your other problems will also be solved in the near future, just watch the issue tracker on Google Code.
Hello-
Great module! I really appreciate the time and effort you’ve put into creating it.
When I use this code:
if(Yii::app()->user->hasRole('role'))
{
// user is allowed
}
else
{
// user is not allowed to do this
}
I get the following error:
CDbException
Description
The table "tbl_tbl_roles" for active record class "YumRole" cannot be found in the database.
Source File
C:\Inetpub\yiiFramework\db\ar\CActiveRecord.php(1976)
Do you know why it adds another prefix to the table name?
Thanks!
Tommy
It is written “Please note that it is quite important to set the tablePrefix to ‘’ even if you don’t want an prefix cause yii seems to behave awkward without sometimes.” in installTutorial.txt.
Why yii seems to behave awkward?
I have tried nonempty tablePrefix and have not noticed additional problems.
oh, I feel stupid! So much for reading the install docs thoroughly! Thanks for your help, its working correctly now.