public function signIn() { $signedUser = $this->app->user(); // auth if (Util\Auth::isAuth($signedUser)) { header('Location: /'); exit; } // action $form = new \Rebond\Core\User\Form($signedUser); $form->signIn(); if (Util\Auth::isAuthorized($form->getModel(), 'member')) { session_write_close(); header('Location: /'); exit; } $tpl = new Util\Template(Util\Template::MODULE, ['app', 'User']); $tpl->set('item', $form); return $tpl->render('sign-in'); }
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'); }