Php single entry permission check _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
Php single entry permission check. Functioncheckprive () {$ M $ _ SESSION [prive_list]; model permission $ A $ _ SESSION [action]; Operation permission $ UrlM $ _ GET [m]; $ _ GET model $ UrlA $ _ GET [a]; $ _ GET operation if (strp function checkprive (){
$ M = $ _ SESSION ['prive _ list']; // model permission
$ A = $ _ SESSION ['action']; // operation permission
$ UrlM = $ _ GET ['M']; // $ _ GET model
$ UrlA = $ _ GET ['A']; // $ _ GET
If (strpos ($ M ['M'], $ UrlM )! = False | $ M ['M'] = 'all '){
If (strpos ($ A ['A'], $ UrlA )! = False | $ A ['A'] = 'all') return true;
Exit ("script" alert ('you do not have this operation permission! '); History. go (-1) script ");
Return false;
} Else {
Exit ("script" alert ('you do not have permission for this module! '); History. go (-1) script ");
Return false;
}
}

From chaojie2009

Http://www.bkjia.com/PHPjc/478389.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/478389.htmlTechArticlefunction checkprive () {$ M =$ _ SESSION [prive_list]; // model permission $ A =$ _ SESSION [action]; // operation permission $ UrlM =$ _ GET [m]; // $ _ GET model $ UrlA =$ _ GET [a]; // $ _ GET operation if (strp...

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.