示例#1
0
 /**
  * 
  */
 function run()
 {
     $control = new control($this->get, $this->post);
     if ($this->querystring) {
         $control->hsetcookie('querystring', $this->querystring, 3600);
     }
     $method = $this->get[1];
     $exemption = true;
     if ('hd' != substr($method, 0, 2)) {
         $exemption = false;
         $method = 'do' . $this->get[1];
     }
     if ($control->user['uid'] == 0 && $control->setting['close_website'] === '1' && strpos('dologin,dologout,docheckusername,docheckcode,docode', $method) === false) {
         exit($control->setting['close_website_reason']);
     }
     if (method_exists($control, $method)) {
         $regular = $this->get[0] . '-' . $this->get[1];
         $querystring = implode('-', $this->get);
         $isadmin = 'admin' == substr($this->get[0], 0, 5);
         if ($exemption || $control->checkable($querystring) || $control->checkable($regular)) {
             $control->{$method}();
         } else {
             $control->message($regular . $control->view->lang['refuseAction'], '', $isadmin);
         }
     } else {
         $this->notfound('method "' . $method . '" not found!');
     }
 }