forked from steinkel/usermin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
96 lines (72 loc) · 3.22 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---------------------------------------------------
| Usermin is a simple auth plugin for cakephp 2.0.x |
---------------------------------------------------
And it's done using the new cakephp 2.0.x AuthComponent
ALPHA Version
Usermin is a CakePHP 2.0 User Management System,
Authentication & Authorization
Allows role based user management plug & play
It's based on jedt/SparkPlug plugin
INSTALLATION
------------
1. Download the latest version or use git to keep the plugin up to date
cd yourapp/app/Plugin
git clone git://github.com/steinkel/usermin.git Usermin
2. Schema import (use your favorite sql tool to import the schema)
yourapp/app/Plugin/Usermin/Config/Schema/dump.sql
3. Configure the component in your AppController class
Your yourapp/app/Controller/AppController.php should look like this:
<?php
class AppController extends Controller {
public $components = array(
'Auth' => array(
'loginAction' => array('plugin' => 'usermin', 'controller' => 'umusers', 'action' => 'login'),
//'loginRedirect' => array('controller' => 'pages', 'action' => 'display', 'loggedin'),
//'logoutRedirect' => array('controller' => 'pages', 'action' => 'display', 'loggedout'),
// debug param true prints extra auth debug to the debug.log file. Disable the debug in production
'authorize' => array('Usermin.Role' => array('debug' => true, 'authorizeAll' => false)),
'authenticate' => array('Form' => array('userModel' => 'Usermin.Umuser', 'fields' => array('username' => 'username', 'password' => 'password'))
)
)
);
...
4. Enable Plugin in your bootstrap.php
yourapp/app/Config/bootstrap.php should include this line
// load Usermin plugin and apply plugin routes. Keep all the other plugins you are using here
CakePlugin::loadAll(array(
'Usermin' => array('routes' => true),
));
5. Adjust plugin configuration
Change /app/Plugin/Usermin/Config/usermin.php (parameters are explained there) to suit your needs.
Change /app/Plugin/Usermin/Config/routes.php (parameters are explained there) to suit your needs.
6. Create a default superadmin user and password
There is a cake shell for doing it :) you only need to
6.1 go to folder yourapp/app
6.2 run the usermin init shell
$ Console/cake usermin.usermin init
ALL DONE !
TODO
----
user registration (email validation link)
user myaccount
allowed by owner ?
user overrides
user / role tree ?
permission inheritance
permission calculated per user ?
rule cache
idea: random prefix for the database connection and shell for install
database connection (as seen in authake)
ajax login ?
facebook / twitter / other login
remember me cookies and logintokens
DONE
----
* routes algorithm
console shell for init
authentication using auth custom class
admin backend (dashboard, default routes for include used cakeplugin for loading routes)
user creation sends email
configuration file
simple routes and controller algorithm
define permissions using code instead of database -- better use only database