Esempio n. 1
0
 public function actionModerate($id = '')
 {
     $moderate = $this->user->isAllowed(self::RES, 'moderate');
     if (empty($id)) {
         throw new \Nette\Application\BadRequestException();
     }
     if (!$moderate) {
         $this->goHome();
     }
     $user = $this->userManager->getUserData($id);
     if (!$user) {
         $this->goHome('Neexistující uživatel');
     }
     $this->userMod = $user;
     $this->template->combinatedName = \App\Helper\Helper::combineUserName($user);
 }
Esempio n. 2
0
 /**
  * Change mail is not succesful
  * @param \Nette\Security\IIdentity $user
  */
 public function changeMailFail(\Nette\Security\IIdentity $user)
 {
     $user->mail = $user->oldMail;
     $name = Helper::combineUserName($user, false);
     $checkCode = $this->genCheckCode('checkCode');
     (new SendMailManager())->sendNewMailCode($user->mail, $name, $checkCode, false);
     $this->updateUserDat($user->id, ['checkCode' => $checkCode, 'mail' => $user->oldMail]);
 }
Esempio n. 3
0
 /**
  * Logout user
  */
 public function actionOut($request = '')
 {
     $this->notLoggedUser();
     $this->user->logout();
     $this->goHome(Helper::combineUserName($this->user->getIdentity()->data) . ' úspěšně odhlášen', 'Homepage:default', [], 'success', $request ? $request : false);
 }