PhpGACL Chinese manual (11) usage

Source: Internet
Author: User
PhpGACL Chinese manual (11) usage use phpGACL basic usage in your application this example shows the basic usage of phpGACL in your program. It uses the ADOdb data abstraction layer and uses a simple phpGACL Chinese manual (11)
Use in your applicationPhpGACL Basic usage

This example shows the basic usage of phpGACL in your program. It uses the ADOdb data abstraction layer and uses a simple method to ensure the legitimacy of database login.

// Include basic ACL api
Include ('phpgacl/gacl. class. php ');
$ Gacl = new gacl ();

$ Username = $ db-> quote ($ _ POST ['username']);
$ Password = $ db-> quote (md5 ($ _ POST ['password']);
$ SQL = 'SELECT name FROM users WHERE name = ';
$ SQL. = $ username. 'AND password ='. $ password;
$ Row = $ db-> GetRow ($ SQL); if ($ gacl-> acl_check ('system', 'login', 'user ', $ row ['name']) {
??? $ _ SESSION ['username'] = $ row ['name'];
???? Return true;
}
Else return false;

You can see that only the acl_check () function is called here. What does it do? It

  • Check the ARO object from the ARO section "user" $ row ['name']
  • Compare the ACO object "login" from the ACO section "system"
Advanced usage

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.