Exemplo n.º 1
0
 static function authorize($roles = null)
 {
     if (!isset($_SESSION["user"]) || SecurityManager::isTimeout() || !SecurityManager::isUserInRoles($roles)) {
         $root = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'];
         Utils::Redirect($root . APP_FOLDER . SecuritySettings::pageAuthorization, false);
     } else {
         SecurityManager::refreshTimeout();
     }
 }
Exemplo n.º 2
0
 static function render()
 {
     $_SESSION["sitemap"] = null;
     if (!isset($_SESSION["sitemap"]) || !$_SESSION["sitemap"]) {
         SitemapManager::initialize();
     }
     SitemapManager::open();
     foreach ($_SESSION["sitemap"]->nodes as $node) {
         if (!SecurityManager::isUserInRoles($node->roles)) {
             continue;
         }
         SitemapManager::renderNode($node);
     }
     SitemapManager::close();
 }