public function UserSetting() { $Users = new UsersModule(); $UserID = _intval($this->_POST['UserID'], true); if ($this->_POST['Action'] == 'ModifyGroup') { if (!$UserID) { $this->__Message('未指定目标用户!'); exit; } $UserDetail = $Users->GetDetail($UserID); if (!$UserDetail) { $this->__Message('目标用户不存在!'); exit; } $NewUserGroupID = _intval($this->_POST['UserGroupID'], true); if ($Users->UpdateUserGroupID($UserID, $NewUserGroupID)) { $this->__Message('修改用户所属用户组成功!', UrlRewriteSimple('Users', 'ManagerProfile', true) . '&UserID=' . $UserID, '返回用户资料'); } else { $this->__Message('修改用户所属用户组失败!'); } exit; } if (!$UserID) { echo JsonMessage('error', '未指定目标用户!'); exit; } $UserDetail = $Users->GetDetail($UserID); if (!$UserDetail) { echo JsonMessage('error', '目标用户不存在!'); exit; } if ($this->_POST['Action'] == 'Lock') { if ($Users->Lock($UserID)) { echo JsonMessage('succ', '锁定用户成功!'); } else { echo JsonMessage('error', '锁定失败!'); } exit; } elseif ($this->_POST['Action'] == 'Open') { if ($Users->UnLock($UserID)) { echo JsonMessage('succ', '启用用户成功!'); } else { echo JsonMessage('error', '启用用户失败!'); } exit; } elseif ($this->_POST['Action'] == 'InitPassword') { $newPassword = $Users->CreatePassword('abc123', $UserDetail['UserName'], $UserDetail['Hashcode']); if ($Users->NewPassword($UserID, $newPassword)) { echo JsonMessage('succ', '初始化用户密码成功!'); } else { echo JsonMessage('error', '初始化用户密码失败!'); } exit; } else { echo JsonMessage('error', '非法操作!'); } }