Yii Framework Forum: [EXTENSION] srbac : Web interface for the administration of rbac - Yii Framework Forum

Jump to content

  • (38 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • 5
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] srbac : Web interface for the administration of rbac Rate Topic: ****- 7 Votes

#41 User is offline   rabol 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 50
  • Joined: 08-October 08

Posted 15 August 2009 - 10:26 AM

View Postsebi, on 15 August 2009 - 09:36 AM, said:

Jap, still doesn't work for me with the same errormessage above.
I think there are also other Problem(s)?


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
0

#42 User is offline   sebi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 65
  • Joined: 06-October 08

Posted 15 August 2009 - 12:40 PM

Yes I did, I also dumped $ex and that's the Trace:


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(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) {
      }
    }




Any Clue? If u need the full trace just tell me. Thank you
0

#43 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 17 August 2009 - 06:42 AM

View Postrabol, on 15 August 2009 - 07:38 AM, said:

Have in mind that this extension will not work with error_reporting(E_ALL) as it uses several uninitialized variables, the developer must be a young guy :) :) :)


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
0

#44 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 17 August 2009 - 06:43 AM

View Postsebi, on 14 August 2009 - 11:15 AM, said:

Ok, after I press "Install"
I get the message to overwrite srbac, which is fine.
If I click on "Overwrite", I got this errorMessage:



Install Srbac
Error while installing srbac.
Please check your database and try again



whats going wrong there?
If it helps, after this steps I can only see items table in my database.


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)
0

#45 User is offline   sebi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 65
  • Joined: 06-October 08

Posted 17 August 2009 - 08:55 AM

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:


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:           }




thanks for the quick fix ;)

sebi
0

#46 User is offline   sebi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 65
  • Joined: 06-October 08

Posted 17 August 2009 - 06:12 PM

View Postsebi, on 17 August 2009 - 08:55 AM, said:

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:


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:           }




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

Attached File(s)

  • Attached File  srbac.GIF (21.14K)
    Number of downloads: 60

0

#47 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 18 August 2009 - 12:09 AM

This was fixed at beta1 version
I just test the latest release with a MySQL InnoDB database without having this problem
0

#48 User is offline   Anticon 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 25
  • Joined: 25-February 09
  • Location:Germany

Posted 18 August 2009 - 01:13 AM

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

Attached File(s)

  • Attached File  srbac.jpg (43.32K)
    Number of downloads: 56

0

#49 User is offline   sebi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 65
  • Joined: 06-October 08

Posted 18 August 2009 - 04:50 AM

View PostSpyros, on 18 August 2009 - 12:09 AM, said:

This was fixed at beta1 version
I just test the latest release with a MySQL InnoDB database without having this problem



fixed problems shouldn't be there ^^
I will try to rebuild the issue and fix it myself.
gl
0

#50 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 18 August 2009 - 05:18 AM

View PostAnticon, on 18 August 2009 - 01:13 AM, said:

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



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
0

#51 User is offline   Anticon 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 25
  • Joined: 25-February 09
  • Location:Germany

Posted 19 August 2009 - 12:33 AM

Quote

About the first problem , i think you are using an older css file.


You are right, after the deletion of the files in assets it works properly. Thanks. :)
0

#52 User is offline   murugan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 72
  • Joined: 12-June 09
  • Location:Chennai,India

Posted 30 August 2009 - 02:32 AM

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
0

#53 User is offline   murugan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 72
  • Joined: 12-June 09
  • Location:Chennai,India

Posted 30 August 2009 - 06:39 AM

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',
),
);
0

#54 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 30 August 2009 - 01:31 PM

View Postmurugan, on 30 August 2009 - 06:39 AM, said:


// 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",


Do you have the User class (with user_ID, and username attributes) in your application?
0

#55 User is offline   murugan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 72
  • Joined: 12-June 09
  • Location:Chennai,India

Posted 02 September 2009 - 12:47 AM

View PostSpyros, on 30 August 2009 - 01:31 PM, said:

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
0

#56 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 02 September 2009 - 02:26 AM

View Postmurugan, on 02 September 2009 - 12:47 AM, said:

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
http://www.yiiframew...totype.scaffold
0

#57 User is offline   murugan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 72
  • Joined: 12-June 09
  • Location:Chennai,India

Posted 03 September 2009 - 12:48 AM

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
0

#58 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 03 September 2009 - 01:39 AM

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)
0

#59 User is offline   murugan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 72
  • Joined: 12-June 09
  • Location:Chennai,India

Posted 03 September 2009 - 03:43 AM

View PostSpyros, on 03 September 2009 - 01:39 AM, said:

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
0

#60 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 03 September 2009 - 09:28 AM

View Postmurugan, on 03 September 2009 - 03:43 AM, said:

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
0

Share this topic:


  • (38 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • 5
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users