Yii Framework Forum: HELP! SRBAC install error. - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

HELP! SRBAC install error. Rate Topic: -----

#1 User is offline   keepallsimple 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 25-December 09

Posted 30 December 2009 - 09:03 PM

hi, Spyros:
I have some problem when use srbac:

1. download the code from svn http://srbac.googlecode.com/svn/trunk/
2. copy the srbac to myapp/protected/modules
3. config the config/main.php

return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'My Web Application',

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
		'application.modules.srbac.controllers.SBaseController',
	),
	'modules'=>array(
        'srbac' => array(
			'userclass'=>'User',
			'userid'=>'id',
			'username'=>'name',
			'debug'=>true,
			'pageSize'=>10,
			'superUser' =>'Authority',
			'css'=>'srbac_red.css',
			'layout'=>'application.views.layouts.admin',
			'notAuthorizedView'=>'application.views.site.unauthorized',
			'alwaysAllowed'=>array('SiteLogin','SiteLogout','SiteIndex','SiteAdmin','SiteError', 'SiteContact'),
			'userActions'=>array('Show','View','List'),
			'listBoxNumberOfLines' => 15,
			'imagesPath' => 15,
			'imagesPack'=>'noia',
			'iconText'=>true,
			'header'=>'application.views.header',
			'footer'=>'application.views.footer',
			'showHeader'=>true,
			'showFooter'=>true,
		)
    ),

	// application components
	'components'=>array(
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
			),
		),
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
		// uncomment the following to set up database
		/*
		'db'=>array(
			'connectionString'=>'Your DSN',
		),
		*/
		'db'=>array(
			'connectionString'=>'mysql:host=127.0.0.1;dbname=myapp', 'username'=>'myapp', 'password'=>'myapp'
		),
		///////////////////////////////////////////////////////////////////////////////////////
		// SRBAC
		///////////////////////////////////////////////////////////////////////////////////////
		'authManager'=>array(
			// The type of Manager (Database)
			'class'=>'CDbAuthManager',
			// The database component used
			'connectionID'=>'db',
			// The itemTable name (default:authitem)
			'itemTable'=>'items',
			// The assignmentTable name (default:authassignment)
			'assignmentTable'=>'assignments',
			// The itemChildTable name (default:authitemchild)
			'itemChildTable'=>'itemchildren',
		),
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'adminEmail'=>'webmaster@example.com',
	),
);


4. visit the url : http://127.0.0.1/ind...uthitem/install

5. show me the message :

....
There is an error in your configuration
Create demo authItems?

and the [install] button is gray.

how can i do with these problem?

detail :
see the attachments image.
0

#2 User is offline   keepallsimple 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 25-December 09

Posted 30 December 2009 - 09:16 PM

the detail image:
Attached File  1262225284.JPG (66.82K)
Number of downloads: 111
0

#3 User is offline   Spyros 

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

Posted 30 December 2009 - 11:23 PM

Do not use 'css'=>'srbac_red.css',
That's an example
Use
'css'=>'srbac.css',
0

#4 User is offline   keepallsimple 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 25-December 09

Posted 31 December 2009 - 12:40 AM

Hi, Spyros,

I changed the css to srbac.css , and show the message:

notAuthorizedView application.views.site.unauthorized
layout application.views.layouts.admin
imagesPath 15
imagesPack noia
header application.views.header
footer application.views.footer

and what this means?
how can i do?
0

#5 User is offline   Spyros 

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

Posted 31 December 2009 - 02:09 AM

It means that these customized alias do not point to an existing file
If you want to use the default settings remove them from the configuration
0

#6 User is offline   keepallsimple 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 25-December 09

Posted 31 December 2009 - 02:23 AM

thanks Spyros!
just now I got it works ok.

but some where i am not understand...


[the old config]


        'srbac' => array(
                        'userclass'=>'User',
                        'userid'=>'user_ID',
                        'username'=>'username',
                        'debug'=>true,
                        'pageSize'=>10,
                        'superUser' =>'Authority',
                        'css'=>'srbac_red.css',
                        'layout'=>'application.views.layouts.admin',
                        'notAuthorizedView'=>'application.views.site.unauthorized',
                        'alwaysAllowed'=>array('SiteLogin','SiteLogout','SiteIndex','SiteAdmin','SiteError', 'SiteContact'),
                        'userActions'=>array('Show','View','List'),
                        'listBoxNumberOfLines' => 15,
                        'imagesPath' => 15,
                        'imagesPack'=>'noia',
                        'iconText'=>true,
                        'header'=>'application.views.header',
                        'footer'=>'application.views.footer',
                        'showHeader'=>true,
                        'showFooter'=>true,
                )



