yii-user

Yii PHP Framework extension for registration and management users accounts.
121 followers

Yii PHP Framework extension for registration and management users accounts.

  • Login from User Name or Email
  • Registration
  • Activation accounts (verification email, administrator or not)
  • Recovery password (send recovery key to user email)
  • User profile page
  • Manage Users
  • Manage Profile Fields
  • Profile field widget for view, edit and save data
  • Date widget (jQueryUI datepicker)
  • File upload widget
  • Profile Relation Widget
  • API

Resources

Ohloh project report for yii-user

Documentation

Requirements

  • Yii 1.1 or above

Installation

  • Extract the release file under protected
  • Insert to config/main.php
return array(
...
    // autoloading model and component classes
    'import'=>array(
        'application.models.*',
        'application.components.*',
        'application.modules.user.models.*',
        'application.modules.user.components.*',
    ),
...
        'modules'=>array(
                'user',
        ),
...
        // application components
        'components'=>array(
...
                'user'=>array(
                        // enable cookie-based authentication
                        'allowAutoLogin'=>true,
                        'loginUrl' => array('/user/login'),
                ),
...
        ),
...
);
  • Create tables (dump files schema.mysql.sql and schema.sqlite.sql)
  • Insert items into zii.widgets.CMenu array (protected/views/layouts/main.php)
array('url'=>Yii::app()->getModule('user')->loginUrl, 'label'=>Yii::app()->getModule('user')->t("Login"), 'visible'=>Yii::app()->user->isGuest),
array('url'=>Yii::app()->getModule('user')->registrationUrl, 'label'=>Yii::app()->getModule('user')->t("Register"), 'visible'=>Yii::app()->user->isGuest),
array('url'=>Yii::app()->getModule('user')->profileUrl, 'label'=>Yii::app()->getModule('user')->t("Profile"), 'visible'=>!Yii::app()->user->isGuest),
array('url'=>Yii::app()->getModule('user')->logoutUrl, 'label'=>Yii::app()->getModule('user')->t("Logout").' ('.Yii::app()->user->name.')', 'visible'=>!Yii::app()->user->isGuest),

Login

Default users:

  • admin/admin
  • demo/demo

Read more

Change Log

Feb 09, 2011

  • add multiple validators for profile field (fixed issue 56 )
  • fix delete UWfile error for sqlite
  • Merge controller filters (fixed issue 55 )
  • Added support of configuring behaviors via module fields
  • Fixed issue 53
  • Fixed issue 47
  • Fixed issue 44
  • Fixed issue 43
  • Translation fix
  • Rename translation ua->uk
  • Added Hungarian (thanks @lupus2001), Greek (thanks @drumaddict) and Portuguese (thanks fred...@gmail.com) translation
  • Added UWjuiAutoComplete widget (thanks @hermallorn)
  • SQL: tbl_profiles_fields type is InnoDB

Sep 20, 2010

  • Parameters names tables
  • Parameter enable/disable "captcha"
  • New mode: activate user by administrator
  • New mode: activate user on registration
  • New profile field types
  • Profile field widget for view, edit and save data
  • Date widget (jQueryUI datepicker)
  • File upload widget
  • Relation Widget

Aug 03, 2010

  • Added Spanish translation

June 29, 2010

  • version 0.2-r48 fixed bugs.

February 26, 2010

  • version 0.2-r43 temporarily moved to folder "message" to the root folder due to a bug.

February 25, 2010

  • version 0.2.

February 12, 2010

  • Initial release.

Total 20 comments

#6721 report it
walidov at 2012/02/01 12:08am
This is a hell of extension

This extension is awesome !! Worked perfectly ..

I loved the profile fields management feature, this is what i need exactly.

#6651 report it
tomwittkower at 2012/01/25 12:15pm
documentation on adding fields to profile

I am new to yii. I have been able to deploy this extension. I am looking for documentation or instructions for adding/removing user profile fields. Can anyone help?

#6550 report it
Drini at 2012/01/18 04:54am
126 votes up? only? seriously??

Comon guys.. if you like the module show it. Don't be lazy.

Great job, everything went smooth.

#6249 report it
fleuryc at 2011/12/21 12:34pm
problem with widgetEdit in "profile/edit" or "admin/update" modes

I changed views/admin/_form.php and views/profile/edit.php , where $field->widgetEdit($profile) is called twice with no apparent reason...

change this :

