* [perf] remove admin register page.
This commit is contained in:
@@ -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('<strong>', '</strong>'), '', $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.
|
||||
|
||||
Reference in New Issue
Block a user