diff --git a/config/zentaopms.php b/config/zentaopms.php index 97041891c9..ad13b06eb5 100644 --- a/config/zentaopms.php +++ b/config/zentaopms.php @@ -223,6 +223,7 @@ $config->openMethods[] = 'user.login'; $config->openMethods[] = 'user.refreshrandom'; $config->openMethods[] = 'user.reset'; $config->openMethods[] = 'user.resetpassword'; +$config->openMethods[] = 'admin.register'; /* 登录用户可以使用的方法。The methods that can be used by the logged users. */ $config->logonMethods = array(); diff --git a/module/admin/control.php b/module/admin/control.php index 0d683c7af3..7b5ea844ea 100755 --- a/module/admin/control.php +++ b/module/admin/control.php @@ -505,12 +505,22 @@ class admin extends control */ public function register() { + if($this->loadModel('user')->isLogon() && !$this->app->user->admin) + { + $this->locate(helper::createLink('user', 'deny', 'module=admin&method=register')); + } + $bindCommunity = $this->config->global->bindCommunity; $this->view->bindCommunity = $bindCommunity; if($bindCommunity) { + if(!$this->loadModel('user')->isLogon()) + { + $this->locate(helper::createLink('user', 'deny', 'module=admin&method=register')); + } + $agreeUX = $this->config->global->agreeUX; $bindCommunityMobile = $this->config->global->bindCommunityMobile; diff --git a/module/admin/model.php b/module/admin/model.php index a703f1e8ad..3d752f8fac 100755 --- a/module/admin/model.php +++ b/module/admin/model.php @@ -205,6 +205,8 @@ class adminModel extends model if(common::hasPriv($module, $method)) $menu['disabled'] = false; } + if(!$this->app->user->admin && $module . $method == 'adminregister') $menu['disabled'] = true; + $order = $menu['order']; $orders[$order] = $menuKey;