Yii 1.1: yii-user

Yii PHP Framework extension for registration and management users accounts.
201 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
  • Change your config main:
return array(
    #...
    // autoloading model and component classes
    'import'=>array(
        'application.models.*',
        'application.components.*',
        'application.modules.user.models.*',
        'application.modules.user.components.*',
    ),
    #...
    'modules'=>array(
        #...
        'user'=>array(
            # encrypting method (php hash function)
            'hash' => 'md5',
 
            # send activation email
            'sendActivationMail' => true,
 
            # allow access for non-activated users
            'loginNotActiv' => false,
 
            # activate user on registration (only sendActivationMail = false)
            'activeAfterRegister' => false,
 
            # automatically login from registration
            'autoLogin' => true,
 
            # registration path
            'registrationUrl' => array('/user/registration'),
 
            # recovery password path
            'recoveryUrl' => array('/user/recovery'),
 
            # login form path
            'loginUrl' => array('/user/login'),
 
            # page after login
            'returnUrl' => array('/user/profile'),
 
            # page after logout
            'returnLogoutUrl' => array('/user/login'),
        ),
        #...
    ),
    #...
    // application components
    'components'=>array(
    #...
        'db'=>array(
        #...
            'tablePrefix' => 'tbl_',
        #...
        ),
        #...
        'user'=>array(
            // enable cookie-based authentication
            'class' => 'WebUser',
            'allowAutoLogin'=>true,
            'loginUrl' => array('/user/login'),
        ),
    #...
    ),
    #...
);
  • Change your config console:
return array(
    #...
    'modules'=>array(
        #...
        'user'=>array(
            # encrypting method (php hash function)
            'hash' => 'md5',
 
            # send activation email
            'sendActivationMail' => true,
 
            # allow access for non-activated users
            'loginNotActiv' => false,
 
            # activate user on registration (only sendActivationMail = false)
            'activeAfterRegister' => false,
 
            # automatically login from registration
            'autoLogin' => true,
 
            # registration path
            'registrationUrl' => array('/user/registration'),
 
            # recovery password path
            'recoveryUrl' => array('/user/recovery'),
 
            # login form path
            'loginUrl' => array('/user/login'),
 
            # page after login
            'returnUrl' => array('/user/profile'),
 
            # page after logout
            'returnLogoutUrl' => array('/user/login'),
        ),
        #...
    ),
    #...
);
  • Run command: yiic migrate --migrationPath=user.migrations
  • Input admin login, email and password
  • 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),

