[module] userGroups

i have hust extracted the files in to 192.168.1.35/myfolder/appname/protected/modules

and changed the config like as follows

<?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'=&gt;dirname(__FILE__).DIRECTORY_SEPARATOR.'..',


'name'=&gt;'My Web Application',





// preloading 'log' component


'preload'=&gt;array('log'),





// autoloading model and component classes


'import'=&gt;array(


	'application.models.*',


	'application.components.*',


	'application.modules.user.models.*',


	


),


 








'modules'=&gt;array(


	// uncomment the following to enable the Gii tool


	


	'gii'=&gt;array(


		'class'=&gt;'system.gii.GiiModule',


		'password'=&gt;'123456',


	 	// If removed, Gii defaults to localhost only. Edit carefully to taste.


		'ipFilters'=&gt;array('192.168.1.*'),


	),


	


'user' =&gt; array(


  'debug' =&gt; true


),

‘userGroups’=>array(

    'accessCode'=&gt;'type here your access code',


)





	


),





// application components


'components'=&gt;array(


	 'User'=&gt;array(


  'class' =&gt; 'User',


),














	// uncomment the following to enable URLs in path-format


	


	 'urlManager'=&gt;array(


                    'urlFormat'=&gt;'path',


                    'rules'=&gt;array(


                      '&lt;controller:&#092;w+&gt;/&lt;id:&#092;d+&gt;'=&gt;'&lt;controller&gt;/view',


                      '&lt;controller:&#092;w+&gt;/&lt;action:&#092;w+&gt;/&lt;id:&#092;d+&gt;'=&gt;'&lt;controller&gt;/&lt;action&gt;',


                      '&lt;controller:&#092;w+&gt;/&lt;action:&#092;w+&gt;'=&gt;'&lt;controller&gt;/&lt;action&gt;',


                    ),


                    'showScriptName'=&gt;false,


            ),


	


	/*'db'=&gt;array(


		'connectionString' =&gt; 'sqlite:'.dirname(__FILE__).'/&#46;&#46;/data/testdrive.db',


	),*/


	// uncomment the following to use a MySQL database


	


	'db'=&gt;array(


		'connectionString' =&gt; 'mysql:host=localhost;dbname=sonam_usermanagement',


		'emulatePrepare' =&gt; true,


		'username' =&gt; 'sonam',


		'password' =&gt; 'sonam123',


		'charset' =&gt; 'utf8',


	),


	


	'errorHandler'=&gt;array(


		// use 'site/error' action to display errors


        'errorAction'=&gt;'site/error',


    ),


	'log'=&gt;array(


		'class'=&gt;'CLogRouter',


		'routes'=&gt;array(


			array(


				'class'=&gt;'CFileLogRoute',


				'levels'=&gt;'error, warning',


			),


			// uncomment the following to show log messages on web pages


			/*


			array(


				'class'=&gt;'CWebLogRoute',


			),


			*/


		),


	),


),





// application-level parameters that can be accessed


// using Yii::app()-&gt;params['paramName']


'params'=&gt;array(


	// this is used in contact page


	'adminEmail'=&gt;'webmaster@example.com',


	'GL_ACTIVE'=&gt;'1'


),

);

and changed the htaccess also

What else I have to do as When i Am Running

http://192.168.1.35/sonam/usermanagement/userGroups/install

it shows

Not Found

The requested URL /sonam/usermanagement/userGroups/install was not found on this server.

Apache/2.2.17 (Ubuntu) Server at 192.168.1.35 Port 80 Please help me

I have a fresh install if userGroups installed and working well, except that when I try to invite or add a new user in root tool it fails:


UserController cannot find the requested view "//ugmail/invitation". 

Not sure where these view files are in the project. I found a templates folder that has template_invitation.php, but not really understand whats going on…

please help guys as i am stuck with this if i run the url with index.php else without index.php it doesn’tttttttttttttttt so help me

Hi Nick…I saw this post in the forum but din find a solution to it… has it been sorted??

i need to access the session profile variable…

and cant i change the value in the session like this?

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

i tried it but it gave me errors.

please help me if u can:)

email not working …is there anything special that i have to do for email sending…

great extension, thanks nickcv~

I have a problem that how can I apply different profile fields on different usergroup?

For example, I have usergroup1 and usergroup2, also two profile models UserProfile1 and UserProfile2. Now I want usergroup1 only has fields defined in UserPrifile1 and usergroup2 only has fields defined in UserProfile2. Is there any way to do it?

–EDIT

Besides, after adding profile extensions, I can’t modify the profile of anyone, including root user. It says Error 403, why?

I have an issue that can i make the module menus in the basic views i.e in myproject/protected/views/layouts/main

please help me out…this is my third post not event got an answer of one so please help me out hope i get a reply

can i make this extension a module based extension

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.251/~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

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',

	),

);



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

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.yiiframework.com/doc/guide/1.1/en/topics.auth#defining-authorization-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?

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?

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.

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 modules config.. or it can understand the CBehaviors(for example frontend or bakend).. so people dont 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… )

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.

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

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!

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

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…