* userControl: refactor the unlock method.

This commit is contained in:
liugang
2023-11-27 10:45:34 +08:00
parent ef4ccc3c9a
commit a3d18d32ef
+3 -5
View File
@@ -673,20 +673,18 @@ class user extends control
}
/**
* 解锁一个用户。
* Unlock a user.
*
* @param int $userID
* @param string $confirm
* @access public
* @return void
*/
public function unlock($userID, $confirm = 'no')
public function unlock(int $userID)
{
if($confirm == 'no') return print(js::confirm($this->lang->user->confirmUnlock, $this->createLink('user', 'unlock', "userID=$userID&confirm=yes")));
$user = $this->user->getById($userID, 'id');
$this->user->cleanLocked($user->account);
return print(js::locate($this->session->userList ? $this->session->userList : $this->createLink('company', 'browse'), 'parent'));
return $this->send(array('result' => 'success', 'load' => true));
}
/**