/** * Reset the password * * @return void */ public function resetPassword() { global $g_BizSystem; $recArr = $this->readInputs(); $this->setActiveRecord($recArr); if (count($recArr) == 0) { return; } try { $this->ValidateForm(); if ($this->ValidateEmail($recArr['username'], $recArr['email'])) { //Init user profile for event logging $profile = $g_BizSystem->InituserProfile($recArr['username']); } else { return; } //generate pass_token $token = $this->GenerateToken($profile); if ($token) { //event log $eventlog = BizSystem::getService(EVENTLOG_SERIVCE); $logComment = array($username, $_SERVER['REMOTE_ADDR']); $eventlog->log("USER_MANAGEMENT", "MSG_GET_PASSWORD_TOKEN", $logComment); //send user email $emailObj = BizSystem::getService(USER_EMAIL_SERIVCE); $emailObj->UserResetPassword($token['Id']); BizSystem::SessionContext()->destroy(); //goto URL $this->processPostAction(); } } catch (ValidationException $e) { $this->processFormObjError($e->m_Errors); return; } }
public function Logout() { // destroy all data associated with current session: BizSystem::SessionContext()->destroy(); // Redirect: if (isset($_GET['redirect_url'])) { $url = $_GET['redirect_url']; } else { $url = "login"; } header("Location: {$url}"); exit; }
public function Logout() { global $g_BizSystem; $eventlog = $g_BizSystem->GetService(EVENTLOG_SERIVCE); $profile = $g_BizSystem->getUserProfile(); $logComment = array($profile["username"], $_SERVER['REMOTE_ADDR']); $eventlog->log("LOGIN", "MSG_LOGOUT_SUCCESSFUL", $logComment); // destroy all data associated with current session: BizSystem::SessionContext()->destroy(); //clean cookies setcookie("SYSTEM_SESSION_USERNAME", null, time() - 100, "/"); setcookie("SYSTEM_SESSION_PASSWORD", null, time() - 100, "/"); // Redirect: header("Location: login"); }