Some hosts require this line in htaccess:
RewriteBase /
userGroups (and the rest of Yii) works great on 000webhost which is shared and free. So it should definitely work on most hosts, free or not.
Some hosts require this line in htaccess:
RewriteBase /
userGroups (and the rest of Yii) works great on 000webhost which is shared and free. So it should definitely work on most hosts, free or not.
nickcv,
Ok I came across this in another app build today. After further digging this is what I found out.
If password_strength is set to either 0
or 1
I can make the changes to which group a user belongs. If I have it set to 2
then it will not work. When I try and make the change the error appears…
The following problems occurred:
the password must contain at least 2 digits, 2 letters and a special character
Still no luck getting this to work on godaddy.
Would anyone like to share their settings for main.php and .htacess?
Thanks
I got this working on go daddy.
'urlManager'=>array( 'urlFormat'=>'path', 'showScriptName'=>false, ),
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
email is not working for me on godaddy.
I requested a new password and get no email.
Resolved.
I had to remove the mail component from main.php
First, this looks like a really nice module. I’ve been reading through the forum and the documentation. I’ll install over the weekend and play around. One question: is it possible to assign a user to a group (or change groups) using a function call? I’m integrating Paypal with a subscription membership app. Basically, when a Paypal message comes in for a new subscriber, I need to update the group. Since Paypal messages can come in at any time, there won’t be a logged in user associated with the group assignment. Worst case, I can update the table columns directly, but it would be nice if there were a programmatic way.
It looks like updating the usergroups_user.group_id column is all I need to do. Well, and add a couple of extra columns for other functionality. I’ll just wrap that in a class and tie it into the paypal piece.
Thanks. This is going to work perfectly.
Hi,
Just can not seem to get UserGroups extension to work with the blog demo. Can anyone give some guidance? Using Windows 7, XAMPP, Yii 1.1.8 and UserGroups 1.8
The physical path D:\yii\blog is aliased to D:\YiiBlog in apache alias file and it works fine for the blog demo without UserGroups installed.
My suspicion is that UrlManager and .htaccess won’t work correctly unless the application root is under the xampp htdocs directory and not aliased as I have done. But I am very new at this and hope some experts can help me understand how the UrlManager is supposed to work and why it does not work in my case.
[b]
Found out the theory above was not true by experiment.[/b]
With UserGroups installed I get 404 errors on any of these URL’s:
//localhost/YiiBlog/userGroups
//localhost/YiiBlog/site/page?view=about
And when I type this, I get index.php! (the first page of the blog demo)
//localhost/YiiBlog/index.php?r=post/index
This is the actual 404 error
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
10/08/11 20:14:01
Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1
.htaccess file is in application root - YiiBlog (/blog) directory.
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# if a directory or file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward to index.php
RewriteRule . index.php
here are the relevant parts of config/main.php
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'Blog Demo',
// preloading 'log' component
'preload'=>array('log'),
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
),
'modules'=>array(
'userGroups'=>array(
'accessCode'=>'',
),
),
// 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',
'showScriptName'=>false,
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
...
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=yiiblog',
'emulatePrepare' => true,
'username' => 'root',
'password' => 'password',
'charset' => 'utf8',
'tablePrefix' => 'tbl_',
),
'errorHandler'=>array(
// use 'site/error' action to display errors
'errorAction'=>'site/error',
),
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning, info, trace, notice',
),
// 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'=>require(dirname(__FILE__).'/params.php'),
);
Sorry for the long post, but I could really use the help
Ok changed the .htaccess file for Windows 7 to this:
Options +FollowSymLinks
IndexIgnore */*
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /YiiBlog/
# 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>
(Added RewriteBase). Now I see a 404 error coming from the framework instead of apache.
and the rest of the links in the application seem to work fine.
but when I try to access //localhost/YiiBlog/userGroup still get a darn 404 error!
However, now I have a stack trace from the application :
2011/10/09 05:02:31 [trace] [system.CModule] Loading "log" application component
in D:\yii\blog\index.php (13)
2011/10/09 05:02:31 [trace] [system.CModule] Loading "request" application component
in D:\yii\blog\index.php (13)
2011/10/09 05:02:31 [trace] [system.CModule] Loading "urlManager" application component
in D:\yii\blog\index.php (13)
2011/10/09 05:02:31 [trace] [system.CModule] Loading "coreMessages" application component
in D:\yii\blog\index.php (13)
2011/10/09 05:02:31 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'Unable to resolve the request "userGroups".' in D:\yii\yii-1.1.8.r3324\framework\web\CWebApplication.php:281
Stack trace:
#0 D:\yii\yii-1.1.8.r3324\framework\web\CWebApplication.php(136): CWebApplication->runController('userGroups')
#1 D:\yii\yii-1.1.8.r3324\framework\base\CApplication.php(158): CWebApplication->processRequest()
#2 D:\yii\blog\index.php(13): CApplication->run()
#3 {main} REQUEST_URI=/YiiBlog/userGroups
Any help would be greatly appreciated!
I think I finally figured out why I was getting 404 errors from the framework after trying to install userGroups module.
the short answer is that I had an incorrect setting in protected/config/main.php
Specifically in UrlManager section I changed this:
'urlManager'=>array(
'urlFormat'=>'path',
'caseSensitive'=>false,
'showScriptName'=>false,
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
to this:
'urlManager'=>array(
'urlFormat'=>'path',
//'caseSensitive'=>false, // <--Commented out this line
'showScriptName'=>false,
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
The CWebApplication object is VERY PICKY about case sensitivity when it determines how to identify and load modules from the config file. While troubleshooting a related .htaccess problem, I saw the caseSensitive parameter from another post and tried incorrectly to simplify the app thinking that if caseSensitivity were turned off it would be one less thing to worry about. As it happens, the urlManager does indeed change the case (to all lower case ‘usergroups’) but the problem occurs when CWebApplication tries to get the module and compares it to the name of the module e.g. ‘userGroupsModule’.
So, if anyone else is having problems with the installation of userGroups module, you may want to:
first make sure that you can run your existing application with the proper .htaccess file for mod rewrite, in conjunction with the correct urlManager settings in /protected/config.php. You should definitely spend the time to get this working first before you even attempt to install the userGroups module.
A. Once you do get urlManger and htaccess working, be advised that your Apache error logs will no longer be as much service, since the CHttpException object will be throwing any 404 page not found errors.
Another lesson learned, was that the .htaccess file needs to be in the main directory (a peer of index.php), and not necessarily in the protected/ directory. There is a slightly different version for Windows than Unix, so make sure you use the right one. Also with respect to .htaccess, if you are working on windows you may find that you can not save a file with a dot as first character. In that case save your .htaccess file as xhtaccess then use the cmd shell (start->run->cmd). Change to your application top level directory and do:
rename xhtaccess .htaccess
Also be careful about making assumptions if you are new to Yii like me, there are a lot of conventions that may not be totally intuitive for someone from a different programming background. E.g.: You cant assume that turning case sensitivity off in a config file will be an application wide change.
Finally, even though I mostly use Eclipse/YiClipse for coding, It seemed that it was slightly easier to debug the application in Netbeans. So if you are new to this, it might pay off for you to become familiar with both.
hi nick:)… m using userGroups modulein my app… i used it for my login and it works perfectly fine… now i need to put it in the frontend… say i need to put it in the site controller…
i rendered it like this in ma theme… the form is rendered…but it does not login…
<? $a=new UserGroupsUser;
echo $this->renderPartial('application.modules.userGroups.views.user.login', array('model'=>$a)); ?>
please help me how to go abt
Hi nickcv,
I just installed today the userGroups module.
I created couple groups for test.
I am trying to update group access permissions, click on save, but
I can’t see the change on screen (also on db).
Thanks,
Itay.
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'=>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.user.models.*',
),
'modules'=>array(
// uncomment the following to enable the Gii tool
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'123456',
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('192.168.1.*'),
),
'user' => array(
'debug' => true
),
‘userGroups’=>array(
'accessCode'=>'type here your access code',
)
),
// application components
'components'=>array(
'User'=>array(
'class' => 'User',
),
// 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(
'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
),*/
// uncomment the following to use a MySQL database
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=sonam_usermanagement',
'emulatePrepare' => true,
'username' => 'sonam',
'password' => 'sonam123',
'charset' => 'utf8',
),
'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'=>'webmaster@example.com',
'GL_ACTIVE'=>'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