当前位置: 首页>>代码示例>>PHP>>正文


PHP LoginController类代码示例

本文整理汇总了PHP中LoginController的典型用法代码示例。如果您正苦于以下问题:PHP LoginController类的具体用法?PHP LoginController怎么用?PHP LoginController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了LoginController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: start

 public function start()
 {
     $renderView = new RenderView();
     $resultView = new ResultView();
     $addView = new AddView();
     $connectionDAL = new ConnectionDAL();
     $artistDAL = new ArtistDAL($connectionDAL);
     $songDAL = new SongDAL($connectionDAL, $artistDAL);
     $addModel = new AddModel($artistDAL, $songDAL);
     $loginModel = new LoginModel();
     $deleteModel = new DeleteModel($songDAL, $artistDAL);
     $searchModel = new SearchModel($deleteModel, $connectionDAL);
     $searchView = new SearchView($searchModel, $loginModel);
     $searchController = new SearchController($renderView, $searchView, $searchModel, $loginModel, $deleteModel, $resultView);
     $addController = new AddController($renderView, $addView, $addModel);
     $loginView = new LoginView();
     $loginController = new LoginController($renderView, $loginView, $loginModel);
     $navigationView = new NavigationView();
     $page = $navigationView->checkPage();
     if ($page == "/" || $page == "/index.php" || $page == "/project/") {
         $searchController->Start();
     } else {
         if ($page == "login") {
             $loginController->Start();
         } else {
             if ($page == "add") {
                 $addController->Start();
             } else {
                 $searchController->Chords($page);
             }
         }
     }
 }
开发者ID:kn222gp,项目名称:1dv608-Project,代码行数:33,代码来源:MasterController.php

示例2: startApp

 public function startApp()
 {
     $rootLocation = "Location:http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
     $lv = new LayoutView();
     $ud = new userDAL();
     $sm = new SessionManager();
     $lm = new LoginModel($ud, $sm);
     if (!$lm->isUserLoggedIn()) {
         if ($lv->userWantsToRegister()) {
             $validate = new ValidateCredentials();
             $v = new RegisterView($validate, $sm);
             $c = new RegisterController($v, $ud, $sm);
             $c->userPost();
             if ($sm->SessionGetSuccessfulRegistration()) {
                 header($rootLocation);
             }
         } else {
             $v = new LoginView($lm, $sm);
             $c = new LoginController($v, $lm);
             $c->userPost();
         }
     }
     if ($lm->isUserLoggedIn()) {
         $c = new GameController($lm, $ud, $sm, $lv);
         $v = $c->startApp();
         if ($c->userWantsToLogout()) {
             header($rootLocation);
         }
     }
     $lv->render($v, $lm->isUserLoggedIn());
 }
开发者ID:jt222ii,项目名称:1dv608-Projekt,代码行数:31,代码来源:MasterController.php

示例3: doNavigation

 public function doNavigation()
 {
     try {
         //Switch sats som kollar om användaren vill registrera ny användare eller kolla nyheter.
         //Default är se nyheter.
         switch (NavigationView::getAction()) {
             case NavigationView::$actionRegister:
                 $controller = new RegisterController();
                 $result = $controller->doRegister();
                 if ($result === self::$operationSuccess) {
                     $loginController = new LoginController();
                     $loginPage = $loginController->doLogin();
                     $controller = new NewsController();
                     return $controller->doNews($loginPage, self::$operationSuccess);
                 }
                 return $result;
                 break;
             case NavigationView::$actionNews:
             default:
                 $loginController = new LoginController();
                 $loginPage = $loginController->doLogin();
                 $controller = new NewsController();
                 $result = $controller->doNews($loginPage);
                 return $result;
                 break;
         }
     } catch (Exception $e) {
         throw new Exception('Något gick fel när sidan skulle laddas!');
     }
 }
开发者ID:TimEmanuelsson,项目名称:Webbutveckling-med-PHP,代码行数:30,代码来源:NavigationController.php

示例4: perform

 function perform()
 {
     $login = new LoginController();
     $login->logout();
     header('Location: index.php');
     exit;
 }
开发者ID:weiweiabc109,项目名称:test_project1,代码行数:7,代码来源:LogoutDo.php

示例5: callLoginAction

 private function callLoginAction($module = 'default')
 {
     Session::delete('user');
     require_once MODULE_PATH . $module . DS . 'controllers' . DS . 'LoginController.php';
     $indexController = new LoginController($this->_params);
     $indexController->indexAction();
 }
