[module] userGroups

Hey all,

I am just wondering what everyone is using for RBAC when using userGroups?

I had been using srbac with other apps but having many difficulties using it with this extension. With a few changes I finally got srbac to install on an app using userGroups but then there is a conflict with the srbac controllers that I have not been able to overcome yet.

UserGroups has proven invaluable so I will keep using it but still need that granularity of RBAC. Going to work on my own solution now but would really like to take advantage of something like srbac since it is also an excellent extension.

So just wondering how others are going about it?

that’s is extremely weird, there are already checks related to that, and i didn’t touch that part before last release… i’ll take a look at it this morning

enfield i just tested the whole think under version 1.8

using the root user i can totally change permissions of any other user.

creating another user with userGroups.admin.write permissions i can change permission of other active users whose level is inferior to the one of the user with those access permission.

giving to said user userGroups.admin.admin permissions i can change whatever user whose level is al always inferior to his own.

every single update is done through the Root Tools page.

The error is something like: PHP Fatal error: Cannot redeclare class SBaseController. I wasn’t able to figure out the duplication though.

The error first appeared under the user menu in the admin panel. Then on reload it would not even let me get into anything with userGroups and just displayed the error.

Edit: didn’t realize post#122 was in reference to post#120. Above is the error for post#121

I am using the root user, userGroups v1.8, and also using Yii v1.8. Is there some other switch that I could have activated that prevents this?

SBaseController is the basic controller for SRBAC, right?

what’s happening right now is that userGroups when getting a list of all your controllers is including two files containing the same class

what’s the file name of said class?

Yes. [class SBaseController extends CController] and then there is another [class AuthitemController extends SBaseController]

nickcv, I found out what the problem was with the user administration. After doing a clean install on a blank yii build and seeing everything working I transferred all files over to my app. The problem still existed so I deleted all my userGroups tables from the db and reinstalled. Now it is working as it should.

Now just to figure out the compatibility with srbac

Hi nickcv

I came with some suggestions that I think can make the extension better:

  1. provide a way to customize default profile view, for not to display user basic info like username, Group, Email, Home and Status. people wants complete control over profile views, you know :).

one way to do this, is to let users to use their own views instead of provided view.php, update.php and register.php. this way, developers have full access to profile layout and contents, and there is no need for registering any model in UserGroups as profile extension.

  1. let Yii manage URLs by using createUrl(instead of baseUrl anywhere needed), so people can use UserGroups without disabling showScriptName.

  2. move css, js, img and templates folders to the same folder (maybe assets), to make folder hierarchy more beautiful.

  3. in documentation page, use Tabs instead of Accordion, because accordion is not a good option for long contents(it needs scroll to see all options), also maybe somebody do not use accordion at all and does not include it in its custom jui build(like me), but tabs are much popular.

thanks for your attention

Agreed. I prefer to leave url manager/showscriptname/htaccess untouched during development. It makes it a lot easier to debug, especially when there are complex rules in place.

Also, there’s no way for users to register themselves?

I’ve just installed and started testing features. As the root user, I could access my profile before adding some groups and users and adjusting their permissions.

Now I get the following error when accessing my profile or when accessing another user’s profile:

Fatal error: Cannot use string offset as an array in […]/protected/modules/userGroups/components/UserGroupsAccessControl.php on line 172

I have created a second user, and when logged into that account I can access their profile and all profiles below it. Seems to be confined to the super_admin group.

Hope this helps.

EDIT: This install was in an existing app. I’ve since installed to a fresh app and it’s working fine. I updated YII before the install, though.

How can I refresh my profile field when the user saves it?

If I edit my profile and change MarkUp from 10 to 20

Yii::app()->user->profile(‘Profile’, ‘MarkUp’)

returns 10 not 20 unless I logout and login again.

Thanks

This makes sense because you are returning something stored in the session. Is there a way to refresh session variables without logging out?

any way to call profileLoad after update?

I got around this by just reading the table as required.




$profile_data = Profile::model()->findByAttributes(array('ug_id'=>Yii::app()->user->id));



hi guys i just got back from my vacation, sorry if i didn’t answer any sooner.

Anyway as enfield said the values stored in session are not currently refreshed.

i’ll think about how to work around that :D

Thanks, I cannot get this working when I upload to godaddy.

I get cannot find input file.

I removed the urlmanager and .htaccess and it works better, but still have issues.

frocco, Can you give me some more details here? I have a project that I am wrapping up and most likely will use godaddy for hosting. Are you running into problems because you are on a shared server or is it dedicated? Also any other info you are willing to share about it that you believe is caused by the implementation of this extension.

Thanks

I am getting No input file specified.

.htaccess

Options +FollowSymLinks

IndexIgnore /

RewriteEngine on

if a directory or a file exists, use it directly

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

otherwise forward it to index.php

RewriteRule . index.php

main.php

‘urlManager’=>array(

		'urlFormat'=>'path',


		'rules'=>array(


			'<controller:\w+>/<id:\d+>'=>'<controller>/view',


			'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',


			'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',


		),


	),


	'showScriptName'=>false,

is this on a shared server? although I really do not think it should matter in this case but godaddy seems to put a lot of limitations on things at times.

>>is this on a shared server?<<

Yes