本文整理汇总了PHP中Am_Controller::preDispatch方法的典型用法代码示例。如果您正苦于以下问题:PHP Am_Controller::preDispatch方法的具体用法?PHP Am_Controller::preDispatch怎么用?PHP Am_Controller::preDispatch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Am_Controller
的用法示例。
在下文中一共展示了Am_Controller::preDispatch方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preDispatch
public function preDispatch()
{
parent::preDispatch();
if (in_array('cc', $this->getDi()->modules->getEnabled())) {
throw new Am_Exception_AccessDenied(___('Online backup is disabled if you have CC payment plugins enabled. Use offline backup instead'));
}
}
示例2: preDispatch
public function preDispatch()
{
parent::preDispatch();
if ($this->getDi()->auth->getUserId()) {
$this->_redirect('member');
}
}
示例3: preDispatch
function preDispatch()
{
$this->user_id = intval($this->_request->user_id);
if ($this->_request->getActionName() != 'log') {
if ($this->user_id <= 0) {
throw new Am_Exception_InputError("user_id is empty in " . get_class($this));
}
}
return parent::preDispatch();
}
示例4: preDispatch
public function preDispatch()
{
$db_version = $this->getDi()->store->get('db_version');
if (empty($db_version)) {
$this->getDi()->store->set('db_version', AM_VERSION);
} elseif ($db_version != AM_VERSION) {
$this->redirectLocation(REL_ROOT_URL . '/admin-upgrade-db');
}
parent::preDispatch();
}
示例5: preDispatch
function preDispatch()
{
if (!$this->getModule()->getConfig('does_not_require_login')) {
$this->getDi()->auth->requireLogin(ROOT_URL . '/helpdesk/faq');
}
$this->view->headLink()->appendStylesheet($this->view->_scriptCss('helpdesk-user.css'));
if ($this->getDi()->auth->getUser() && ($page = $this->getDi()->navigationUser->findOneBy('id', 'helpdesk-faq'))) {
$page->setActive(true);
}
parent::preDispatch();
}
示例6: preDispatch
public function preDispatch()
{
parent::preDispatch();
$this->view->invoice = null;
$this->view->id = null;
$this->view->paysystems = array();
$this->invoice = $this->getDi()->invoiceTable->findBySecureId($this->getFiltered('id'), "CANCEL");
if ($this->invoice) {
if ($this->invoice->isPaid()) {
throw new Am_Exception_InputError("Invoice #{$id} is already paid");
}
$this->getDi()->plugins_payment->loadEnabled();
$this->view->paysystems = $this->getDi()->paysystemList->getAllPublicAsArrays();
$this->view->invoice = $this->invoice;
$this->view->id = $this->getFiltered('id');
}
}
示例7: preDispatch
public function preDispatch()
{
$this->grid = $this->createGrid();
parent::preDispatch();
}
示例8: preDispatch
function preDispatch()
{
$this->user_id = intval($this->_request->user_id);
if (!in_array($this->_request->getActionName(), array('log', 'invoice'))) {
if ($this->user_id <= 0) {
throw new Am_Exception_InputError("user_id is empty in " . get_class($this));
}
}
$this->setActiveMenu('users-browse');
return parent::preDispatch();
}