當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。