本文整理匯總了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>';
}
}