Beispiel #1
0
 public function sign_in()
 {
     // auth
     if (Auth::isAdminAuthorized($this->signedUser)) {
         Session::redirect('/');
     }
     // action
     $form = new \Rebond\Core\User\Form($this->signedUser);
     $form->signIn();
     if (Auth::isAdmin($form->getModel())) {
         Session::redirect('/');
     }
     if (Auth::isAuth($form->getModel())) {
         Session::setAndRedirect('siteError', Lang::lang('accessNonAuthorized'), 'http://' . \Rebond\Config::getPath('siteUrl'));
     }
     // view
     $this->setTpl();
     // main
     $tplMain = new Template(Template::MODULE, ['core', 'user']);
     $tplMain->set('item', $form);
     // master
     $this->tplMaster->set('column1', $tplMain->render('sign-in'));
     $this->tplMaster->set('jsLauncher', 'profile');
     return $this->tplMaster->render('tpl-signin');
 }