Yii Framework Forum: [module] userGroups - Yii Framework Forum

Jump to content

  • (10 Pages)
  • +
  • « First
  • 7
  • 8
  • 9
  • 10
  • You cannot start a new topic
  • You cannot reply to this topic

[module] userGroups module for managing user, groups and their permissions Rate Topic: -----

#161 User is offline   mithila 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 116
  • Joined: 18-April 11

Posted 13 December 2011 - 12:51 AM

hi nick!! thank you so much for this module.. i 've used it in many of my pprojects.. just one issue with htaccess file..
i ve put file on the server. and my link is this: http://174.120.148.2...metprogo/metpro. this gives me 404 error. m guessing its because of the htaccess file. if i change the link to http:/174.120.148.251/~metprogo/index.php/metpro it works.
heres the .htaccess file..
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

please suggest what changes to make for it to work without index.php
0

#162 User is offline   DiegoToala 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 06-June 09
  • Location:Brooklyn, NY

Posted 26 December 2011 - 03:11 PM

I was trying to set up this module in Windows 7 + WAMP, but I got a 404 error.

I was reading this topic and moving things I got the module working.

I'm attaching a zip file including all the files. One should check the .htaccess and the main.php, I consider those files the most importants in order to configure this module.


Regards,
Diego

***********************************************
.htaccess
Options +FollowSymLinks
IndexIgnore */*
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /moneylog/

# 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/$1 [L]
</IfModule>


*****************************
protected/config/main.php
<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'YOUR APP NAME',

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

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
		'application.modules.userGroups.models.*',
	),

	'modules'=>array(
		// uncomment the following to enable the Gii tool		
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'YOURPASS',
		 	// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
		),
		'userGroups'=>array(
			'accessCode'=>'YOURCODE',
			),

		
	),

	// application components
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
		// uncomment the following to enable URLs in path-format
		'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,
			

		),
		'db'=>array(
			'class'=>'CDbConnection',
			'connectionString' => 'mysql:host=localhost;dbname=YOURDB',
			'emulatePrepare' => true,
			'username' => 'YOURUSER',
			'password' => 'YOURPASS',
			'charset' => 'utf8',
			'tablePrefix' => 'YOURPREFIX',
			'enableProfiling'=>'true'	
		),		
		'errorHandler'=>array(
			// use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
	),

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

Attached File(s)


Diego Toala
www.diegotoala.com
0

#163 User is offline   Sampa 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 173
  • Joined: 18-December 11
  • Location:Stockholm,Sweden

Posted 27 December 2011 - 08:42 AM

Hi! Great extention=) I'm trying to get the profile extention to work.
I downloaded the userExtentions sample (for some reason my xp computer wanted to make one single .txt of all the files) but I created
app/protected/models/Profile.php
app/protected/controllers/ProfileController.php and
And copied your sample code into those files.

Also Created
app/proteted/views/Profile/index.php (empty file)

Then I created tbl_profile in my database, tbl_ is set as table prefix in my main config file.

I get the following error when I try to browse to any view within the userGroups module:
include(ProfileController.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory

If I change the name of protected/controllers/ProfilController.php to anything.php I get
include(anything.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory

I've been trying to solve this for a couple of days but failed:/

Attached File(s)


0

#164 User is offline   dopamine 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 21-November 11

Posted 29 January 2012 - 07:08 AM

I read the documentation but I did not understand how to do business rules with userGroups (maybe due to my English skills or else)...

some example
if the user owns only his post on a forum and is allowed to edit ONLY his post:

http://www.yiiframew...ation-hierarchy

$bizRule='return Yii::app()->user->id==$params["post"]->authID;';
$task=$auth->createTask('updateOwnPost','update a post by author himself',$bizRule);



How do i set that rule with userGroups module? So when I check access for example it returns true/false that the user can edit the post and allows/denies him to access the Update action?
0

#165 User is offline   Tony Morais 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 09-January 12

Posted 23 February 2012 - 09:10 AM

Hi

I know how to get from the sql a list of emails from the users in a group. But I didnt find a way to do this with the class. is there something I m not seeng or it really is not in the extension?
0

#166 User is offline   nekdolan 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 23-March 12

Posted 26 March 2012 - 08:41 AM

Any idea how I can use one form to register two types of users with different inputs?
There would be a dropdown list or some radio buttons to select which group the user wants to belong to and depending on the choice new profile inputs should become visible (and the old ones should disappear). The current profile extension isn't capable of doing that right? Also to me it seems only one profile extension can work at one time.
0

#167 User is offline   pashka 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 12-April 12

Posted 12 April 2012 - 10:00 PM

hello and sorry for my bad english..

i`m novice in yii, but start using userGroups module and would suggest some improvements(maybe of course):

- it would be convenient, if the path to the all controllers of application in UserGroupsAccess.php was isolated in the module`s config.. or it can understand the CBehaviors(for example frontend or bakend).. so people don`t need to edit in controllerList function path to controllers.. in my case it look "application.controllers.backend" because i generate my controllers in this uri /localhost/projectName/backent/gii/ from backend behavior..

- maybe it will be good, if rules would be isolated too.. for example rule "view" or smth can be added to "admin", "read", "write" in config file..


anyway it`s great ext.. thank you..

I hope you can understand what I wrote.. )
0

#168 User is offline   Naomi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 24-April 12
  • Location:Montreal, Qc

Posted 24 April 2012 - 12:56 PM

Ok, so I'm new to MVC Frameworks, new to Yii and (you guessed) new to UserGroups.

First, I've gone through the UserGroups documentation and I can't seem to find a way to add custom permissions. When you go in the Root tools interface, you can set Read/Write/Admin rights for users/groups... I would like to be able to add a permission so I could set Read/Write/Custom/Admin or something like that. Is it possible? If not I think it would be a nice feature to add.

Also, I tried adding a profile extension... When I log on my user and try to save the modifications to the new section of my profile I keep getting the following message (saving the other parts of the profile works fine):
Error 403
You are not authorized to perform this action.

I followed the instructions in the documentation... is there something else I should know that might be the source of the problem?
The file permissions seem to be ok... unless it needs writing rights somewhere that I'm not aware of... I already gave write permissions to the apache user for the whole userGroups module folder.
0

#169 User is offline   bitmatix 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 162
  • Joined: 23-March 09

Posted 03 May 2012 - 02:06 AM

How does the settings that I make for a specific controller (i.e. "TestController") in "Root Tools" take effect?

The restrictions for a group doesn't work. Everybody can perform "write" action in the TestController.

Thanks
0

#170 User is offline   aka_Flow 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 23-May 12

Posted 23 May 2012 - 04:04 PM

Does anyone have the extension available for download? The dl from the extension page keeps saying its corrupt.

Edit: Nevermind, it was WinRAR's fault. Yay for 7zip!
0

#171 User is offline   rajesh1404 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 29-May 12

Posted 30 May 2012 - 08:03 AM

I have installed userGroup extension with fresh project, but once I have loged in as admin I got this exception "UserIdentity and its behaviour do not have method or closure named getGroup"

/var/www/YiiRoot/framework/base/CComponent.php(266)

254 public function __call($name,$parameters)
255 {
256 if($this->_m!==null)
257 {
258 foreach($this->_m as $object)
259 {
260 if($object->getEnabled() && method_exists($object,$name))
261 return call_user_func_array(array($object,$name),$parameters);
262 }
263 }
264 if(class_exists('Closure', false) && $this->canGetProperty($name) && $this->$name instanceof Closure)
265 return call_user_func_array($this->$name, $parameters);
266 throw new CException(Yii::t('yii','{class} and its behaviors do not have a method or closure named "{name}".',
267 array('{class}'=>get_class($this), '{name}'=>$name)));
268 }


->it shows exception at line no:266
0

#172 User is offline   Maxxer 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 75
  • Joined: 23-February 11
  • Location:Lecco (LC) - Italy

Posted 20 June 2012 - 05:37 AM

I have a custom controller and when I try to create a new user or a new group I get the following error:

[Wed Jun 20 12:34:15 2012] [error] [client 127.0.0.1] PHP Fatal error:  Cannot redeclare class YWebServiceController in /home/maxxer/work/www/management_site/protected/controllers/YwebserviceController.php on line 99, referer: http://localhost/work/www/management_site/userGroups/admin/documentation

any way to fix?

Line 99 is the closing of YWebServiceController class...
YetOpen S.r.l. - Your Open Source Partner
Lecco - Italy
http://www.yetopen.it
0

#173 User is offline   sadafs 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 14-February 11
  • Location:karachi, Pakistan

Posted 02 August 2012 - 11:03 PM

View Postnickcv, on 30 March 2011 - 07:39 PM, said:

i open this thread for comments and suggestions

you can find the module here
http://www.yiiframew...ion/usergroups/

if you need to report a bug do it in this thread or in the google code project page
http://code.google.c...ups/issues/list

current release 1.5 dropped support for Yii 1.1.6, and only supports 1.1.7


hi,
i m using userGroups for the first time. i wana know if it is possible to assign group to user at run time?
i mean in my system i m loading user from third party service and then assign roles/groups to them. is it possible with userGroups?
Posted Image
wa la illaha il Allah, wallahu Akbar
0

#174 User is offline   mihir 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 07-September 12

Posted 26 September 2012 - 07:19 AM

EOAuthUserIdentity and its behaviors do not have a method or closure named "getGroup".

Above error when i am trying to authenticate user with extension eoauth....
Any help will be greatly appreciated...
0

#175 User is offline   Poco 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 28-November 12

Posted 28 November 2012 - 11:44 PM

I have been using Yii and UserGroups to replace a manual club member registration with something a bit more modern. It is all working quite well and almost ready to launch.

I have a spreadsheet of current users that I would like to import. The data matches the models that I've created with Yii, including data in a userGroups profile extension.

Is there a convenient way of importing this data to create new users with userGroups?

I have figured out the minimum form to post to create new accounts that I copied from the "add user" form in the admin (POSTING to /members/userGroups/admin which seems to ignore input of profile extension data). I could write something to POST each new user, and then another script to update the profile extension data for each user, but I was hoping for something a bit easier that I missed.

I doubt there is anything built in (or I am complete idiot) to import the data from a csv or something, but it would be cool if someone could point me in the right direction for a good way to create such a script. What are the internal classes that I need to use to write my own controller that could handle this?

Thanks for any help.

EDIT: I took care of this by making an Admin controller in my Module that exposed actions with views for uploading and parsing the CSV files.
0

#176 User is offline   salsero 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 80
  • Joined: 05-September 12
  • Location:Italia

Posted 11 January 2013 - 01:32 PM

sorry but i have a question:

if i have a generic user "user" different by Yii::app()->user, there is a method to interrogate pbac?

for example:

user->pbac ??

tnx
0

#177 User is offline   Helgi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 17-January 13

Posted 17 January 2013 - 04:11 PM

Thanks for the great extension!
Only question is about setting default rights for ALL controllers (I'm a bit nuts of security, and usually use "default deny" rules (in iptables, squid and so on (lol) )) and allow only needed things in each one.
So I want to DENY access to all but site controller (to get access to site at all?) by default, and force users to login on any action ("disable" guests).
Could not find anything in documentation.
Where can I found default rules?
Thanks and awaiting for your answer.
PS sorry for my English.

PPS. While some experiments there was born another question. Is it possible to set returnURL to redirect after login back to page which I was trying to access? Right now I'm always redirected to userGroups/admin/documentation (if I'm root admin), or to home path set for ordinary user/group.
0

#178 User is offline   Poco 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 28-November 12

Posted 29 January 2013 - 09:03 PM

Quick permission question about account activations and password reset.

I have users complaining about 403 errors they get when trying to activate their new accounts and I believe I have reproduced the problem.

If you click on the activation link (or password reset) from the email that is sent, close the window, and click on the link again, you get a 403 permission denied showing the logged in user as "Recovery Mode".

Can someone point me in the direction of the specific permission changes needed to allow recovery mode partial login to still access the activation link without error?

EDIT:

I found a change that seems to work in UserController.php. Is this safe? Can anyone see a security issue with allowing recovery users to be able to activate accounts?

array('allow',  // actions users can access while in recovery mode
	'actions'=>array('recovery','logout',

'activate','passRequest'  // Added these

	),
	'users'=>array('#'),
),

0

#179 User is offline   ajimatahari 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 14-November 12

Posted 18 February 2013 - 12:13 AM

after installing usergroups, i cant access Gii... it's always bounce back to the homepage
0

#180 User is offline   ajimatahari 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 14-November 12

Posted 18 February 2013 - 12:22 AM

nevermind... just solved it... hahahaha... thanks anyway
0

Share this topic:


  • (10 Pages)
  • +
  • « First
  • 7
  • 8
  • 9
  • 10
  • 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