Change Log

  • 2012-06-11 | (HEAD, origin/master, origin/HEAD, master) Readme update - [Mikhail Mangushev]
  • 2012-06-11 | Fixed security bug (thanks jpablo) - [Mikhail Mangushev]
  • 2012-06-07 | Fix marsuboss pullrequest - [Mikhail Mangushev]
  • 2012-06-07 | Merge pull request #4 from marsuboss/master - [mishamx]
  • 2012-06-06 | Add 'Old Password' Field for change password - [DECORTE Jeremy]
  • 2012-05-26 | Merge pull request #3 from rmenor/master - [mishamx]
  • 2012-05-26 | Add DECIMAL type in ProfileField - [rmenor]
  • 2012-05-26 | Repair Issue 45: Field Type Float Won't Accept 10,2 Format - [rmenor]
  • 2012-05-23 | Set default values in migration - [Mikhail Mangushev]
  • 2012-05-23 | Merge branch 'master' of github.com:mishamx/yii-user - [Mikhail Mangushev]
  • 2012-05-23 | Interactive migration added - [Mikhail Mangushev]
  • 2012-05-22 | Merge pull request #2 from phundament/master - [mishamx]
  • 2012-04-19 | fixed alias - [Tobias Munk]
  • 2011-10-30 | Added to the global dictionary translation - [Mikhail Mangushev]
  • 2011-10-19 | Merge pull request #1 from rallin/simple_clone - [mishamx]
  • 2011-10-18 | Update Readme - [rallin]
  • 2011-10-18 | Move files to the root - [rallin]
  • 2011-09-06 | WebUser: comment stat module Migration: added current time - [Mikhail Mangushev]
  • 2011-08-19 | Admin user rules fix - [Mikhail Mangushev]
  • 2011-08-11 | Readmi fix Migraton fix for sqlite - [Mikhail Mangushev]
  • 2011-08-11 | change version - [Mikhail Mangushev]
  • 2011-08-11 | Use local setting for migration - [Mikhail Mangushev]
  • 2011-08-11 | Unixttime fields replaced to timestamp - [Mikhail Mangushev]
  • 2011-08-10 | Readme update - [Mikhail Mangushev]
  • 2011-08-10 | Move migration Use command: yiic migrate --migrationPath=application.modules.user.migrations - [Mikhail Mangushev]
  • 2011-08-08 | Added readme markdown - [Mikhail Mangushev]
  • 2011-08-07 | Yii-User install migration - [Mikhail Mangushev]
  • 2011-08-05 | Added WebUser component - [Mikhail Mangushev]
  • 2011-06-02 | * Update Admin Interface * Fixed issue 60 * Fixed issue 61 * Fixed issue 63 * Fixed issue 77 * Fixed issue 80 * Fixed issue 81 * Fixed
  • 2011-05-31 | Added dutch translation (thanks afj.lamb...@gmail.com) Fixed issue 86 - [Mikhail Mangushev]
  • 2011-04-04 | Polish translation added (thanks aleksand...@gmail.com) Fixed issue 79 - [Mikhail Mangushev]
  • 2011-03-31 | Fixed issue 59 - [Mikhail Mangushev]
  • 2011-03-31 | Fixed issue 75 - [Mikhail Mangushev]
  • 2011-02-23 | Japanese translation (fixed issue 62) - [Mikhail Mangushev]
  • 2011-02-22 | Added Romanian translation (thanks @matricks) - [Mikhail Mangushev]
  • 2011-02-16 | * add multiple validators for profile field (fixed issue 56) * fix delete UWfile error for sqlite - [Mikhail Mangushev]
  • 2011-02-16 | Merge controller filters (fixed issue 55) - [Mikhail Mangushev]
  • 2011-02-16 | Added support of configuring behaviors via module fields (fixed issue 54) - [Mikhail Mangushev]
  • 2011-02-09 | Fixed issue 53 - [Mikhail Mangushev]
  • 2011-02-09 | Fixed issue 47 - [Mikhail Mangushev]
  • 2011-02-09 | Fixed issue 44 - [Mikhail Mangushev]
  • 2011-02-08 | logic fix r97 - [Mikhail Mangushev]
  • 2011-02-08 | Fixed issue 43 - [Mikhail Mangushev]
  • 2011-01-31 | - [Vitaliy Step]
  • 2011-01-27 | Portuguese translation (fixed issue 51) - [Mikhail Mangushev]
  • 2011-01-27 | Fixed issue 49 - [Mikhail Mangushev]
  • 2011-01-27 | Fixed issue 36 - [Mikhail Mangushev]
  • 2011-01-27 | Fixed issue 24 - [Mikhail Mangushev]
  • 2011-01-27 | * Translation fix * Rename translation ua->uk * Added Hungarian (thanks @lupus2001) and Greek (thanks @drumaddict) translation * Added
  • 2011-01-19 | Widgetparams resize - [Mikhail Mangushev]
  • 2010-12-02 | Form validator fix - [Mikhail Mangushev]
  • 2010-11-22 | Fixed issue 46 - [Mikhail Mangushev]
  • 2010-11-15 | AJAX form validation - [Mikhail Mangushev]
  • 2010-11-12 | IE fix - [Mikhail Mangushev]
  • 2010-11-09 | Fixed issue 41 - [Mikhail Mangushev]
  • 2010-11-02 | Fixed issue 39 - [Mikhail Mangushev]
  • 2010-11-02 | Fixed issue 38 - [Mikhail Mangushev]
  • 2010-10-27 | (0.3) Admin edit form fix - [Mikhail Mangushev]
  • 2010-10-27 | Fixed issue 37 - [Mikhail Mangushev]
  • 2010-09-23 | Fixed issue 34 and translation. - [Mikhail Mangushev]
  • 2010-09-23 | Fixed issue 31 - [Mikhail Mangushev]
  • 2010-09-22 | Fixed issue 32 - [Mikhail Mangushev]
  • 2010-09-20 | Added: * Parameters names tables * Parameter disable "captcha" * New mode: activate user by administrator * New mode: activate user
  • 2010-08-03 | fixed Issue #22 - [Mikhail Mangushev]
  • 2010-08-03 | * Added Spanish translation * Fixed issue #18 - [Mikhail Mangushev]
  • 2010-06-30 | fixed recovery form reg exp rules - [Mikhail Mangushev]
  • 2010-06-29 | Fixed: * issue #11 * issue #12 * issue #14 * issue #15 * issue #16 - [Mikhail Mangushev]
  • 2010-03-17 | Fix bug: clear password on login - [Mikhail Mangushev]
  • 2010-02-27 | Added and update: * user relations API * reange (select) - [Mikhail Mangushev]
  • 2010-02-26 | temporarily due to a bug http://code.google.com/p/yii/issues/detail?id=636 - [Mikhail Mangushev]
  • 2010-02-26 | bug fix - [Mikhail Mangushev]
  • 2010-02-26 | fix bug - [Mikhail Mangushev]
  • 2010-02-25 | (0.2) UserModule - [Mikhail Mangushev]
  • 2010-02-25 | ported to module - [Mikhail Mangushev]
  • 2010-02-13 | fix: * issue #3 * issue #4 * Error saving profile: empty activation key - [Mikhail Mangushev]
  • 2010-02-13 | fix Issue #2 - [Mikhail Mangushev]
  • 2010-02-11 | (0.1) Yii-User version 0.1 release. = Features of Yii-User = * Login from User Name or Email * Registration * Activation accounts (v
  • 2010-01-20 | Yii-User version 0.1 (alpha) = Features of Yii-User = * Login from User Name or Email * Registration * Activation accounts

Total 20 comments

#19863 report it
Fábio Sales at 2016/05/20 08:53am
The table "{{users}}" for active record class "User" cannot be found in the database.

To solve this problem, change this lines from the UserModule class:

public $tableUsers = '{{users}}';
public $tableProfiles = '{{profiles}}';
public $tableProfileFields = '{{profiles_fields}}';

to:

public $tableUsers = 'tbl_users';
public $tableProfiles = 'tbl_profiles';
public $tableProfileFields = 'tbl_profiles_fields';
#19858 report it
Rajith R at 2016/05/18 07:03am
Great

Thank You

#19746 report it
Headshaker at 2016/01/18 05:31am
@Rajith R

What do you mean by "combo" ?

I think that there is no need to replace "Rights" as there are already good modules out there which works great with Yii2 User module

BTW new udpated Yii2 User link https://packagist.org/packages/marsoltys/yii2user

#19744 report it
Rajith R at 2016/01/18 12:43am
@Headshaker

Thats a great news!! which is the combo? replacement for rights?

#19680 report it
Headshaker at 2015/11/28 06:05pm
Yii2 User announcement

Hi guys,

Just to let you know that I have rewritten this extension for Yii2.

It can be found here -> https://packagist.org/packages/marsoltys/yii2user

#19582 report it
Rajith R at 2015/09/17 01:40am
@lynmar

I didnt get your question!

#19581 report it
Rajith R at 2015/09/17 01:39am
@malkabani.com

Add translate function in the attributes labels array, that will be a foreach loop in the profilefields model.

#19410 report it
lynmar at 2015/06/22 06:03pm
@master

why after create a new user the syste change to "@master" user?

#19389 report it
malkabani.com at 2015/06/14 06:00am
trnaslate profile field name

hi all how i can translte profile field name to anothr languages thank you

#19112 report it
Rajith R at 2015/03/20 01:52am
@vishun

Thank you.

#19105 report it
vishun at 2015/03/17 07:48am
some question

vision:yii-user-0.3-61-gfc69518.zip
1.the schema.mysql.sql,the field "lastvisit" should change to "lastvisit_at".
2.the ProfileFieldController->actionDelete() line 429

$sql = 'ALTER TABLE ' . Profile::model()->tableName() . ' DROP `' . $model->varname . '`';
if ($model->dbConnection->createCommand($sql)->execute()) {
    $model->delete();
}

this only delete profile value,the profilefield value still alive,$model->delete() could not work,I do not know why?maybe the execut() return value only in "delete" "insert" "update",not in "drop" ,I'm not sure.

$sql = 'ALTER TABLE ' . Profile::model()->tableName() . ' DROP `' . $model->varname . '`';
$model->dbConnection->createCommand($sql)->execute()) 
    $model->delete();

