public function __construct(Routing $routing, MyPDO $pdo = null, View $view = null, Layout $layout = null, UserLogged $user_logged = null)
 {
     parent::__construct($routing, $pdo, $view, $layout, $user_logged);
     #user harus sudah login
     if (!$this->user_logged->check_is_logged()) {
         redirect_to('login');
     }
 }
Beispiel #2
0
 public function __construct(Routing $routing, MyPDO $pdo = null, View $view = null, Layout $layout = null, UserLogged $user_logged = null)
 {
     parent::__construct($routing, $pdo, $view, $layout, $user_logged);
     #cek jika sudah login
     if ($this->user_logged->check_is_logged()) {
         #redirect ke halaman profile
         redirect_to(sprintf('%s/profile', $this->user_logged->get('level')));
     }
 }
 public function __construct(Routing $routing, MyPDO $pdo = null, View $view = null, Layout $layout = null, UserLogged $user_logged = null)
 {
     parent::__construct($routing, $pdo, $view, $layout, $user_logged);
     #user harus sudah login
     if (!$this->user_logged->check_is_logged()) {
         redirect_to('login');
     }
     #user harus sudah login sebagai siswa
     if ($this->user_logged->get_level() != 'siswa') {
         redirect_to('blok-akses');
     }
 }