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


PHP AdminController::setForwardAction方法代码示例

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


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

示例1: perform

 /**
  * Carries out the specified action
  */
 function perform()
 {
     // initialize the view, but we first check if there is session information avaible
     // since in that case we will not make the user choose enter user and pass again, but
     // show the main menu page straight away
     if ($this->sessionInfoAvailable()) {
         AdminController::setForwardAction("emptyAction");
         // launch the event since we have all the info we need
         $pm =& PluginManager::getPluginManager();
         $pm->setBlogInfo($this->_blogInfo);
         $pm->setUserInfo($this->_userInfo);
         $pm->notifyEvent(EVENT_LOGIN_SUCCESS);
     } else {
         $this->_view = new AdminDefaultView();
     }
     // better to return true if everything fine
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:21,代码来源:admindefaultaction.class.php

示例2: perform

 /**
  * Carries out the specified action
  */
 function perform()
 {
     // we don't have to worry about much more here, we can let the
     // $this->_nextAction action take care of everytyhing now...
     // If $this->_nextAction is null, we use "newPost" as default nextAction
     $this->_nextAction = $this->_request->getValue("action");
     if ($this->_nextAction) {
         AdminController::setForwardAction($this->_nextAction);
     } else {
         AdminController::setForwardAction("newPost");
     }
     // better to return true if everything fine
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:17,代码来源:adminmainaction.class.php

示例3: perform

 /**
  * Carries out the specified action
  */
 function perform()
 {
     // get the parameters, which have already been validated
     $this->_userName = Textfilter::filterAllHTML($this->_request->getValue("userName"));
     $this->_userPassword = $this->_request->getValue("userPassword");
     $this->_op = Textfilter::filterAllHTML($this->_request->getValue("op"));
     // create a plugin manager
     $pm =& PluginManager::getPluginManager();
     // try to authenticate the user
     $users = new Users();
     if (!$users->authenticateUser($this->_userName, $this->_userPassword)) {
         $this->_view = new AdminDefaultView();
         $this->_view->setErrorMessage($this->_locale->tr("error_incorrect_username_or_password"));
         $this->setCommonData();
         $pm->notifyEvent(EVENT_LOGIN_FAILURE, array("user" => $this->_userName));
         return false;
     }
     // if the user is correct, get and put his or her information in the session
     $userInfo = $users->getUserInfo($this->_userName, $this->_userPassword);
     if (!$userInfo) {
         $this->_view = new AdminDefaultView();
         $this->_view->setErrorMessage($this->_locale->tr("error_incorrect_username_or_password"));
         $this->setCommonData();
         $pm->notifyEvent(EVENT_LOGIN_FAILURE, array("user" => $this->_userName));
         return false;
     }
     $pm->notifyEvent(EVENT_USER_LOADED, array("user" => &$userInfo, "from" => "Login"));
     //$sessionInfo = $_SESSION["SessionInfo"];
     $session = HttpVars::getSession();
     $sessionInfo = $session["SessionInfo"];
     $sessionInfo->setValue("userInfo", $userInfo);
     $session["SessionInfo"] = $sessionInfo;
     HttpVars::setSession($session);
     // get the list of blogs to which the user belongs
     $userBlogs = $users->getUsersBlogs($userInfo->getId(), BLOG_STATUS_ACTIVE);
     // but if he or she does not belong to any yet, we quit
     if (empty($userBlogs)) {
         $this->_view = new AdminDefaultView();
         $this->_view->setErrorMessage($this->_locale->tr("error_dont_belong_to_any_blog"));
         $this->setCommonData();
         return false;
     }
     $pm->notifyEvent(EVENT_BLOGS_LOADED, array("blogs" => &$userBlogs, "from" => "Login"));
     // check if we are skipping the dashboard
     if ($this->_config->getValue("skip_dashboard")) {
         // get the first blog that came
         $this->_blogInfo = end($userBlogs);
         // set it in the session
         $session = HttpVars::getSession();
         $session["SessionInfo"]->setValue("blogInfo", $this->_blogInfo);
         HttpVars::setSession($session);
         // and then continue...
         AdminController::setForwardAction("newPost");
     } else {
         $this->_view = new AdminDashboardView($userInfo, $userBlogs);
     }
     // better to return true if everything's fine
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:62,代码来源:adminloginaction.class.php


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