this code can work well,but maybe not safe.

#18827 report it
Rajith R at 2015/01/19 05:11am
@malkabani.com

Update it. No other ways!!

#18620 report it
malkabani.com at 2014/12/02 01:00pm
customizeation

if i want to customize some feature in this module how i should make it can i update its code or there are another way to do it.

#18446 report it
Rajith R at 2014/10/30 02:55am
@Mariaczi+PL

currently its not .

I think you can easily rewrite it to YII 2

#18401 report it
Mariaczi+PL at 2014/10/24 08:08am
Compatible with Yii 2?

Is it or isn't it ?

#18365 report it
Rajith R at 2014/10/21 05:17am
@zabaleta10

When/Where you got this error ?

#18335 report it
zabaleta10 at 2014/10/18 01:20am
how to fix

*** failed to apply m110810_162301_userTimestampFix (time: 0.404s)

#17986 report it
Rajith R at 2014/08/22 01:52am
@begemotik

Great :-)

#17976 report it
begemotik at 2014/08/20 04:40am
Tutorial

Hi,
I've written an extensive tutorial on how to install both hoauth and Yii-user, and modify according to your needs.
I'm hoping this will help someone. You can find the article here.

#17867 report it
Rajith R at 2014/08/02 01:11am
@selorm

Thanks for the info. :-)

Leave a comment

Please to leave your comment.

Create extension
  • Yii Version: 1.1
  • License: New BSD License
  • Developed by: mishamx
  • Category: Auth
  • Votes: +268 / -20
  • Downloaded: 71,985 times
  • Created on: Feb 12, 2010
  • Last updated: Jun 11, 2012
  • Tags: user, module