Пример #1
0
 public function doUlozitUdaje()
 {
     $pars = ['orion_login' => $this->user->orion_login, 'nickname' => trim($this->getParam("nickname", INPUT_POST)), 'is_student' => !empty($this->getParam("is_student", INPUT_POST))];
     if (Tables\User::update($this->pdo, $pars)) {
         $this->message->success("Vaše údaje byly zpracovány a uloženy");
     } else {
         $this->message->danger("Při ukládání vašich údajů nastala chyba.");
     }
     $this->redirectPars("uzivatel", $this->getDefaultAction());
 }
Пример #2
0
 /**
  * 
  * @param \PDO $pdo
  * @param String $orion_login
  * 
  * @return UserExtended
  */
 public function login($orion_login)
 {
     $user = UserExtended::fetch($this->pdo, $orion_login);
     if (!$user) {
         if (!User::insert($this->pdo, $orion_login)) {
             return null;
         } else {
             $user = UserExtended::fetch($this->pdo, $orion_login);
             $user->loginStatus = self::LOGIN_NEW;
         }
     } else {
         $user->loginStatus = self::LOGIN_SUCCESS;
     }
     $_SESSION['user'] = $orion_login;
     return $user;
 }
Пример #3
0
 private function mockAllUserGameEntry()
 {
     $allEntry = new Views\GameTypeExtended();
     $allEntry->game_type_id = self::ALL_USERS_GT_ID;
     $allEntry->game_name = 'Všichni uživatelé';
     $allEntry->subscribed_users = Tables\User::count($this->pdo);
     return $allEntry;
 }