- admin->registerNotice->caption;?>
-
-diff --git a/module/admin/control.php b/module/admin/control.php index 4b82e00a35..5f752879f3 100755 --- a/module/admin/control.php +++ b/module/admin/control.php @@ -77,101 +77,6 @@ class admin extends control return $this->send(array('result' => 'success')); } - /** - * 登记禅道社区。 - * Register zentao. - * - * @param string $from admin|mail - * @access public - * @return void - */ - public function register(string $from = 'admin') - { - if($_POST) - { - $response = $this->adminZen->registerByAPI(); - $response = json_decode($response); - if($response->result == 'fail') - { - $message = ''; - if(is_string($response->message)) - { - $message = $response->message; - } - else - { - foreach($response->message as $item) $message .= is_array($item) ? join('\n', $item) . '\n' : $item . '\n'; - } - $message = str_replace(array('', ''), '', $message); - - return $this->send(array('result' => 'fail', 'message' => $message)); - } - - $user = $response->data; - $data['community'] = $user->account; - $data['ztPrivateKey'] = $user->private; - - $this->loadModel('setting'); - $this->setting->deleteItems('owner=system&module=common§ion=global&key=community'); - $this->setting->deleteItems('owner=system&module=common§ion=global&key=ztPrivateKey'); - $this->setting->setItems('system.common.global', $data); - - $locate = true; - if($from == 'admin') $locate = inlink('index'); - if($from == 'mail') $locate = $this->createLink('mail', 'ztcloud'); - - return $this->send(array('result' => 'success', 'message' => $this->lang->admin->registerNotice->success, 'load' => $locate)); - } - - $this->adminZen->initSN(); - - $this->view->title = $this->lang->admin->registerNotice->caption; - $this->view->register = $this->adminZen->getRegisterInfo(); - $this->view->sn = $this->config->global->sn; - $this->view->from = $from; - $this->display(); - } - - /** - * 绑定禅道账号。 - * Bind zentao. - * - * @param string $from admin|mail - * @access public - * @return void - */ - public function bind(string $from = 'admin') - { - if($_POST) - { - $response = $this->adminZen->bindByAPI(); - $response = json_decode($response); - - if($response->result == 'fail') return $this->send($response); - - $user = $response->data; - $data['community'] = $user->account; - $data['ztPrivateKey'] = $user->private; - - $this->loadModel('setting')->deleteItems('owner=system&module=common§ion=global&key=community'); - $this->setting->deleteItems('owner=system&module=common§ion=global&key=ztPrivateKey'); - $this->setting->setItems('system.common.global', $data); - - $locate = true; - if($from == 'admin') $locate = inlink('index'); - if($from == 'mail') $locate = $this->createLink('mail', 'ztcloud'); - - return $this->send(array('result' => 'success', 'message' => $this->lang->admin->bind->success, 'load' => $locate)); - } - - $this->adminZen->initSN(); - - $this->view->title = $this->lang->admin->bind->caption; - $this->view->sn = $this->config->global->sn; - $this->view->from = $from; - $this->display(); - } - /** * 系统安全设置。 * System security Settings. diff --git a/module/admin/ui/register.html.php b/module/admin/ui/register.html.php deleted file mode 100644 index f3bad95d4f..0000000000 --- a/module/admin/ui/register.html.php +++ /dev/null @@ -1,157 +0,0 @@ - - * @package admin - * @link https://www.zentao.net - */ -namespace zin; - -$canBind = hasPriv('admin', 'bind'); - -$account = zget($config->global, 'community', ''); -if($account == 'na') $account = ''; - -$buildCaptchRow = function($type) : node -{ - global $lang; - return formRow - ( - formGroup - ( - setClass('w-1/2'), - set::label($lang->user->$type), - set::required(true), - inputGroup - ( - input - ( - set::name($type) - ), - span - ( - setClass('input-group-btn'), - button - ( - on::click("sendCaptcha(event, '{$type}')"), - setClass('btn'), - set(array('data-url' => inlink('ajaxSendCode', "type={$type}"))), - $lang->admin->getCaptcha - ) - ) - ) - ), - formGroup - ( - setClass('w-1/2'), - set::label($lang->admin->captcha), - set::name("{$type}Code"), - set::required(true) - ) - ); -}; - -$buildHidden = function($sn, $siteName): array -{ - $items[] = input - ( - set::type('hidden'), - set::name('sn'), - set::value($sn) - ); - $items[] = input - ( - set::type('hidden'), - set::name($siteName), - set::value(common::getSysURL()) - ); - return $items; -}; - -div -( - setClass('flex'), - col - ( - setClass($canBind ? 'pr-2 w-1/2' : 'w-full'), - formPanel - ( - setClass('w-full'), - set::actions(array('submit')), - set::title($lang->admin->registerNotice->common), - set::submitBtnText($lang->admin->registerNotice->submit), - formGroup - ( - set::label($lang->user->account), - set::name('account'), - set::placeholder($lang->admin->registerNotice->lblAccount), - set::required(true) - ), - formGroup - ( - set::label($lang->user->realname), - set::name('realname'), - set::required(true) - ), - formGroup - ( - set::label($lang->user->company), - set::name('company'), - set::value($register->company), - set::required(true) - ), - empty($config->isINT) ? $buildCaptchRow('mobile') : null, - $buildCaptchRow('email'), - formGroup - ( - set::label($lang->user->password), - set::control('password'), - set::name('password1'), - set::placeholder($lang->admin->registerNotice->lblPasswd), - set::required(true) - ), - formGroup - ( - set::label($lang->user->password2), - set::control('password'), - set::name('password2'), - set::required(true) - ), - $buildHidden($sn, 'bindSite') - ) - ), - $canBind ? col - ( - setClass('pl-2 w-1/2'), - formPanel - ( - setClass('w-full'), - set::actions(array('submit')), - set::title($lang->admin->registerNotice->bind), - set::url(inlink('bind', "from={$from}")), - set::submitBtnText($lang->admin->bind->submit), - formGroup - ( - setClass('w-1/2'), - set::label($lang->user->account), - set::name('account'), - set::value($account), - set::required(true) - ), - formGroup - ( - setClass('w-1/2'), - set::label($lang->user->password), - set::control('password'), - set::name('password'), - set::required(true) - ), - $buildHidden($sn, 'site') - ) - ) : null -); - -render(); diff --git a/module/admin/view/register.html.php b/module/admin/view/register.html.php deleted file mode 100755 index 6c74e7aca8..0000000000 --- a/module/admin/view/register.html.php +++ /dev/null @@ -1,171 +0,0 @@ - - * @package admin - * @version $Id: view.html.php 2568 2012-02-09 06:56:35Z shiyangyangwork@yahoo.cn $ - * @link https://www.zentao.net - */ -?> - - -