Beispiel #1
0
 public function __construct()
 {
     parent::__construct();
     if (!UserUtil::getUserId()) {
         ResponseUtil::redirect(UrlUtil::createBackendUrl('login'));
     }
     $controller = strtolower($this->router->class);
     $method = strtolower($this->router->method);
     if (UserUtil::isShopKeeper()) {
         if (!array_key_exists($controller, $this->shopKeeperPermissions)) {
             $this->message('你没有权限执行本步骤!');
         }
         $methods = $this->shopKeeperPermissions[$controller];
         if ($methods == '*') {
             return true;
         } else {
             if (!in_array($method, $methods)) {
                 $this->message('你没有权限执行本步骤!');
             } else {
                 return true;
             }
         }
     }
 }