本文整理汇总了PHP中AuthManager::isAuth方法的典型用法代码示例。如果您正苦于以下问题:PHP AuthManager::isAuth方法的具体用法?PHP AuthManager::isAuth怎么用?PHP AuthManager::isAuth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AuthManager
的用法示例。
在下文中一共展示了AuthManager::isAuth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkAccess
function checkAccess($methodName)
{
$result = true;
$securedMethods = ["getGoods", "getAdminOrder", "updateGood", "getGood", "getGoodImages", "deleteGood", "getDescriptionKeys", "getGoodsKeys", "getNextGoodCode", "uploadImagesForGood", "updatePrices", "listBooklets", "getBooklet", "saveBooklet", "deleteBooklet", "getBookletBackgrounds", "saveOrder"];
if (in_array($methodName, $securedMethods)) {
$result = isset($_SERVER['HTTPS']) && SessionManager::sessionStart() && AuthManager::isAuth();
}
return $result;
}
示例2: header
<?php
/*header('Content-type: application/json; charset=UTF-8');*/
include_once 'import';
include_once 'admin_pages';
include_once 'service';
$page = $_GET['page'];
if ($page == 'redirect') {
$host = $_SERVER['HTTP_HOST'];
header("Location: https://{$host}/admin/login");
exit;
}
$sessionStarted = SessionManager::sessionStart();
if ($sessionStarted) {
if (AuthManager::isAuth()) {
//AUTH SUCCESS
switch ($page) {
case 'contacts':
$page = new AdminPage_Contacts();
echo $page->getHtml();
break;
case 'prices':
$page = new AdminPage_Prices();
echo $page->getHtml();
break;
case 'tree':
$page = new AdminPage_Tree();
echo $page->getHtml();
break;
case 'goods':
$page = new AdminPage_Goods();