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.
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
.
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)
Auto-register: Interesting idea
A very interesting idea this extension provides - if user is not found in the DB, it's account will be automatically created without requiring him to go through standard registration process. Good job!
Auto-register for intranets
Hi Trejder
I hope you didn't overlook the scenario: corporate intranet as opposed to the wide open internet. Neat.
I really like this simple login
As a beginner, I really like it. It won't confuse me, and the structure is very clear.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.