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


PHP DashboardController类代码示例

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


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

示例1: authControl

 public function authControl()
 {
     $this->app_session->logout();
     $controller = new DashboardController(true);
     $controller->addSuccessMessage("You have successfully logged out.");
     return $controller->go();
 }
开发者ID:unruthless,项目名称:ThinkUp,代码行数:7,代码来源:class.LogoutController.php

示例2: control

 public function control()
 {
     $this->setPageTitle('Log in');
     $this->setViewTemplate('session.login.tpl');
     $this->view_mgr->addHelp('login', 'userguide/accounts/index');
     $this->disableCaching();
     //don't show login form if already logged in
     if ($this->isLoggedIn()) {
         $controller = new DashboardController(true);
         return $controller->go();
     } else {
         $owner_dao = DAOFactory::getDAO('OwnerDAO');
         if (isset($_POST['Submit']) && $_POST['Submit'] == 'Log In' && isset($_POST['email']) && isset($_POST['pwd'])) {
             if ($_POST['email'] == '' || $_POST['pwd'] == '') {
                 if ($_POST['email'] == '') {
                     $this->addErrorMessage("Email must not be empty");
                     return $this->generateView();
                 } else {
                     $this->addErrorMessage("Password must not be empty");
                     return $this->generateView();
                 }
             } else {
                 $session = new Session();
                 $user_email = $_POST['email'];
                 if (get_magic_quotes_gpc()) {
                     $user_email = stripslashes($user_email);
                 }
                 $this->addToView('email', $user_email);
                 $owner = $owner_dao->getByEmail($user_email);
                 if (!$owner) {
                     $this->addErrorMessage("Incorrect email");
                     return $this->generateView();
                 } elseif (!$owner->is_activated) {
                     $this->addErrorMessage("Inactive account. " . $owner->account_status . ". " . '<a href="forgot.php">Reset your password.</a>');
                     return $this->generateView();
                 } elseif (!$session->pwdCheck($_POST['pwd'], $owner_dao->getPass($user_email))) {
                     //failed login
                     if ($owner->failed_logins >= 10) {
                         $owner_dao->deactivateOwner($user_email);
                         $owner_dao->setAccountStatus($user_email, "Account deactivated due to too many failed logins");
                     }
                     $owner_dao->incrementFailedLogins($user_email);
                     $this->addErrorMessage("Incorrect password");
                     return $this->generateView();
                 } else {
                     // this sets variables in the session
                     $session->completeLogin($owner);
                     $owner_dao->updateLastLogin($user_email);
                     $owner_dao->resetFailedLogins($user_email);
                     $owner_dao->clearAccountStatus('');
                     $controller = new DashboardController(true);
                     return $controller->control();
                 }
             }
         } else {
             return $this->generateView();
         }
     }
 }
开发者ID:narpaldhillon,项目名称:ThinkUp,代码行数:59,代码来源:class.LoginController.php

示例3: bounce

 /**
  * Bounce user to public page or to error page.
  * @TODO bounce back to original action once signed in
  */
 protected function bounce() {
     if (get_class($this)=='DashboardController' || get_class($this)=='PostController') {
         $controller = new DashboardController(true);
         return $controller->go();
     } else {
         $config = Config::getInstance();
         throw new Exception('You must <a href="'.$config->getValue('site_root_path').
         'session/login.php">log in</a> to do this.');
     }
 }
开发者ID:rgoncalves,项目名称:ThinkUp,代码行数:14,代码来源:class.ThinkUpAuthController.php

示例4: bounce

 /**
  * Bounce user to public page or to error page.
  * @TODO bounce back to original action once signed in
  */
 protected function bounce()
 {
     $config = Config::getInstance();
     if (get_class($this) == 'DashboardController' || get_class($this) == 'PostController') {
         $controller = new DashboardController(true);
         return $controller->go();
     } else {
         throw new ControllerAuthException('You must log in to access this controller: ' . get_class($this));
     }
 }
开发者ID:randi2kewl,项目名称:ThinkUp,代码行数:14,代码来源:class.ThinkUpAuthController.php

示例5: go

 public function go()
 {
     if ($this->isLoggedIn()) {
         // If logged in, we go to DashboardController
         $controller = new DashboardController();
         echo $controller->go();
     } else {
         // If is not logged in, we go to LoginController
         $controller = new LoginController();
         echo $controller->go();
     }
 }
开发者ID:JoffreyO,项目名称:hackademic,代码行数:12,代码来源:class.BackendController.php

示例6: command

 public function command()
 {
     $geyser_id = Request::post('geyser_id');
     $element_select = Request::post('e');
     $gstate_select = Request::post('g');
     $schedule_select = Request::post('s');
     $settings_url = "http://localhost:8080/om2m/nscl/applications/geyser_" . $geyser_id . "/containers/SETTINGS/contentInstances";
     $schedule_url = "http://localhost:8080/om2m/nscl/applications/Scheduler/containers/SCHEDULE_" . $geyser_id . "/contentInstances";
     if (!empty($element_select)) {
         $data = '{"Gstate":' . '"' . $gstate_select . '"' . '}';
         DashboardController::doPOST($settings_url, $data);
     } else {
         if (!empty($gstate_select)) {
             $data = '{"Rstate":' . '"' . $element_select . '"' . '}';
             DashboardController::doPOST($settings_url, $data);
         } else {
             if (!empty($schedule_select)) {
                 if (strcmp($schedule_select, "low") == 0) {
                     $data = "40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40";
                 } else {
                     if (strcmp($schedule_select, "smart") == 0) {
                         $data = "35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,60,60,60,60,60,60,60,60,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,50,50,50,50,50,50,50,50,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35";
                     } else {
                         if (strcmp($schedule_select, "high") == 0) {
                             $data = "65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65";
                         }
                     }
                 }
                 DashboardController::doPOST($schedule_url, $data);
             }
         }
     }
     $this->View->render('dashboard/index');
 }
