Пример #1
0
 public function index()
 {
     $data['title'] = 'page_metatitle';
     $data['description'] = 'page_metadescription';
     $data['keywords'] = 'page_metakeywords';
     $view = new View();
     //$view->setLazyRender();
     //$this->view->debug(true);
     $view->add_link('js', SITE_ASSETS . 'pages/home.js');
     $view->set_layout(null);
     $view->render('home/tpl_home', $data);
 }
Пример #2
0
 /**
  * Default action
  *
  * Ez a metódus jeleníti meg a bejelentkezési oldalt!
  * Ha a bejelentkezési adatok helyesek, bejelentkezteti a felhasználót	
  */
 public function index()
 {
     // ha elküldték a POST adatokat
     if ($this->request->has_post()) {
         $username = $this->request->get_post('user_name');
         $password = $this->request->get_post('user_password');
         $rememberme = $this->request->has_post('user_rememberme');
         // $auth = Auth::instance();
         $auth = DI::get('auth');
         $login_successful = $auth->login($username, $password, $rememberme);
         // login status vizsgálata
         if ($login_successful) {
             // Sikeres bejelentkezés
             $this->response->redirect('admin');
         } else {
             // hibaüzenetek visszaadása
             foreach ($auth->getError() as $value) {
                 Message::set('error', $value);
             }
             // visszairányítás
             $this->response->redirect('admin/login');
         }
     }
     // bejelentkezés cookie-val
     $auth = DI::get('auth');
     $login_status = $auth->loginWithCookie();
     if ($login_status) {
         $this->response->redirect('admin');
     } else {
         foreach ($auth->getError() as $value) {
             Message::set('error', $value);
         }
         // cookie törlése
         $auth->deleteCookie();
     }
     $view = new View();
     $view->set_layout(null);
     $view->render('login/tpl_login');
 }
Пример #3
0
 public function index()
 {
     $view = new View();
     $view->set_layout(null);
     $view->render('error/404');
 }