本文整理汇总了PHP中permissions::getPermissions方法的典型用法代码示例。如果您正苦于以下问题:PHP permissions::getPermissions方法的具体用法?PHP permissions::getPermissions怎么用?PHP permissions::getPermissions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类permissions
的用法示例。
在下文中一共展示了permissions::getPermissions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FastTemplate
$lang = get_config('language_set');
require_once 'i18n/' . $lang . '/i18n.php';
require_once PATH_TO_CLASSES . '/cls_fast_template.php';
require_once PATH_TO_CLASSES . '/cls_permissions.php';
// inicjowanie klasy, wkazanie katalogu przechowuj±cego szablony
$ft = new FastTemplate('./templates/' . $lang . '/tpl');
// egzemplarz klasy obs³uguj±cej bazê danych Core
$db = new DB_SQL();
// pobieramy poziom uprawnieñ
$query = sprintf("\r\n SELECT \r\n permission_level \r\n FROM \r\n %1\$s \r\n WHERE \r\n login = '%2\$s'", TABLE_USERS, $_SESSION['login']);
$db->query($query);
$db->next_record();
$privileges = $db->f('permission_level');
// egzemplarz klasy do obs³ugi uprawnieñ
$perms = new permissions();
$permarr = $perms->getPermissions($privileges);
$ft->assign(array('PERMS_USER' => false, 'PERMS_WRITER' => false, 'PERMS_MODERATOR' => false, 'PERMS_TPLEDITOR' => false, 'PERMS_ADMIN' => false));
switch ($privileges) {
case '1':
$privilege_level = 1;
$ft->assign('PERMS_USER', true);
break;
case '3':
$privilege_level = 2;
$ft->assign('PERMS_USER', true);
$ft->assign('PERMS_WRITER', true);
break;
case '7':
$privilege_level = 3;
$ft->assign('PERMS_USER', true);
$ft->assign('PERMS_WRITER', true);