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


PHP fAuthorization::requireAuthLevel方法代码示例

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


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

示例1:

<?php

include './resources/init.php';
fAuthorization::requireAuthLevel('super');
$tmpl->place('header');
?>
<script type="text/javascript" src="./resources/library/jquery.autocomplete/jquery.autocomplete.min.js"></script>
<script type="text/javascript" src="./resources/library/jquery.autocomplete/lib/jquery.bgiframe.min.js"></script>
<script type="text/javascript" src="./resources/library/jquery.blockUI.js"></script>
<link media="screen, projection" href="./resources/library/jquery.autocomplete/jquery.autocomplete.css" type="text/css" rel="stylesheet"/>
<script type="text/javascript" src="./js/admin-stock.js"></script>
<?php 
$tmpl->place('menu');
?>
<div id="content" class="span-24 last">
	<?php 
$tmpl->place('menuAdmin');
?>
	<div id="main" class="span-24 last">
		<h2>Administration</h2><h3>Stock</h3>
		<br />
		<form action = "admin-stock.php" method = "get">
			<label for="inv_item">Choose Inventory Item: </label>
			<span id="inv_item">
				<input id="autocompleteItem" name="item"></input>
			</span>
			<input id="submitBTN" type="submit" value="Submit" />
		</form>
		<?php 
if (isset($_GET['item'])) {
    try {
开发者ID:JhunCabas,项目名称:material-management,代码行数:31,代码来源:admin-stock.php

示例2: Supplier

<?php

include './resources/init.php';
fAuthorization::requireAuthLevel('admin');
$tmpl->place('header');
?>
<script type="text/javascript" src="./js/admin-supplier-view.js"></script>
</head>
<body>
<div class = "container">
	<div id="View" class = "view-frame span-23 last">
		<?php 
if (!isset($_GET['id'])) {
    echo "<div class=\"ui-state-error ui-corner-all\">\n\t\t\t\t\t\t<span class=\"ui-icon ui-icon-alert\" style=\"float: left; margin-right: 30px;\"></span>\n\t\t\t\t\t\tYou arrived to this page in error</div>";
} else {
    try {
        $supplier = new Supplier($_GET['id']);
        ?>
		<h2><span id="titleName"><?php 
        echo $supplier->prepareName();
        ?>
</span></h2>
		<input id="key" type="hidden" value="<?php 
        echo $supplier->prepareId();
        ?>
" />
		<table>
			<tr>
				<td width="100"><b>Name</b></td>
				<td><span id="supName" class="varInput"><?php 
        echo $supplier->prepareName();
开发者ID:JhunCabas,项目名称:material-management,代码行数:31,代码来源:admin-supplier-view.php

示例3: testRequireAuthLevel

 public function testRequireAuthLevel()
 {
     fAuthorization::setLoginPage('/login/');
     fAuthorization::setAuthLevels(array('user' => 20, 'admin' => 50));
     fAuthorization::setUserAuthLevel('admin');
     $this->assertEquals(NULL, fAuthorization::requireAuthLevel('admin'));
     // This is a gross cli wrapper script since we have to test for exit
     $code = "fAuthorization::setLoginPage('/login/');";
     $code .= "fAuthorization::setAuthLevels(array('user' => 20, 'admin' => 50));";
     $code .= "fAuthorization::setUserAuthLevel('user');";
     $code .= "fAuthorization::requireAuthLevel('admin');";
     $this->assertEquals('http://example.com/login/', shell_exec('php ' . TEST_EXIT_SCRIPT . ' ' . escapeshellarg($code)));
 }
开发者ID:nurulimamnotes,项目名称:flourish-old,代码行数:13,代码来源:fAuthorizationTest.php


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