本文整理汇总了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>";
?>