...
if ($field->widgetEdit($profile)) {
    echo $field->widgetEdit($profile);
} elseif ($field->range) {
...

into :

...
$widgetEdit = $field->widgetEdit($profile);
if ($widgetEdit) {
    echo $widgetEdit;
} elseif ($field->range) {
...
#6247 report it
fleuryc at 2011/12/21 10:09am
UWfile rendering

Hi!

In order to display the image in case it is one, I changed viewAttribute in UWfile.php :

if (in_array(pathinfo($file,PATHINFO_EXTENSION),array("jpg", "jpeg", "gif", "png"))) {
    return CHtml::image(
        Yii::app()->baseUrl.'/'.$file,
        pathinfo($file,PATHINFO_BASENAME),
        array("style"=>"width:100px;")
    );
} else {
    return CHtml::link(pathinfo($file,PATHINFO_BASENAME),Yii::app()->baseUrl.'/'.$file);
}

I also changed the editAttribute method to display the actual file when editing :

return CHtml::activeFileField($model,$field->varname,$params)
    .(($model->getAttribute($field->varname))?
        '<br/>'.self::viewAttribute($model,$field)
        .'<br/>'.CHtml::activeCheckBox($model,'[uwfdel]'.$field->varname,$params)
        .' '.CHtml::activeLabelEx($model,'[uwfdel]'.$field->varname,array('label'=>UserModule::t('Delete file'),'style'=>'display:inline;'))
    :'');
#5838 report it
nlac at 2011/11/18 06:11pm
referring a non-existing js file

Hello, congrats, really cool module. Let me make a small notice: ProfileFieldController.php in line 66 tries to register a js file "form.js" what is nowhere. Can it cause some problems?

#5805 report it
oceatoon at 2011/11/14 11:16pm
user/admin/create by ajax and dialog ?

Hi I was trying to put the user create form in a dialog to be called on demand as an ajax popin to create a new user. but strangely the same form has all it's required fields properly set when rendered normally as a page , but when in the dialog called by ajax, only the $profile fields are required and the $model validation always passes even though some parts are mandatory ? any idea ?

#5804 report it
rrbot at 2011/11/14 09:13pm
Yii-User Import

Hey guys, I couldn't find any mass import ability for Yii-User, so I wrote an extension. You can find it here:

http://www.yiiframework.com/extension/yii-userimport/

#5702 report it
fixticks at 2011/11/04 12:14am
"user.UserModule" is invalid

Tried installing this module on a new Yii installation and kept getting this error. 'Alias "user.UserModule" is invalid. Make sure it points to an existing PHP file.'

I realised i was moving the contents of the modules directory that comes with this extension download, instead of moving the whole modules directory and dropping it into my protected directory.

#5125 report it
hesam.khaki at 2011/09/16 04:43am
about css

this module has css files within it's folders, but views and grids and links are as simple as default views of Yii. does it have a special style? if so, how can I config it? I've tried to attach it's css files manually but nothing has changed.

#5066 report it
chrisb34 at 2011/09/12 09:21am
Cookie based autoLogin

I'm trying to disable auto login and have set autoLogin to false in main.php as follows:-

'components'=>array(
    'user'=>array(
                        // enable cookie-based authentication
                        'allowAutoLogin'=>false,
                     ))

but it doesn't seem to make any difference.

I am presuming that the 'autoLogin' parameter in the module section is autoLogin after Registration and doesn't affect cookie based login.

Thanks

#4974 report it
cioner at 2011/09/02 02:05pm
Where does UserLoginStats class come from????!!!

There's a mysterious line in WebUser.php where it instantiates UserLoginStats class.

It's like this:

protected function beforeLogin($id, $states, $fromCookie)
    {
        parent::beforeLogin($id, $states, $fromCookie);
 
        $model = new UserLoginStats();
        $model->attributes = array(
            'user_id' => $id,
            'ip' => ip2long(Yii::app()->request->getUserHostAddress())
        );
        $model->save();
 
        return true;
    }

where does this class come from? I've grepped all sources and even sources in yii framework directories and there is no such class definition.

I am confused.

#4859 report it
Alix at 2011/08/22 12:22pm
display some properties

How can i display some existing users' informations in yii-user's module plz ? i need to display these informations in session value after.

#4335 report it
frocco at 2011/06/27 10:06am
Have admin see hidden fields

Hello,

How can I allow the admin to see a users hidden fields?

#4269 report it
parekhurvish at 2011/06/21 11:09am
how to implment facebook connect and google login????

I want to implement Facebook & Google Login but facing hard time in implementing them. Will OAuth work for FB and Google both? Please guide me on How to implement.

#4211 report it
yura at 2011/06/16 04:14am
response

A very nice module. But there's two buts: 1. Pity cannot use it as a module inside a module 2. Pity that a user can be either just a user or a superadmin and no roles functionality is implemented.

#4204 report it
pcero at 2011/06/15 03:51pm
schema

@awilum: schema.mysql.sql is under /protected/modules/user/data/

#4186 report it
Awilum at 2011/06/15 04:35am
DUMP ???

dump files schema.mysql.sql where is it ?

#4071 report it
swisscheese at 2011/06/03 05:24am
Next Release?

I read somewhere about a new release coming out any time. I am wondering if salted passwords might be part of that?

#4015 report it
rahulraj at 2011/05/27 11:32am
thanks

great

Leave a comment

Please to leave your comment.

Create extension