Example #1
0
 /**
  * Saves the area
  */
 protected function OnSuccess()
 {
     $action = $this->user->Exists() ? Action::Update() : Action::Create();
     $this->user->SetName($this->Value('Name'));
     $this->user->SetEMail($this->Value('EMail'));
     $this->user->SetLanguage(new Language($this->Value('Language')));
     if ($this->CanChangeIsAdmin()) {
         $this->user->SetIsAdmin((bool) $this->Value('IsAdmin'));
     }
     $this->SavePassword();
     $this->user->Save();
     $logger = new Logger(self::Guard()->GetUser());
     $logger->ReportUserAction($this->user, $action);
     Response::Redirect(BackendRouter::ModuleUrl(new UserList()));
 }
Example #2
0
 /**
  * Loads the currently active accessor into this instance
  * @return bool
  */
 function LoadCurrent()
 {
     $this->user = null;
     $userID = null;
     if (isset($_SESSION[self::$sessionParam])) {
         $userID = $_SESSION[self::$sessionParam];
     }
     if ($userID) {
         $user = new User($userID);
         if ($user->Exists()) {
             $this->user = $user;
         }
     }
     return $this->user !== null;
 }