after changed to below, works ok:



        'srbac' => array(
                        'userclass'=>'User',
                        'userid'=>'id',
                        'username'=>'name',
                        'debug'=>true,
                        'pageSize'=>10,
                        'superUser' =>'super', <<==========changed
                        'css'=>'srbac.css',
                        'layout'=>'application.views.layouts.main', <<==========changed,use the main layout : main.php
                        'notAuthorizedView'=>'application.views.site.login', <<==========changed,use the main layout
                        'alwaysAllowed'=>array('Show','View','List'), <<==========changed,
                        'userActions'=>array('Show','View','List'), <<==========changed,
                        'listBoxNumberOfLines' => 15,
                        //'imagesPath' => 15, <<==========changed to comments, but dont understand why the path is a Number???
                        'imagesPack'=>'noia', <<========== what's noia???
                        'iconText'=>true, 
                        //'header'=>'application.views.header', <<==========changed,use the main layout
                        //'footer'=>'application.views.footer',<<==========changed,use the main layout
                        //'showHeader'=>true,<<<==========changed,use the main layout
                        //'showFooter'=>true,<<==========changed,use the main layout
                )



thanks a lot!
0

#7 User is offline   bemit 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 21-January 10
  • Location:VN

Posted 21 January 2010 - 08:57 PM

My Config:
'modules'=>array(
'srbac' => array(
'userclass'=>'User', //optional defaults to User
'userid'=>'id', //optional defaults to userid
'username'=>'un', //optional defaults to username
'debug'=>true, //optional defaults to false
'pageSize'=>10, //optional defaults to 15
'superUser' =>'Authority', //optional defaults to Authorizer
'css'=>'srbac.css', //optional defaults to srbac.css
// 'layout'=> 'srbac.views.authitem.admin', //optional defaults to empty string
// must be an existing alias
'notAuthorizedView'=>'srbac.views.authitem.unauthorized', // optional defaults to
//srbac.views.authitem.unauthorized, must be an existing alias */
'alwaysAllowed'=>array( //optional defaults to gui
'SiteLogin','SiteLogout','SiteIndex','SiteAdmin',
'SiteError', 'SiteContact'),
'userActions'=>array(//optional defaults to empty array
'Show','View','List'),
'listBoxNumberOfLines' => 15, //optional defaults to 10
'imagesPath' => 'srbac.images', //optional defaults to srbac.images
'imagesPack'=>'noia', //optional defaults to noia
'iconText'=>true, //optional defaults to false
'header'=>'srbac.views.authitem.header', //optional defaults to
// srbac.views.authitem.header, must be an existing alias
'footer'=>'srbac.views.authItem.footer', //optional defaults to
// srbac.views.authitem.footer, must be an existing alias

'showHeader'=>true, //optional defaults to false
'showFooter'=>true, //optional defaults to false
'alwaysAllowedPath'=>'srbac.components', //optional defaults to srbac.components
// must be an existing alias
),
),

But I get error:

There is an error in your configuration
And Install Button is disbled.

I created User model and CRUD for it.

Everything is OK. But I don't understand why I can't install.

I use Yii 1.1.0, SRBAC v1.1.0(use Subversion for download)

Please, show me now!!!

Thanks for your help!
NII -> Nothing Is Impossible!
0

#8 User is offline   Spyros 

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

Posted 21 January 2010 - 11:39 PM

View Postkeepallsimple, on 31 December 2009 - 02:23 AM, said:

//'imagesPath' => 15, <<==========changed to comments, but dont understand why the path is a Number???



That was a typo error in the guide. imagesPath should be an alias , default is srbac.images
noia is the images pack to use (a subdir in srbac/images dir)
0

#9 User is offline   bemit 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 21-January 10
  • Location:VN

Posted 22 January 2010 - 02:06 AM

...
'listBoxNumberOfLines' => 15, //optional defaults to 10
'imagesPath' => 'srbac.images', //optional defaults to srbac.images
'imagesPack'=>'noia', //optional defaults to noia
...

My config copy from your srbac_guide_1.1.0.pdf. If wrong, it's just you!!! ::)
NII -> Nothing Is Impossible!
0

#10 User is offline   Seal 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 126
  • Joined: 02-February 10

Posted 04 February 2010 - 09:57 PM

Hi Thanks for a wonderful module.

Ijust cant seemto get to insatll...directory not found

My config...

Version 1.1.0

