simplelogin A simplified user authentication & registration module

  1. Documentation
  2. Change Log

On the internet, we usually register a user who has a valid e-mail account. You may use yii skeleton application by Jonah for this purpose.

On the other hand, especially in a specific project in a certain corporation, user authentication can be simplified. For this purpose, I have built a simplified user authentication module named 'simpleLogin'.

This module enables the registration of an unknown user immediately. It is very useful for project members who can be trusted in the above situation.

screenshot

Resources

Documentation

Requirements
  • Yii 1.1 or above
Installation example for skeleton application
  • Make a skeleton application by using yiic.
    $ cd {yiiPath}/demos
    $ ../framework/yiic webapp {appName}
    $ cd {appName}/protected
    $ {textEditor} config/main.php 
    
  • Edit the configuration file so as to enable the module and the corresponding database.
'components'=>array(
  ...
        'user'=>array(
  ...
           'loginUrl'=>array('simpleLogin'),
        ),
    ),
  ...
    'modules'=>array(
        'simpleLogin',
    ),
  ...
  • Extract the release file under protected.

Note: The module is stored under protected/modules/.

  • Make the database.
    $ rm data/testdrive.db
    $ sqlite3 data/testdrive.db <modules/simleLogin/schema.sqlite.sql
    
  • Change the permission of the database.
    $ chmod 777 data
    $ chmod 666 data/testdrive.db
    
Usage

See the following code example of views/layouts/main.php. You can replace existing login functionality as below.

-      array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
+     array('label'=>'SimpleLogin', 'url'=>array('/simpleLogin'), 'visible'=>Yii::app()->user->isGuest),
+     array('label'=>'Delete', 'url'=>array('/simpleLogin/Default/delete'), 'visible'=>!Yii::app()->user->isGuest),
      array('label'=>'Logout', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)

Change Log

June 23, 2009
  • Initial release (r3)
    June 24, 2009
  • Added user delete functionality (r4)
    June 25, 2009
  • Added listing functionality for registered users (r5)
    August 5, 2009
  • Added default user->loginUrl in 'config/main.php' in the documentation. No need to update the extension.
    August 6, 2009
  • Fixed returnUrl bug (r8)
    August 26, 2010
  • Adapted to current skeleton application (r16)
2 0
7 followers
2 930 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Auth
Tags:
Developed by: mocapapa
Created on: Jun 24, 2009
Last updated: 13 years ago

Downloads

show all