コード例 #1
0
ファイル: ForgetPassForm.php プロジェクト: que273/siremis
 /**
  * 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;
     }
 }
コード例 #2
0
ファイル: LogoutView.php プロジェクト: Why-Not-Sky/cubi-ng
 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;
 }
コード例 #3
0
ファイル: LogoutView.php プロジェクト: que273/siremis
 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");
 }