本文整理匯總了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();