本文整理匯總了PHP中UserController::isAdmin方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserController::isAdmin方法的具體用法?PHP UserController::isAdmin怎麽用?PHP UserController::isAdmin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UserController
的用法示例。
在下文中一共展示了UserController::isAdmin方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: switch
switch ($_POST['action']) {
// User Methods
case "createUser":
$UserController->createUser();
break;
case "deleteUser":
$UserController->deleteUser();
break;
case "getUser":
$UserController->getUser();
break;
case "checkLoggedIn":
$UserController->checkLoggedIn();
break;
case "isAdmin":
$UserController->isAdmin();
break;
case "login":
$UserController->login();
break;
case "logout":
$UserController->logout();
break;
// Project Methods
// Project Methods
case "createProject":
$ProjectController->createProject();
break;
case "deleteProject":
$ProjectController->deleteProject();
break;
示例2: htmlentities
<?php
require 'Controllers/class.UserController.inc';
echo 'Hello <b>' . htmlentities($_SESSION['user_name']);
$u = new UserController($_SESSION['user_name']);
// check if the user is admin
// Only admins can create new Categories
echo "<p>";
if ($u->isAdmin() && $_SESSION['signed_in'] == true) {
echo '<br><a href="cat.php">Make New Category</a>';
}
echo "<br><a href='thread.php'>Make New Thread</a></p>";
?>