开发者ID:shimia90,项目名称:PHP-Training,代码行数:7,代码来源:Bootstrap.php

示例6: control

 public function control()
 {
     $config = Config::getInstance();
     $this->setViewTemplate('insights.tpl');
     $this->addToView('enable_bootstrap', true);
     $this->addToView('developer_log', $config->getValue('is_log_verbose'));
     if ($this->shouldRefreshCache()) {
         if (isset($_GET['u']) && isset($_GET['n']) && isset($_GET['d']) && isset($_GET['s'])) {
             $this->displayIndividualInsight();
         } else {
             if (!$this->displayPageOfInsights()) {
                 $controller = new LoginController();
                 return $controller->go();
             }
         }
         if ($this->isLoggedIn()) {
             //Populate search dropdown with service users
             $owner_dao = DAOFactory::getDAO('OwnerDAO');
             $owner = $owner_dao->getByEmail($this->getLoggedInUser());
             $instance_dao = DAOFactory::getDAO('InstanceDAO');
             $this->addToView('instances', $instance_dao->getByOwner($owner));
         }
     }
     $this->addToView('tpl_path', THINKUP_WEBAPP_PATH . 'plugins/insightsgenerator/view/');
     return $this->generateView();
 }
开发者ID:kuthulas,项目名称:ProjectX,代码行数:26,代码来源:class.InsightStreamController.php

示例7: RunProgram

 public function RunProgram()
 {
     //databas
     $db = new \model\UsersDAL();
     //modell
     $l = new \model\Login($db);
     //view
     $dtv = new \view\DateTimeView();
     $rv = new \view\RegisterView();
     $v = new \view\LoginView($l->getIsLoggedIn());
     $urlLoginOrRegister = false;
     //login or register
     $navigation = $rv->checkURL();
     if ($navigation === 'register') {
         $r = new \model\Registration($db);
         $rc = new RegisterController($rv, $r);
         $rc->startRegistration();
     } else {
         $lc = new LoginController($l, $v);
         $lc->startLogin();
         $urlLoginOrRegister = true;
     }
     $lv = new \view\LayoutView($l->getIsLoggedIn(), $v->LoginResponse(), $dtv, $rv->generateRegistrationHTML());
     ///skcika med tre eller false istället för
     $lv->render($urlLoginOrRegister);
 }
开发者ID:RebeccaFransson,项目名称:1dv608,代码行数:26,代码来源:MasterController.php

示例8: authenticate

 function authenticate()
 {
     // ログインチェック
     $login = new LoginController();
     if (!$login->isLogin()) {
         return array('401', array());
     }
     // get params
     $action = $this->backend->ctl->getCurrentActionName();
     // アクション名を取得
     $kengen_flg = intval($this->session->get('kengen_flg'));
     // 権限取得
     $company_id = $this->session->get('company_id');
     // 会社CD取得
     $role_id = $this->session->get('role_id');
     // ロールID取得
     // 権限フラグチェック
     if ($kengen_flg != Konst::KENGEN_FLG_KANRI && $kengen_flg != Konst::KENGEN_FLG_SUPER) {
         // 管理者ユーザ(8)、スーパーユーザ(9)以外であれば弾く
         $login->Logout();
         return '403';
     }
     // スーパーユーザはロール権限のチェックを行わない
     if ($kengen_flg != Konst::KENGEN_FLG_SUPER) {
         // ロールDとActionNameを比較して有効であれば通す
         $params = array('company_id' => $company_id, 'role_id' => $role_id, 'action_name' => $action);
         $enable = DaoFactory::MenuRoleD()->getCheckEnableRole($params)->fetch();
         if (empty($enable)) {
             return '403';
         }
     }
     $this->setGuideModal();
     $this->checkLicense();
     return null;
 }
开发者ID:weiweiabc109,项目名称:test_project1,代码行数:35,代码来源:Api_ActionClass.php