'authManager'=>array(
// The type of Manager (Database)
'class'=>'CDbAuthManager',
// The database component used
'connectionID'=>'db',
// The itemTable name (default:authitem)
'itemTable'=>'items',
// The assignmentTable name (default:authassignment)
'assignmentTable'=>'assignments',
// The itemChildTable name (default:authitemchild)
'itemChildTable'=>'itemchildren',
),

// module config stuff
'modules'=>array(
'srbac' => array(
'userclass'=>'User', //optional defaults to User
'userid'=>'user_ID', //optional defaults to userid
'username'=>'username', //optional defaults to username

'debug'=>true, //optional defaults to false

'pageSize'=>10, //optional defaults to 15
'superUser' =>'Authority', //optional defaults to Authorizer
'css'=>'srbac.css', //optional defaults to srbac.css

//The layout to use
'layout'=>'application.views.layouts.admin', //optional defaults to empty string
// must be an existing alias

'notAuthorizedView'=>'srbac.views.authitem.unauthorized ',
// optional defaults to
//srbac.views.authitem.unauthorized, must be an existing alias

'alwaysAllowed'=>array( //optional defaults to gui
'SiteLogin','SiteLogout','SiteIndex','SiteAdmin',
'SiteError', 'SiteContact'),
'userActions'=>array( //optional defaults to empty array
'Show','View','List'),
'listBoxNumberOfLines' => 15, //optional defaults to 10
'imagesPath' => 'srbac.images', //optional defaults to srbac.images
'imagesPack'=>'noia', //optional defaults to noia
'iconText'=>true, //optional defaults to false

'header'=>'srbac.views.authitem.header',
//optional defaults to
//srbac.views.authitem.header, must be an existing alias

'footer'=>'srbac.views.authItem.footer',
//optional defaults to
//srbac.views.authitem.footer, must be an existing alias

'showHeader'=>true,
//optional defaults to false

'showFooter'=>true,
//optional defaults to false

'alwaysAllowedPath'=>'srbac.components',
//optional defaults to srbac.components
// must be an existing alias
),
),



I am getting error cant find...

include(User.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory

need please help...
Sylvester La-Tunje

Posted Image
0

#11 User is offline   Spyros 

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

Posted 05 February 2010 - 03:35 AM

Do you have a User class in your application?
0

#12 User is offline   Seal 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 126
  • Joined: 02-February 10

Posted 05 February 2010 - 02:57 PM

View PostSpyros, on 05 February 2010 - 03:35 AM, said:

Do you have a User class in your application?


Yes

Here is the error I get

19:51:52.753035 trace system.web.CModule
Loading "coreMessages" application component
19:51:52.755316 error exception.CHttpException.404
exception 'CHttpException' with message 'Unable to resolve the request
"srbac".' in C:\xampp\htdocs\yii\framework\web\CWebApplication.php:324
Stack trace:
#0 C:\xampp\htdocs\yii\framework\web\CWebApplication.php(120):
CWebApplication->runController('srbac')
#1 C:\xampp\htdocs\yii\framework\base\CApplication.php(135):
CWebApplication->processRequest()
#2 C:\xampp\htdocs\yii\dealbook\index.php(11): CApplication->run()
#3 {main} REQUEST_URI=/yii/dealbook/index.php/srbac
19:51:52.755633 trace system.web.CModule
Loading "errorHandler" application component

Perhaps you might be able to spot where I have gone wrong...
Sylvester La-Tunje

Posted Image
0

#13 User is offline   daonhack 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 34
  • Joined: 02-June 09

Posted 03 March 2010 - 02:12 PM

Following srbac_guide_1.1.0.pdf everything worked after create Yii skeleton code. Just one typo I found in srbac_guide_1.1.0.pdf at Configure srbac module section.
Begin of page 3 there is: 'srbac.views.authitem.unauthorized ',
maybe remove last space in the String then everything ok and install button worked.

Great job Spyros, thanks.
1

#14 User is offline   MotDS 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 13-April 11

Posted 13 April 2011 - 10:21 AM

Hey there.

I have similar problem. I have tried many things to fix it but i guess miss something. I'm trying to install SRBAC. I have done instructions in guides. Still have the same problem. It's about configuration. The problem is: "There is an error in your configuration" and i have no idea what is wrong.I have tried many possibilites to made it working and finally it looks like this.

My configuration:

<?php

return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Page',

	'preload'=>array('log'),

	'import'=>array(
		'application.models.*',
		'application.components.*',
                'application.modules.srbac.controllers.SBaseController',
                       ),
    
	'components'=>array(            
            'authManager'=>array(
                'class'=>'CDbAuthManager',
                'connectionID'=>'db',
                'itemTable'=>'items',
                'assignmentTable'=>'assignments',
                'itemChildTable'=>'itemchildren',
                    ),
                       
            'user'=>array(
			'allowAutoLogin'=>true,   
                         ),
            		
            'db'=>array(
			'connectionString' => 'pgsql:host=localhost;dbname=nameofbase',
			'username' => 'postgres',
			'password' => 'password',
			'charset' => 'utf8',
		),
            'errorHandler'=>array(
            'errorAction'=>'site/error',
        ),		
	),
    
	'modules'=>array(
		'srbac'=>array(
                    "userclass"=>"User",
                    "userid"=>"id",
                    "username"=>"username",
                    "debug"=>true,
                    "pageSize"=>10,
                    "superUser" =>"Authority",
                    "css"=>"srbac.css",
                    "layout"=>"application.views.layouts.main",
                    "notAuthorizedView"=>"application.views.site.unauthorized",
                    "alwaysAllowed"=>array(
                    "SiteLogin","SiteLogout","SiteIndex","SiteAdmin",
                    "SiteError", "SiteContact"),
                    "userActions"=>array(
                    "Show","View","List"),
                    "listBoxNumberOfLines" => 15, 
                    "imagesPath" => "srbac.images", 
                    "imagesPack"=>"noia", 
                    "iconText"=>true,
                    ),
            
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'password',
		),
		
	),
	'params'=>array(
		'adminEmail'=>'admin@admin.com',
	),
       
);
?>


