Exemplo n.º 1
0
                echo $page->getHtml();
                break;
            case 'bookletpreview':
                $id = Utils::getFromGET('id');
                $page = new AdminPage_Booklet($id);
                echo $page->getHtml();
                break;
            case 'logout':
                loginRedirect($page);
            default:
                $page = new AdminPage_Goods();
                echo $page->getHtml();
                break;
        }
    } else {
        if ($page == 'login' && AuthManager::makeAuth()) {
            //check AUTH
            $host = $_SERVER['HTTP_HOST'];
            header("Location: https://{$host}/admin/goods");
            exit;
        } else {
            loginRedirect($page);
        }
    }
} else {
    loginRedirect($page);
}
function loginRedirect($page)
{
    SessionManager::sessionDestroy();
    if ($page == 'login') {