本文整理汇总了PHP中Access::setUsername方法的典型用法代码示例。如果您正苦于以下问题:PHP Access::setUsername方法的具体用法?PHP Access::setUsername怎么用?PHP Access::setUsername使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Access
的用法示例。
在下文中一共展示了Access::setUsername方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: User
<?php
require_once __DIR__ . "/autoload/session.autoload.php";
require_once __DIR__ . "/class/Network.class.php";
require_once __DIR__ . "/class/User.class.php";
require_once __DIR__ . "/class/Access.class.php";
$User = new User();
$User->checkConnected();
$Access = new Access();
$Access->setUsername($_SESSION['username']);
$Access->setModule('Acheteur');
$Access->isAllowedRedirect();
?>
<!DOCTYPE html>
<html>
<head>
<?php
require_once __DIR__ . "/template/headcode.template.php";
?>
<script type="text/javascript" src="js/acheteur.js"></script>
</head>
<body>
<?php
include __DIR__ . "/template/modal.template.php";
?>
<?php
include __DIR__ . "/template/header.template.php";
?>
示例2: Access
<?php
require_once __DIR__ . "/../class/Access.class.php";
if (isset($_GET)) {
$Access = new Access();
$Access->setUsername($_GET['username']);
$Access->setModule($_GET['module']);
$Access->removeAllowed();
header("location:/users.admin.php?event=removed-allowed");
}
示例3: Access
<?php
require_once __DIR__ . "/../class/Access.class.php";
if (isset($_POST)) {
$Access = new Access();
$Access->setUsername($_POST['username']);
$Access->setModule($_POST['module']);
$Access->addAllowed();
header("location:/users.admin.php?event=added-allowed");
}
示例4: foreach
</tbody>
</table>
</div>
<div class="row-fluid margin-top-2">
<legend>Permissions</legend>
<?php
foreach ($users as $key => $value) {
echo '<div class="row-fluid margin-top-1">';
echo '<div class="span6">';
echo '<p>[' . $value['username'] . ']</p>';
foreach ($modules as $key => $module) {
$Access->setUsername($value['username']);
$Access->setModule($module['module_name']);
if ($Access->isAllowed()) {
echo '<p>' . $module['module_name'] . ' <a href="getcall/deleteallowed.getcall.php?username=' . $value['username'] . '&module=' . $module['module_name'] . '">(Supprimer)</a></p>';
}
}
echo '</div>';
echo '<div class="span6">';
echo '<p>[' . $value['username'] . ']</p>';
echo '<form action="postcall/addallow.postcall.php" method="POST">';
echo '<select name="module">';
foreach ($modules as $key => $module) {
echo '<option name="' . $module['module_name'] . '">' . $module['module_name'] . '</option>';
}
echo '</select>';
echo '<input type="hidden" name="username" value="' . $value['username'] . '">';