Final effect:

Your Database, AuthManager and srbac settings:

Database

Driver : pgsql
Connection: pgsql:host=localhost;dbname=nameofbase

AuthManager

Item Table: items
Assignment Table: assignments
Item child table: itemchildren

srbac

yiiSupportedVersion: 1.1.0
version: 1.2
debug: 1
pageSize: 10
alwaysAllowed: SiteLogin, SiteLogout, SiteIndex, SiteAdmin, SiteError, SiteContact
userActions: Show, View, List
listBoxNumberOfLines: 15
iconText: 1
showHeader
showFooter
cssUrl
useAlwaysAllowedGui
message
userid: id
username: username
userclass: User
superUser: Authority
css: srbac.css
notAuthorizedView: application.views.site.unauthorized
imagesPath: srbac.images
imagesPack: noia
header: srbac.views.authitem.header
footer: srbac.views.authitem.footer
alwaysAllowedPath: srbac.components
delimeter: -
layout: application.views.layouts.main

Yii
Yii version: 1.1.6

There is an error in your configuration

Is there a way to check what's wrong? Thanks in advance.
0

#15 User is offline   Spyros 

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

Posted 13 April 2011 - 11:01 AM

I have not use srbac with pgsql database so there might be a problem there.
Check if this happen to you
https://code.google....es/detail?id=72
Also check that these point to existing files
"layout"=>"application.views.layouts.main",
"notAuthorizedView"=>"application.views.site.unauthorized"

0

#16 User is offline   MotDS 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 13-April 11

Posted 13 April 2011 - 11:10 AM

I have deleted "notAuthorizedView"=>"application.views.site.unauthorized" and it's working now.

Thank you.
0

#17 User is offline   Joemaxwell 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 13-February 13
  • Location:Fiji Via Melbourne

Posted 10 April 2013 - 05:00 PM

Dear Spyros.

I got some problem in installation of srbc this is the message after installation:

Install Srbac
This is the mESSAGE AFTER INSTALLATION
"Error while installing srbac.
Please check your database and try again"

Extension i use: srbca 1.3beta
my whole layout can't display, i don't see any frame. Before it works perfect this is after i configure my Any help is much appreciated.
0

#18 User is offline   Joemaxwell 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 13-February 13
  • Location:Fiji Via Melbourne

Posted 10 April 2013 - 05:06 PM

View PostJoemaxwell, on 10 April 2013 - 05:00 PM, said:

Dear Spyros.

I got some problem in installation of srbc this is the message after installation:

Install Srbac
This is the mESSAGE AFTER INSTALLATION
"Error while installing srbac.
Please check your database and try again"

Extension i use: srbca 1.3beta
my whole layout can't display, i don't see any frame. Before it works perfect this is after i configure my Any help is much appreciated.


I have drop the table at my workbench mysql the three table that the book has.

Attached File(s)


0

#19 User is offline   mars3228 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 19-April 13

Posted 19 April 2013 - 04:06 AM

Dear,
Can i just give a role(not super user and this role has competences into srbac) to someone and he can view srbac? I use this way to do that and it only display a empty page. When i give him a superuser role and everything all right.
Regards,
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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