コード例 #1
0
 public function login($user_id)
 {
     $this->unbanip();
     $user = new User();
     $user->loadFromId($user_id);
     Session::Add(self::SESSION_USER_ID, $user_id);
     Session::Add(self::SESSION_USER_EMAIL, $user->getEmail());
     Session::Add(self::SESSION_LOGGED, TRUE);
 }
コード例 #2
0
ファイル: manage.php プロジェクト: Devenet/MoodPicker
                 if (!$u->hasStillUser()) {
                     throw new \Exception('You can not delete the only remaining user.');
                 }
                 if (!$u->delete()) {
                     throw new \Exception('Unable to delete the user. Please contact the webmaster.');
                 }
                 $this->removeExtendedToken($this->request(4));
                 header('Location: ' . $this->URL('manage/users?deleted'));
                 exit;
             } catch (\Exception $e) {
                 $this->assign('form_error', $e->getMessage());
             }
         }
         $this->page('manage/users/delete');
         $this->getToken();
         $this->assign('user', array('id' => $u->getId(), 'email' => $u->getEmail()));
         break;
     case NULL:
         $this->page('manage/users');
         $this->getExtendedToken();
         $this->assign('users', User::getUsers());
         if (isset($_GET['created'])) {
             $this->assign('message', 'The user has been created.');
         } else {
             if (isset($_GET['deleted'])) {
                 $this->assign('message', 'The user has been deleted.');
             }
         }
         break;
 }
 break;