本文整理汇总了PHP中Authorization::getCurrentUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Authorization::getCurrentUser方法的具体用法?PHP Authorization::getCurrentUser怎么用?PHP Authorization::getCurrentUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Authorization
的用法示例。
在下文中一共展示了Authorization::getCurrentUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPanel
public static function getPanel() {
if( !Authorization::isAuthorized() ) return;
$panelStyles = API::parseStylesFile(CUSTOMPATH.DS."Global.views");
$paneltpl = $panelStyles["VeronicaAdminPanel"][2];
$menuItemtpl = $panelStyles["VeronicaMenuListItem"][2];
$controllers = Api::getCustom("Controller");
$modeles = Api::getCustom("Model");
$user = Authorization::getCurrentUser();
$userpanel = ViewHandler::wrap("CurrentUser", $user[0]);
$paneltpl = str_replace("<? echo \$USERPANEL;?>", $userpanel, $paneltpl);
$list = "";
foreach ($controllers as $controller){
if($controller::$inAdminPanel){
$l = str_replace("<? echo \$ADDCLICKHANDLER;?>", "Controller.add('".$controller::$name."');", $menuItemtpl);
$l = str_replace("<? echo \$CLICKHANDLER;?>", "Controller.openDashboard('".$controller::$name."');", $l);
$l = str_replace("<? echo \$COUNT;?>", "Controller.openDashboard('".$controller::$name."');", $l);
$list .= str_replace("<? echo \$ALIAS;?>", $controller::$alias, $l);
}
}
$paneltpl = str_replace("<? echo \$MENULIST;?>", $list, $paneltpl);
return $paneltpl;
}
示例2: showPermissionsList
/**
* zobrazi zoznam vsetkych
* @global array $ALIEN
*/
public static function showPermissionsList()
{
if (!Authorization::getCurrentUser()->hasPermission(38)) {
new Notification("Prístup zamietnutý.", "error");
header("Location: ?page=home", false, 301);
ob_end_flush();
exit;
}
global $ALIEN;
$ALIEN['HEADER'] = 'Zoznam existujúcich oprávnení';
$limit = sizeof(Authorization::$Permissions);
for ($i = 1; $i <= $limit; $i++) {
$permission = new Permission(Authorization::$Permissions[$i]['label']);
echo '<div class="item"><img src="images/icons/shield.png"> ID: ' . $permission->getId() . ' | <strong>' . $permission->getLabel() . '</strong> | ' . $permission->getDescription() . '</div>';
}
}