本文整理汇总了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();
}
示例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();
}
}
}
示例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.');
}
}
示例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));
}
}
示例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();
}
}
示例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');
}
示例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();
}
}
}
示例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);
}
示例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');
}
}
示例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?
}
示例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');
}
示例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');
}
}
示例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');
}
示例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();
}
示例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');
}