The saveAccessListdump ($ _ SESSION) in RBAC is empty. Please advise

Source: Internet
Author: User
Provides various official and user-released code examples. For code reference, you are welcome to learn about saveAccessList dump ($ _ SESSION) in RBAC.
Array (size = 5)
'Code' => string '75c084449d4e710f45f1bfac493aeaea '(length = 32)
'Username' => string 'xiao5' (length = 5)
'Id' => string '10' (length = 2)
'Authid' => string '10' (length = 2)
'_ ACCESS_LIST' =>
Array (size = 1)
'Home' =>
Array (size = 2)
'Rbac '=>
Array (size = 2)
...
'Article' =>
Array (size = 1)
...


Public function checkLogin (){
$ Username = $ _ POST ['username'];
$ Password = md5 ($ _ POST ['Password']);
$ Code = $ _ POST ['code'];
If ($ _ POST ['code']! ==$ Code ){
$ This-> error ('the verification code is incorrect! ', U ('login/Index '));
}
$ User = M ('user ');
$ Where ['username'] = $ username;
$ Where ['Password'] = $ password;
$ Arr = $ user-> where ($ where)-> find ();
If ($ arr ){
$ _ SESSION ['username'] = $ username;
$ _ SESSION ['id'] = $ arr ['id'];
$ _ SESSION [C ('user _ AUTH_KEY ')] = $ arr ['id'];
If ($ _ SESSION ['username'] = C ('rbac _ SUPERADMN ')){
$ _ SESSION [C ('admn _ AUTH_KEY ')] = true;
}
Import ('org. Util. RBAC ');
RBAC: saveAccessList ();
// Dump ($ _ SESSION );
$ This-> success ('user logon succeeded ', U ('index/Index '));
} Else {
$ This-> error ('account or password is incorrect! ', U ('login/Index '));
}
}



'Rbac _ superadmin' => 'admin', // super Administrator name
'Admin _ AUTH_KEY '=> 'superadmin', // super administrator identification
'User _ AUTH_ON '=> true, // whether to enable verification
'User _ AUTH_TYPE '=> 1, // verification type (1 logon verification 2 Real-time verification)
'User _ AUTH_KEY '=> 'authid', // USER ID
'Not _ AUTH_MODULE '=> 'index', // The authentication module is NOT required.
// 'Not _ AUTH_ACTION '=> '', // action method without verification
'User _ AUTH_MODEL '=> 'user ',
'Rbac _ ROLE_TABLE '=> 'tp _ role', // role table name
'Rbac _ USER_TABLE '=> 'tp _ role_user', // role and user's intermediate table name
'Rbac _ ACCESS_TABLE '=> 'tp _ access', // permission table name
'Rbac _ NODE_TABLE '=> 'tp _ node', // node table name

Qq image 201408011502.16.jpg (83.94 KB download: 13 times)

AD: truly free, domain name + VM + enterprise mailbox = 0 RMB

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.