FuelPHP â SimpleAuthãè¨å®ãã
SimpleAuthã®ããã±ã¼ã¸ãè¨å®ãã¾ãã
/fuel/app/config/
[config.php]
'packages' => array(
'orm',
'auth',
),
Â
/fuel/packages/auth/config/auth.phpãsimpleauth.phpã/fuel/app/config/ã«ã³ãã¼ãã¾ãã
/fuel/app/config/
[auth.php]
'salt' => 'saltã®å¤',
Â
[simpleauth.php]
Â
'login_hash_salt' => 'saltã®å¤ï¼ä¸è¨ã¨ã¯å¥ã®å¤ã«ãã¦ããï¼',
/**
* Groups as id => array(name => , roles => )
*/
'groups' => array(
-1 => array('name' => 'Banned', 'roles' => array('banned')),
0 => array('name' => 'Guests', 'roles' => array()),
1 => array('name' => 'Users', 'roles' => array('user')),
50 => array('name' => 'Moderators', 'roles' => array('user', 'moderator')),
100 => array('name' => 'Administrators', 'roles' => array('user', 'moderator', 'admin')),
),
Â
ã¦ã¼ã¶ã¼ç®¡çç»é¢ãä½æãã¾ããï¼èªè¨¼ãã¼ã¸ï¼
Â
php oil g admin user username:varchar[50] password:string group:int email:string last_login:int login_hash:string profile_fields:text
php oil refine migrateÂ
Â
ãã°ã¤ã³ã¦ã¼ã¶ã¼ãä½æãã¾ãã
Â
php oil console
Auth::create_user('ã¦ã¼ã¶ã¼ï¼©ï¼¤', 'ãã¹ã¯ã¼ã', 'ã¡ã¼ã«ã¢ãã¬ã¹', 100);
Â