示例9: indexAction

 /**
  * Checks with the view what the user wants to do and dispatches actions to model, view and controllers
  *
  * Should be called from index to start app
  *
  * @return  string or redirect to self// Is this relly good structure?
  */
 public function indexAction()
 {
     $message = null;
     $view = null;
     $dtv = new \view\DateTimeView();
     if ($this->navigationView->doesUserWantToSeeRegPage()) {
         $view = new \view\RegistrationView();
         $regController = new RegistrationController($this->userCollection, $view);
         $message = $regController->indexAction();
         if ($this->userCollection->getRegistrationSucceeded()) {
             $this->navigationView->redirectTo($message, '');
         }
     } else {
         if ($this->navigationView->doesUserWantToSeeLoginPage()) {
             $view = new \view\LoginView($this->loginModel);
             $loginController = new LoginController($this->loginModel, $view);
             $message = $loginController->indexAction();
             if ($this->loginModel->checkLoginStatus() && isset($message)) {
                 $this->navigationView->redirectTo($message);
             }
         }
     }
     if (!isset($message)) {
         $message = $this->navigationView->getSessionMessage();
     }
     return $this->layoutView->render($view, $dtv, $this->navigationView, $message);
 }
开发者ID:aa222di,项目名称:lnu-php,代码行数:34,代码来源:NavigationController.php

示例10: authenticate

function authenticate()
{
    $login = new LoginController();
    if (!$login->checkSession()) {
        $app->halt(401);
    }
}
开发者ID:ronenguttman,项目名称:MusicStore,代码行数:7,代码来源:index.php

示例11: authenticate

 function authenticate()
 {
     $this->af->setApp('app_name', $this->config->get('app_name'));
     // ログインチェック
     $login = new LoginController();
     if (!$login->isLogin()) {
         return 'login';
     }
     // パスワード期限チェック
     $company_id = $this->session->get('company_id');
     $user_id = $this->session->get('user_id');
     $params = array('company_id' => $company_id, 'user_id' => $user_id);
     if (DaoFactory::UserMst()->isExpiredPassword($params)) {
         return 'password_list';
     }
     // get params
     $kengen_flg = intval($this->session->get('kengen_flg'));
     // 権限取得
     // 権限フラグチェック
     if ($kengen_flg != Konst::KENGEN_FLG_KANRI && $kengen_flg != Konst::KENGEN_FLG_SUPER) {
         // 管理者ユーザ(8)、スーパーユーザ(9)以外であれば弾く
         $login->Logout();
         return 'login';
     }
     $locale = $this->session->get('current_locale');
     if ($locale) {
         $this->backend->getController()->setLocale($locale);
     }
     $this->setGuideModal();
     $this->checkLicense();
     return null;
 }
开发者ID:weiweiabc109,项目名称:test_project1,代码行数:32,代码来源:ActionClass.php

示例12: control

 public function control()
 {
     $session = new Session();
     $dao = DAOFactory::getDAO('OwnerDAO');
     $this->setViewTemplate('session.resetpassword.tpl');
     $this->disableCaching();
     if (!isset($_GET['token']) || !preg_match('/^[\\da-f]{32}$/', $_GET['token']) || !($user = $dao->getByPasswordToken($_GET['token']))) {
         // token is nonexistant or bad
         $this->addErrorMessage('You have reached this page in error.');
         return $this->generateView();
     }
     if (!$user->validateRecoveryToken($_GET['token'])) {
         $this->addErrorMessage('Your token is expired.');
         return $this->generateView();
     }
     if (isset($_POST['password'])) {
         if ($_POST['password'] == $_POST['password_confirm']) {
             if ($dao->updatePassword($user->email, $session->pwdcrypt($_POST['password'])) < 1) {
                 echo "not updated";
             }
             $login_controller = new LoginController(true);
             $login_controller->addSuccessMessage('You have changed your password.');
             return $login_controller->go();
         } else {
             $this->addErrorMessage("Passwords didn't match.");
         }
     } else {
         if (isset($_POST['Submit'])) {
             $this->addErrorMessage('Please enter a new password.');
         }
     }
     return $this->generateView();
 }
开发者ID:rayyan,项目名称:ThinkUp,代码行数:33,代码来源:class.PasswordResetController.php

