* finish task #2246.

* code task #2252.
This commit is contained in:
wangyidong
2015-05-12 11:14:46 +08:00
parent 9a0dda6d07
commit ff8ac1f30f
19 changed files with 457 additions and 20 deletions
+9 -7
View File
@@ -532,16 +532,13 @@ class user extends control
* @access public
* @return void
*/
public function delete($userID, $confirm = 'no')
public function delete($userID)
{
$user = $this->user->getByID($userID);
if(strpos($this->app->company->admins, ",{$this->app->user->account},") !== false and $this->app->user->account == $user->account) return;
if($confirm == 'no')
{
die(js::confirm($this->lang->user->confirmDelete, $this->createLink('user', 'delete', "userID=$userID&confirm=yes")));
}
else
if($_POST)
{
if(md5($this->post->verifyPwd) != $this->app->user->password) die(js::alert($this->lang->user->error->verifyPwd));
$this->user->delete(TABLE_USER, $userID);
/* if ajax request, send result. */
@@ -559,8 +556,10 @@ class user extends control
}
$this->send($response);
}
die(js::locate($this->session->userList, 'parent'));
die(js::locate($this->session->userList, 'parent.parent'));
}
$this->display();
}
/**
@@ -657,6 +656,9 @@ class user extends control
/* Keep login. */
if($this->post->keepLogin) $this->user->keepLogin($user);
/* Check password. */
if(isset($this->config->safe->mode) and $this->user->pwdLevel($password) < $this->config->safe->mode) echo js::alert($this->lang->user->weakPwd);
/* Go to the referer. */
if($this->post->referer and
strpos($this->post->referer, $loginLink) === false and