当前位置: 首页>>代码示例>>PHP>>正文


PHP ACL::getAllPerms方法代码示例

本文整理汇总了PHP中ACL::getAllPerms方法的典型用法代码示例。如果您正苦于以下问题:PHP ACL::getAllPerms方法的具体用法?PHP ACL::getAllPerms怎么用?PHP ACL::getAllPerms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ACL的用法示例。


在下文中一共展示了ACL::getAllPerms方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: foreach

								<a href="perms.php" class="permissions">Permissions</a>
							</li>
							<li>
								<a href="admin_index.php" class="user_admin">User Admin</a>
							</li>
						</ul>
					</div>

					<div id="table-content">
						<div id="page">
							<?php 
if ($_GET['action'] == '') {
    ?>
							<h2>Select a Permission to Manage:</h2>
							<?php 
    $roles = $myACL->getAllPerms('full');
    foreach ($roles as $k => $v) {
        echo "<a href=\"?action=perm&permID=" . $v['ID'] . "\">" . $v['Name'] . "</a><br />";
    }
    if (count($roles) < 1) {
        echo "No permissions yet.<br />";
    }
    ?>
							<input type="button" name="New" value="New Permission" onclick="window.location='?action=perm'" />
							<?php 
}
if ($_GET['action'] == 'perm') {
    if ($_GET['permID'] == '') {
        ?>
							<h2>New Permission:</h2>
							<?php 
开发者ID:juslee,项目名称:e27,代码行数:31,代码来源:perms.php

示例2: foreach

)</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 
    $rPerms = $myACL->getRolePerms($_GET['roleID']);
    $aPerms = $myACL->getAllPerms('full');
    foreach ($aPerms as $k => $v) {
        echo "\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td><label>" . $v['Name'] . "</label></td>";
        echo "<td>\n\t\t\t\t\t\t\t\t\t\t<input type=\"radio\" name=\"perm_" . $v['ID'] . "\" id=\"perm_" . $v['ID'] . "_1\" value=\"1\"";
        if ($rPerms[$v['Key']]['value'] === true && $_GET['roleID'] != '') {
            echo " checked=\"checked\"";
        }
        echo " /></td>";
        echo "<td><input type=\"radio\" name=\"perm_" . $v['ID'] . "\" id=\"perm_" . $v['ID'] . "_0\" value=\"0\"";
        if ($rPerms[$v['Key']]['value'] != true && $_GET['roleID'] != '') {
            echo " checked=\"checked\"";
        }
        echo " /></td>";
        echo "<td><input type=\"radio\" name=\"perm_" . $v['ID'] . "\" id=\"perm_" . $v['ID'] . "_X\" value=\"X\"";
        if ($_GET['roleID'] == '' || !array_key_exists($v['Key'], $rPerms)) {
            echo " checked=\"checked\"";
开发者ID:juslee,项目名称:e27,代码行数:31,代码来源:roles.php

示例3: ACL

							<?php 
if ($_GET['action'] == 'perms') {
    ?>
 <h2>Manage User Permissions: (<?php 
    echo $myACL->getUsername($_GET['userID']);
    ?>
)</h2>
							<form action="users.php" method="post">
								<table border="0" cellpadding="5" cellspacing="0">
									<tr>
										<th></th><th></th>
									</tr>
									<?php 
    $userACL = new ACL($_GET['userID']);
    $rPerms = $userACL->perms;
    $aPerms = $userACL->getAllPerms('full');
    foreach ($aPerms as $k => $v) {
        echo "\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td>" . $v['Name'] . "</td>";
        echo "<td>\n\t\t\t\t\t\t\t\t\t\t<select name=\"perm_" . $v['ID'] . "\">";
        echo "<option value=\"1\"";
        if ($userACL->hasPermission($v['Key']) && $rPerms[$v['Key']]['inheritted'] != true) {
            echo " selected=\"selected\"";
        }
        echo ">Allow</option>";
        echo "<option value=\"0\"";
        if ($rPerms[$v['Key']]['value'] === false && $rPerms[$v['Key']]['inheritted'] != true) {
            echo " selected=\"selected\"";
        }
        echo ">Deny</option>";
        echo "<option value=\"x\"";
        if ($rPerms[$v['Key']]['inheritted'] == true || !array_key_exists($v['Key'], $rPerms)) {
开发者ID:juslee,项目名称:e27,代码行数:31,代码来源:users.php


注:本文中的ACL::getAllPerms方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。