时间:2021-07-01 10:21:17 帮助过:3人阅读
- <!--
- Code highlighting produced by Actipro CodeHighlighter (freeware)
- http://www.CodeHighlighter.com/
- --><!--?php
- class IndexAction extends YouYaX
- {
- public function index()
- {
- header("Content-type: text/html; charset=utf-8");
- //登陆的步骤省略
- $user="我是游客";
- //$user="我是管理员";
- $data=$this--->find("user","string","user='".$user."'");
- $group_tmp=$data["groupid"];
- $this->show($group_tmp);
- }
- public function show($group_tmp){
- $list=$this->find("model","string","func='show'");
- $sql="select * from model where func='show' and find_in_set(".$group_tmp.",".$list['group'].")";
- if(mysql_num_rows(mysql_query($sql))){
- echo "权限通过";
- //处理下面的内容
- }else{
- echo "没有权限";
- }
- }
- public function showAll($group_tmp){
- $list=$this->find("model","string","func='showAll'");
- $sql="select * from model where func='showAll' and find_in_set(".$group_tmp.",".$list['group'].")";
- if(mysql_num_rows(mysql_query($sql))){
- echo "权限通过";
- //处理下面的内容
- }else{
- echo "没有权限";
- }
- }
- }
- ?>