Esempio n. 1
0
 public function beforeRun($resource, $action)
 {
     $this->dir = ADMIN_ROOT . '/moban/';
     $this->img = '/' . ADMIN_ROOT . '/static/';
     $session = Doo::session('Lua');
     $auth = $session->get('auth');
     if (empty($auth)) {
         $sets = Doo::cache('php')->get('loginset');
         if ($sets && $sets['cardit'] == 1) {
             $xxxx = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J');
             $nums = range(1, 9);
             shuffle($xxxx);
             shuffle($nums);
             $aaaa = $xxxx[0] . $nums[0];
             $bbbb = $xxxx[1] . $nums[1];
             $session->cardcode = $aaaa . '@' . $bbbb;
         }
         include Lua::display('login', $this->dir);
         exit;
     }
     $auth = empty($auth) ? array(0, '') : Lua::clean(explode("\t", Lua::authcode($auth, 'DECODE')), 1);
     $user = Lua::get_one("select * from lua_admin where uid='" . intval($auth[0]) . "' and password='******' and gid='1'");
     if (empty($user) || $user && $this->clientIP() != $user['loginip']) {
         $session->auth = '';
         Lua::admin_msg('操作提示', '请先登录', '/' . ADMIN_ROOT);
     }
     $rs = $this->acl()->process($user['perm'], $resource, $action);
     if ($rs) {
         return $rs;
     }
     $this->user = $user;
     $this->page = Lua::get_post('p') ? intval(Lua::get_post('p')) : 1;
     // 图片识别码, 借鉴自 supesite
     define('FILE_HASH', substr(md5($user['uid'] . '/' . time() . Lua::random(6)), 8, 16));
 }
Esempio n. 2
0
 public function index()
 {
     $action = Lua::get_post('action');
     $action = $action ? $action : 'home';
     if (method_exists($this, $action)) {
         $this->{$action}();
     } else {
         Lua::e404();
     }
 }
Esempio n. 3
0
 public function index()
 {
     $action = Lua::get_post('action');
     $action = $action ? $action : 'home';
     $rs = $this->acl()->process($this->user['perm'], '__member', $action);
     if ($rs) {
         return $rs;
     }
     if (method_exists($this, $action)) {
         $this->{$action}();
     } else {
         Lua::e404();
     }
 }
Esempio n. 4
0
 public function index()
 {
     $action = Lua::get_post('action');
     $action = $action ? $action : 'home';
     $rs = $this->acl()->process($this->user['perm'], '__category', $action);
     if ($rs) {
         return $rs;
     }
     if (method_exists($this, $action)) {
         $this->ch = Lua::get_one("select * from lua_channel where path='" . SYSNAME . "'");
         $this->{$action}();
     } else {
         Lua::e404();
     }
 }
Esempio n. 5
0
 public function index()
 {
     $action = Lua::get_post('action');
     $action = $action ? $action : 'home';
     $rs = $this->acl()->process($this->user['perm'], '__tpl', $action);
     if ($rs) {
         return $rs;
     }
     if (method_exists($this, $action)) {
         $this->tpl_path = PROJECT_ROOT . 'moban/';
         $this->{$action}();
     } else {
         Lua::e404();
     }
 }
Esempio n. 6
0
 public function index()
 {
     $action = Lua::get_post('action');
     $action = $action ? $action : 'home';
     $rs = $this->acl()->process($this->user['perm'], '__content', $action);
     if ($rs) {
         return $rs;
     }
     if (method_exists($this, $action)) {
         $lua = Lua::get('lua');
         if ($lua) {
             $this->lua = $lua;
             $this->lua_url = "&lua={$lua}";
         }
         $this->{$action}();
     } else {
         Lua::e404();
     }
 }
Esempio n. 7
0
 public function index()
 {
     $this->plugin_dir = PROJECT_ROOT . Doo::conf()->PROTECTED_FOLDER . 'plugin/';
     $action = Lua::get_post('action');
     $action = $action ? $action : 'home';
     if (method_exists($this, $action)) {
         $this->{$action}();
     } else {
         $file = $this->plugin_dir . $action . '/admin.php';
         if (!file_exists($file)) {
             Lua::admin_msg('提示信息', '你访问的插件不存在');
         }
         require_once $file;
         $oo = new $action();
         $oo->_set($this->plugin_dir, $this->dir, $this->img, $this->user);
         $c = Lua::get_post('c');
         $c = $c ? '_' . $c : '_home';
         if (method_exists($oo, $c)) {
             $oo->{$c}();
         } else {
             Lua::e404();
         }
     }
 }