Пример #1
0
 public function userLoginAction()
 {
     if (isset($_POST['username']) and isset($_POST['password'])) {
         if (User::userLogin($_POST['username'], $_POST['password'])) {
             $this->view->assign('username', $_POST['username']);
             $this->view->assign('password', $_POST['password']);
             $this->render('Home');
         } else {
             $this->render('Index');
             $this->render('Error');
         }
     } elseif (isset($_SESSION['UserID'])) {
         $User = User::getUserData($_SESSION['UserID']);
         $this->view->assign('username', $User->username);
         $this->render('Home');
     } else {
         $this->render('Index');
     }
 }
Пример #2
0
 public function getUserData($UserUid)
 {
     $options = array("UserID" => $UserUid);
     $User = User::find('all', $options);
     return $User[0];
 }