本文整理汇总了PHP中ACL::getRoleNameFromID方法的典型用法代码示例。如果您正苦于以下问题:PHP ACL::getRoleNameFromID方法的具体用法?PHP ACL::getRoleNameFromID怎么用?PHP ACL::getRoleNameFromID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ACL
的用法示例。
在下文中一共展示了ACL::getRoleNameFromID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
if (count($roles) < 1) {
echo "No roles yet.<br />";
}
?>
<input type="button" name="New" value="New Role" onclick="window.location='?action=role'" />
<?php
}
if ($_GET['action'] == 'role') {
if ($_GET['roleID'] == '') {
?>
<h2>New Role:</h2>
<?php
} else {
?>
<h2>Manage Role: (<?php
echo $myACL->getRoleNameFromID($_GET['roleID']);
?>
)</h2><?php
}
?>
<form action="roles.php" method="post">
<label for="roleName">Name:</label>
<input type="text" name="roleName" id="roleName" value="<?php
echo $myACL->getRoleNameFromID($_GET['roleID']);
?>
" />
<table border="0" cellpadding="5" cellspacing="0">
<tr>
<th></th><th>Allow</th><th>Deny</th><th>Ignore</th>
</tr>
<?php
示例2: ACL
<?php
if ($_GET['action'] == 'user') {
$userACL = new ACL($_GET['userID']);
?>
<h2>Managing <?php
echo $myACL->getUsername($_GET['userID']);
?>
:</h2> ... Some form to edit user info ... <h3>Roles for user: (<a href="users.php?action=roles&userID=<?php
echo $_GET['userID'];
?>
">Manage Roles</a>)</h3>
<ul>
<?php
$roles = $userACL->getUserRoles();
foreach ($roles as $k => $v) {
echo "\n\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t" . $userACL->getRoleNameFromID($v) . "\n\t\t\t\t\t\t\t\t</li>";
}
?>
</ul> <h3>Permissions for user: (<a href="users.php?action=perms&userID=<?php
echo $_GET['userID'];
?>
">Manage Permissions</a>)</h3>
<ul>
<?php
$perms = $userACL->perms;
foreach ($perms as $k => $v) {
if ($v['value'] === false) {
continue;
}
echo "\n\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t" . $v['Name'];
if ($v['inheritted']) {