开发者ID:AndrewCloete,项目名称:PHP_webapp,代码行数:34,代码来源:DashboardController.php

示例7: control

 public function control()
 {
     $this->setPageTitle('Log in');
     $this->setViewTemplate('session.login.tpl');
     $this->disableCaching();
     //don't show login form if already logged in
     if ($this->isLoggedIn()) {
         $controller = new DashboardController(true);
         return $controller->go();
     } else {
         $od = DAOFactory::getDAO('OwnerDAO');
         if (isset($_POST['Submit']) && $_POST['Submit'] == 'Log In' && isset($_POST['email']) && isset($_POST['pwd'])) {
             if ($_POST['email'] == '' || $_POST['pwd'] == '') {
                 if ($_POST['email'] == '') {
                     $this->addErrorMessage("Email must not be empty");
                     return $this->generateView();
                 } else {
                     $this->addErrorMessage("Password must not be empty");
                     return $this->generateView();
                 }
             } else {
                 $session = new Session();
                 $user_email = $_POST['email'];
                 $this->addToView('email', $user_email);
                 $owner = $od->getByEmail($user_email);
                 if (!$owner) {
                     $this->addErrorMessage("Incorrect email");
                     return $this->generateView();
                 } elseif (!$session->pwdCheck($_POST['pwd'], $od->getPass($user_email))) {
                     $this->addErrorMessage("Incorrect password");
                     return $this->generateView();
                 } else {
                     // this sets variables in the session
                     $session->completeLogin($owner);
                     $od->updateLastLogin($user_email);
                     $controller = new DashboardController(true);
                     return $controller->control();
                 }
             }
         } else {
             return $this->generateView();
         }
     }
 }
开发者ID:unruthless,项目名称:ThinkUp,代码行数:44,代码来源:class.LoginController.php

示例8: __construct

 public function __construct()
 {
     $dashboard = App::make('Lib\\Repositories\\Dashboard\\DashboardRepositoryInterface');
     $validator = App::make('Lib\\Services\\Validation\\DashboardValidator');
     $scraper = App::make('Lib\\Services\\Scraping\\Scraper');
     parent::__construct($dashboard, $validator, $scraper);
 }
开发者ID:onlystar1991,项目名称:mtdb,代码行数:7,代码来源:StreamingDashboardController.php

示例9: Initialize

 /**
  * Hightlight menu path. Automatically run on every use.
  *
  * @since 2.0.0
  * @access public
  */
 public function Initialize()
 {
     parent::Initialize();
     if ($this->Menu) {
         $this->Menu->HighlightRoute('/dashboard/settings');
     }
 }
开发者ID:Raz0r,项目名称:Garden,代码行数:13,代码来源:class.settingscontroller.php

示例10: initialize

 /**
  * Runs before every call to this controller.
  */
 public function initialize()
 {
     parent::initialize();
     Gdn_Theme::section('Dashboard');
     set_time_limit(0);
     // Is this even doing anything?
 }
开发者ID:sitexa,项目名称:vanilla,代码行数:10,代码来源:class.utilitycontroller.php

示例11: initialize

 /**
  * Runs before every call to this controller.
  */
 public function initialize()
 {
     parent::initialize();
     Gdn_Theme::section('Dashboard');
     $this->Model = new DBAModel();
     $this->Form = new Gdn_Form();
     $this->addJsFile('dba.js');
 }
开发者ID:vanilla,项目名称:vanilla,代码行数:11,代码来源:class.dbacontroller.php

示例12: initialize

 /**
  * Set menu path. Automatically run on every use.
  *
  * @since 2.0.0
  * @access public
  */
 public function initialize()
 {
     parent::initialize();
     Gdn_Theme::section('Dashboard');
     if ($this->Menu) {
         $this->Menu->highlightRoute('/dashboard/settings');
     }
 }
开发者ID:caidongyun,项目名称:vanilla,代码行数:14,代码来源:class.routescontroller.php

示例13: Initialize

 public function Initialize()
 {
     parent::Initialize();
     Gdn_Theme::Section('Dashboard');
     $this->Model = new DBAModel();
     $this->Form = new Gdn_Form();
     $this->Form->InputPrefix = '';
     $this->AddJsFile('dba.js');
 }
开发者ID:3marproof,项目名称:vanilla,代码行数:9,代码来源:class.dbacontroller.php

示例14: index

 public function index()
 {
     $glparams = DataObjectFactory::Factory('GLParams');
     if (is_null($glparams->ar_disposals_proceeds_account()) || is_null($glparams->ar_disposals_proceeds_centre()) || is_null($glparams->ar_pl_suspense_account()) || is_null($glparams->ar_pl_suspense_centre())) {
         $flash = Flash::Instance();
         $flash->addError('GL Support is not enabled');
     }
     parent::index();
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:9,代码来源:IndexController.php

示例15: Initialize

 /**
  * Make this look like a dashboard page and add the resources
  *
  * @since 1.0
  * @access public
  */
 public function Initialize()
 {
     parent::Initialize();
     $this->Application = 'Yaga';
     Gdn_Theme::Section('Dashboard');
     if ($this->Menu) {
         $this->Menu->HighlightRoute('/badge');
     }
     $this->AddJsFile('admin.badges.js');
     $this->AddCssFile('badges.css');
 }
开发者ID:hxii,项目名称:Application-Yaga,代码行数:17,代码来源:class.badgecontroller.php


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