示例13: control

 /**
  * Attempt to log in user via private API key and redirect to specified success or failure URLs based on result
  * with msg parameter set.
  * Expected $_GET parameters:
  * u: email address
  * k: private API key
  * failure_redir: failure redirect URL
  * success_redir: success redirect URL
  */
 public function control()
 {
     $this->disableCaching();
     if (!isset($_GET['success_redir']) || !isset($_GET['failure_redir']) || $_GET['success_redir'] == "" || $_GET['failure_redir'] == "") {
         if (!isset($_GET['success_redir']) || $_GET['success_redir'] == "") {
             $controller = new LoginController(true);
             $controller->addErrorMessage('No success redirect specified');
             return $controller->go();
         }
         if (!isset($_GET['failure_redir']) || $_GET['failure_redir'] == "") {
             $controller = new LoginController(true);
             $controller->addErrorMessage('No failure redirect specified');
             return $controller->go();
         }
     } else {
         $this->success_redir = $_GET['success_redir'];
         $this->failure_redir = $_GET['failure_redir'];
         if (!isset($_GET['u'])) {
             $this->fail('User is not set.');
         }
         if (!isset($_GET['k'])) {
             $this->fail('API key is not set.');
         }
         if ($this->isLoggedIn()) {
             Session::logout();
         }
         $owner_dao = DAOFactory::getDAO('OwnerDAO');
         if ($_GET['u'] == '' || $_GET['k'] == '') {
             if ($_GET['u'] == '') {
                 $this->fail("Email must not be empty.");
             } else {
                 $this->fail("API key must not be empty.");
             }
         } else {
             $user_email = $_GET['u'];
             if (get_magic_quotes_gpc()) {
                 $user_email = stripslashes($user_email);
             }
             $owner = $owner_dao->getByEmail($user_email);
             if (!$owner) {
                 $this->fail("Invalid email.");
             } elseif (!$owner->is_activated) {
                 $error_msg = 'Inactive account.';
                 $this->fail($error_msg);
                 // If the credentials supplied by the user are incorrect
             } elseif (!$owner_dao->isOwnerAuthorizedViaPrivateAPIKey($user_email, $_GET['k'])) {
                 $error_msg = 'Invalid API key.';
                 $this->fail($error_msg);
             } else {
                 // user has logged in sucessfully this sets variables in the session
                 Session::completeLogin($owner);
                 $owner_dao->updateLastLogin($user_email);
                 $owner_dao->resetFailedLogins($user_email);
                 $owner_dao->clearAccountStatus($user_email);
                 $this->succeed("Logged in successfully.");
             }
         }
     }
 }
开发者ID:dgw,项目名称:ThinkUp,代码行数:68,代码来源:class.SessionAPILoginController.php

示例14: renderView

 public function renderView()
 {
     if (!isset($_SESSION['cart'])) {
         $cart = new Cart();
         $_SESSION['cart'] = serialize($cart);
     }
     foreach ($this->model->getUris() as $key => $value) {
         if (preg_match("#^{$value}\$#", $this->uriView)) {
             if ($this->model->getView($key) === "PageView") {
                 $pagecontroller = new PageController($this->additionalParam);
                 $pagecontroller->renderView();
             } else {
                 if ($this->model->getView($key) === "ProductView") {
                     $productscontroller = new ProductsController();
                     $productscontroller->renderView();
                 } else {
                     if ($this->model->getView($key) === "SingleProductView") {
                         $singleproductcontroller = new SingleProductController($this->additionalParam);
                         $singleproductcontroller->renderView();
                     } else {
                         if ($this->model->getView($key) === "LoginView") {
                             $logincontroller = new LoginController($this->additionalParam);
                             $logincontroller->renderView();
                         } else {
                             if ($this->model->getView($key) === "CustomerView") {
                                 $customercontroller = new CustomerController();
                                 $customercontroller->renderView();
                             } else {
                                 if ($this->model->getView($key) === "CartView") {
                                     $cartcontroller = new CartController($this->additionalParam);
                                     $cartcontroller->renderView();
                                 } else {
                                     if ($this->model->getView($key) === "ContactView") {
                                         $contactcontroller = new ContactController($this->additionalParam);
                                         $contactcontroller->renderView();
                                     } else {
                                         if ($this->model->getView($key) === "RegisterView") {
                                             $registrationcontroller = new RegistrationController($this->additionalParam);
                                             $registrationcontroller->renderView();
                                         } else {
                                             if ($this->model->getView($key) === "CheckoutView") {
                                                 $checkoutcontroller = new CheckoutController($this->additionalParam);
                                                 $checkoutcontroller->renderView();
                                             } else {
                                                 $useView = $this->model->getView($key);
                                                 $view = new $useView();
                                                 $view->render();
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:audef1,项目名称:myShop,代码行数:59,代码来源:RouteController.php

示例15: authenticate

 function authenticate()
 {
     // ログインチェック
     $login = new LoginController();
     if (!$login->isLogin()) {
         return 'login';
     }
 }
开发者ID:weiweiabc109,项目名称:test_project1,代码行数:8,代码来源:Update.php


注:本文中的LoginController类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。