本文整理汇总了PHP中Authenticate::isAdmin方法的典型用法代码示例。如果您正苦于以下问题:PHP Authenticate::isAdmin方法的具体用法?PHP Authenticate::isAdmin怎么用?PHP Authenticate::isAdmin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Authenticate
的用法示例。
在下文中一共展示了Authenticate::isAdmin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
if (!$auth->isLogedin($token, $id)) {
//Not logged in, send to login page.
$msg = isset($_GET['loginerrorfeed']) ? $_GET["loginerrorfeed"] : "";
$smarty->assign("message", $msg);
go_homeforlogin();
$smarty->display("index.tpl");
} else {
//user is loged in and making request
if (isset($_GET["view"])) {
$view = htmlspecialchars($_GET["view"]);
if ($view == "homeView") {
go_homeforlogedin();
} else {
if ($view == "adminView") {
//include_once 'adminmainpage.php';
if (!$auth->isAdmin($_SESSION["user_id"])) {
//direct user to the admin main page
header("Location:../melnet/admin");
} else {
go_homeforlogedin();
}
} else {
if ($view == "totalView") {
//check if user has acces to total view
if ($auth->isUser1($auth->selectSessionData($_SESSION["user_id"]))) {
//direct user to the total homepage
header("Location:../melnet/total");
} else {
go_homeforlogedin();
}
} else {
示例2: Course
go_homeforlogedin();
} else {
if ($view == "userCourses") {
$course = new Course();
$smarty->assign('courses', $course->displayAllCourse());
$smarty->assign('title', '..::ECE_E-Learning:userCouses');
$smarty->assign('mainContent', $smarty->fetch("userCourses.tpl"));
} else {
if ($view == "userEvaluation") {
$smarty->assign('evalHome', $eval->goHome());
$smarty->assign('mainContent', $smarty->fetch("userEvaluation.tpl"));
$smarty->assign('title', '..::ECE_E-Learning:userCourses');
} else {
if ($view == "adminView") {
//include_once 'adminmainpage.php';
if ($auth->isAdmin($auth->selectSessionData($id))) {
//direct user to the admin main page
header("Location:../usr/admin/?suid=" . $id . "token=" . $token . "&view=enable_disableUser");
} else {
go_homeforlogedin();
}
} else {
go_homeforlogedin();
}
}
}
}
}
}
}
}