did you make the changes that I described ?
and also the one from Anticon:
$criteria->condition = "itemname = '".Yii::app()->getModule('srbac')->superUser."'";
With these changes, it works here
did you make the changes that I described ?
and also the one from Anticon:
$criteria->condition = "itemname = '".Yii::app()->getModule('srbac')->superUser."'";
With these changes, it works here
Yes I did, I also dumped $ex and that’s the Trace:
[html]
object(CDbException)#20 (6) {
["message:protected"]=>
string(142) “CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1005 Can’t create table ‘.\blog\itemchildren.frm’ (errno: 150)”
["string:private"]=>
string(0) ""
["code:protected"]=>
int(0)
["file:protected"]=>
string(86) "C:\Documents and Settings\Administrator\Apache2\htdocs\yii\framework\db\CDbCommand.php"
["line:protected"]=>
int(215)
["trace:private"]=>
array(11) {
[0]=>
array(6) {
["file"]=>
string(105) "C:\Documents and Settings\Administrator\Apache2\htdocs\blog\protected\modules\srbac\components\Helper.php"
["line"]=>
int(244)
["function"]=>
string(7) "execute"
["class"]=>
string(10) "CDbCommand"
["type"]=>
string(2) "->"
["args"]=>
array(0) {
}
}
[1]=>
array(6) {
["file"]=>
string(105) "C:\Documents and Settings\Administrator\Apache2\htdocs\blog\protected\modules\srbac\components\Helper.php"
["line"]=>
int(205)
["function"]=>
string(<img src='http://www.yiiframework.com/forum/public/style_emoticons/default/cool.gif' class='bbc_emoticon' alt='8)' /> "_install"
["class"]=>
string(6) "Helper"
["type"]=>
string(2) "::"
["args"]=>
array(1) {
[0]=>
&string(1) "1"
}
}
[2]=>
array(6) {
["file"]=>
string(118) "C:\Documents and Settings\Administrator\Apache2\htdocs\blog\protected\modules\srbac\controllers\AuthItemController.php"
["line"]=>
int(423)
["function"]=>
string(7) "install"
["class"]=>
string(6) "Helper"
["type"]=>
string(2) "::"
["args"]=>
array(2) {
[0]=>
&string(9) "Overwrite"
[1]=>
&string(1) "1"
}
}
[3]=>
array(6) {
["file"]=>
string(98) "C:\Documents and Settings\Administrator\Apache2\htdocs\yii\framework\web\actions\CInlineAction.php"
["line"]=>
int(32)
["function"]=>
string(13) "actionInstall"
["class"]=>
string(18) "AuthItemController"
["type"]=>
string(2) "->"
["args"]=>
array(0) {
}
}
[/html]
Any Clue? If u need the full trace just tell me. Thank you
Hi, I just returned from vacations and i try to look into these problems.
The undefined variables errors were in the early alpha version of srbac.In the beta versions they are fixed . If you still find any undefined vars let me know
sebi which version of srbac are you using?
And with witch database? I tried sqlite and mySQL with no problems
Edited:
I guess you are using InnoDB as the mySQL engine
Try with MyIsam and let me know if you have any problems while i’ll look into the innoDB problem
New Edit :
OK it’s fixed (that was fast )
srbac beta 4 is online
with the following fixes:
Fixed bug when when a not-Authorizer-user tries to access SRBAC (thanks to Anticon)
Fixed bug with deleting tables in wrong order (thanks to rabol)
Fixed bug with wrong column name resulting in errors while working with innoDB engine(thanks to sebi)
You are to fast, at the moment I can only use innoDB engine.
Iv’e installed it now and it seems to be work, still 1 undefined var error:
[html]
PHP Error
Description
Undefined variable: message
Source File
C:\Documents and Settings\Administrator\Apache2\htdocs\blog\protected\modules\srbac\controllers\AuthItemController.php(145)
00133: $this->_setMessage($this->module->tr->translate(‘srbac’,‘Task(s) Revoked’));
00134: }else if($assignOpers && is_array($authItemAssignName)) {
00135: $this->_assignChild($assItemName,$authItemAssignName);
00136: $this->_setMessage($this->module->tr->translate(‘srbac’,‘Operation(s) Assigned’));
00137: } else if($revokeOpers && is_array($authItemRevokeName)) {
00138: $this->_revokeChild($assItemName,$authItemRevokeName);
00139: $this->_setMessage( $this->module->tr->translate(‘srbac’,‘Operation(s) Revoked’));
00140: }
00141: //If not ajax show the assign page
00142: if(!Yii::app()->request->isAjaxRequest) {
00143: $this->render(‘assign’,array(
00144: ‘model’=>$model,
00145: ‘message’=>$message,
00146: ‘userid’=>$userid,
00147: ‘active’=>$active,
00148: ‘data’=>$data,
00149: ));
00150: } else {
00151: // assign to user show the user tab
00152: if($userid != "") {
00153: $this->_getTheRoles();
00154: }
00155: else if($assignTasks != 0 || $revokeTasks != 0) {
00156: $this->_getTheTasks();
00157: }
[/html]
thanks for the quick fix
sebi
Ok another Problem that I’ve found, after changing to E_NOTICE to install srbac without a fix
I got the Problem that the Roles are assigned and unassigned by every user.
Please see the Image attached, I will try to find a solution tomorrow, if u aren’t faster;)
Regards & Good Night,
Sebi
This was fixed at beta1 version
I just test the latest release with a MySQL InnoDB database without having this problem
Hi Spyros,
I’ve installed beta4 and found a small bug in “userAssignments.php”, take a look at the attachment.
Greetings
Carsten
EDIT: I have found another point:
public function actionAutocomplete() {
$criteria = new CDbCriteria();
$criteria->condition = "name LIKE '%".Yii::app()->request->getParam('q')."%'";
...
I remember, that this could be a security problem (SQL-injections) and it is recommended to use params:
$criteria = new CDbCriteria();
$criteria->condition = "name LIKE :name";
$criteria->params = array(":name"=>"%".Yii::app()->request->getParam('q')."%");
See also:link
fixed problems shouldn’t be there ^^
I will try to rebuild the issue and fix it myself.
gl
About the first problem , i think you are using an older css file. Delete the srbac folder of your asset directory so the new css will be published again
About the second problem you are right, I will change it
You are right, after the deletion of the files in assets it works properly. Thanks.
Hi spyros
after clicking Install button tables are created. then administrator is saved in that page after i gave index.php?r=srbac/authItem/assign in the address bar after my address it gives
YiiBase::include(User.php) yiibase.include: failed to open stream: No such file or directory why this appears?
why
Hi spyros
after clicking Install button tables are created. then administrator is saved in that page after i gave index.php?r=srbac/authItem/assign in the address bar after my address it gives YiiBase::include(User.php) yiibase.include: failed to open stream: No such file or directory why this appears?
my srbac configuration is
<?php
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'',
'defaultController'=>'login',
'preload'=>array('log'),
'import'=>array(
'application.models.*',
'application.components.*',
'application.extensions.*',
'application.controllers.*',
),
‘modules’=>array(‘srbac’=>
array(
// Your application’s user class (default: User)
"userclass"=>"User",
// Your users’ table user_id column (default: userid)
"userid"=>"user_ID",
// your users’ table username column (default: username)
"username"=>"username",
// If in debug mode (default: false)
// In debug mode every user (even guest) can admin srbac, also
//if you use internationalization untranslated words/phrases
//will be marked with a red star
"debug"=>false,
// The number of items shown in each page (default:15)
"pageSize"=>10,
// The name of the super user
"superUser" =>"Authority",
)),
'components'=>array(
‘authManager’=>array(
// The type of Manager (Database)
‘class’=>‘CDbAuthManager’,
// The database connection used
‘connectionID’=>‘db’,
// The itemTable name (default:authitem)
‘itemTable’=>‘items’,
// The assignmentTable name (default:authassignment)
‘assignmentTable’=>‘assignments’,
// The itemChildTable name (default:authitemchild)
‘itemChildTable’=>‘itemchildren’,
),
‘mailer’ => array(
'class' => 'application.extensions.mailer.EMailer',
'pathViews' => 'application.views.email',
'pathLayouts' => 'application.views.email.layouts'
),
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning',
),
),
),
'db'=>array(
'class'=>'system.db.CDbConnection',
'connectionString'=>'mysql:host=localhost;dbname=eprodigy',
'username'=>'root',
'password'=>'password',
),
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
),
),
'params'=>array(
'adminEmail'=>'webmaster@example.com',
),
);
Do you have the User class (with user_ID, and username attributes) in your application?
I created a file as User.php and stored in models
class User
{
public $userid;
public $username;
}
onclick assignitem link it gives following error
Fatal error: Call to undefined method User::findAll() in /var/www/code/php/protected/modules/srbac/views/authItem/tabViews/roleToUser.php on line 23
why
Your Users class should extend ActiveRecord
Check here how to create a model / controller /view
I created User class that extends CActiveRecord and stored in models in srbac
class User
{
public $userid;
public $username;
public static function model($className=__CLASS__)
{
return parent::model($className);
}
}
but it needs User table
can i must create User table
if i need then what is the structure of User table
still it gives an error when i click assign item link
Fatal error: Call to undefined method User::findAll() in /var/www/code/php/protected/modules/srbac/views/authItem/tabViews/roleToUser.php on line 23
can i customize srbac for my requirements
types of users
student,staff,parents,administrative staff,super user with permissions
how
You should create a table in your database
eg user with columns user_ID, username, password
then in the command prompt type
/path/to/framework/yiic shell /path/to/application/index.php
and then
>> model User
to create the model for the user table
and
>> crud User
to create the crud operations (controller and views)
Thanks spyros
It works
what is the purpose of users,roles,tasks tabs
my project has various users such as student,staff, parents,administrative staff,super user
How to customize your creation into my user types student,staff, parents,administrative staff,super user with permissions to visit particular pages
only Super user or administrative staff can create other user types with password for login our project so how to customize yours
First create the operations/roles in the /index.php?r=srbac/authItem/manage/manage page and then assign them to your users