Home > php教程 > php手册 > body text

php单一入口权限检查

WBOY
Release: 2016-06-13 10:47:25
Original
1902 people have browsed it

function  checkprive(){ 
                    $M= $_SESSION['prive_list'];  //模型权限 
    $A=$_SESSION['action'];       //操作权限 
    $UrlM=$_GET['m'];             //$_GET获取模型 
    $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(&#39;你没有该操作权限!&#39;);history.go(-1) </script>"); 
        return false; 
    }else { 
        exit( "<script>alert(&#39;你没有该模块权限!&#39;);history.go(-1) </script>"); 
        return false; 
    } 


摘自 chaojie2009的专栏

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!