本文整理汇总了PHP中Acl::acl方法的典型用法代码示例。如果您正苦于以下问题:PHP Acl::acl方法的具体用法?PHP Acl::acl怎么用?PHP Acl::acl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Acl
的用法示例。
在下文中一共展示了Acl::acl方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onEntry
public function onEntry()
{
global $cookie_found;
if (isset($_POST['logTheUserOut'])) {
unset(Session::sess()->user);
header('Location: ' . BASEPATH . '/' . DEFAULTPAGE);
exit;
} elseif (isset($_POST['logTheUserIn']) && !empty($_POST['userName']) && !empty($_POST['userPass']) && !isset(Session::sess()->user)) {
$userData = new Data_User(Data_User::LDAP, $_POST['userName'], $_POST['userPass']);
Session::sess()->user = $userData->getUser();
}
if (isset(Session::sess()->user)) {
Acl::acl()->setRole(Session::sess()->user->role);
} else {
Acl::acl()->setRole();
}
}
示例2: beforeContent
/**
* menu will be built before the content is generated.
*
* @access public
* @return void
*/
public function beforeContent()
{
$menu = $this->document->getElementById($this->id);
if ($menu) {
$this->document->addCss('public/css/multimenu.css');
$menu->removeAttribute('style');
$menuList = $this->document->createElement('ul');
foreach ($this->menuItems as $lbl => $page) {
if (is_array($page) && isset($page['default'])) {
$checkPage = $page['default'];
} else {
$checkPage = $page;
}
if (Acl::acl()->isAllowed($checkPage)) {
$menuList->appendChild($this->fillMenu($lbl, $page));
}
}
$menu->appendChild($menuList);
}
}
示例3: run
/**
* default page run.
* all is controlled by thisone (well thisone is called from __toString)
*
* @access private
* @return void
*/
private function run()
{
/* onentry modules */
$this->runModules('onEntry');
$rq = new RequestHandler($this->defaultPage, $this->basepath);
/* beforeContent modules */
$this->runModules('beforeContent');
$page = null;
$classname = "Pages_" . ucfirst($rq->getPage());
if (class_exists($classname) && Acl::acl()->isAllowed($rq->getPage())) {
$page = new $classname($this->document, $this->toArray());
if (!$page instanceof IPages) {
throw new Exception('the page doesnt implement the page interface');
}
if ($rq->getParameters() != null) {
$page->setParameters($rq->getParameters());
}
if ($rq->getAction() != null && method_exists($page, $rq->getAction())) {
$action = $rq->getAction();
$page->{$action}();
} else {
$page->index();
}
} else {
$page = new Pages_404($this->document, $this->toArray());
$page->index();
}
/* afterContent modules */
$this->runModules('afterContent');
/* onExit modules */
$this->runModules('onExit');
}