X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fplatal.php;h=4c1f60a8521886e19383b2ba1dad53e083c4bcec;hb=116e335ab867e35a3bda08aea731cd61410d7e70;hp=24a0066a67e0194ed4a8fee1fb4ae15938b53f03;hpb=6d407683b0fcb3bd2550f7554c486df08b9dabcd;p=platal.git diff --git a/classes/platal.php b/classes/platal.php index 24a0066..4c1f60a 100644 --- a/classes/platal.php +++ b/classes/platal.php @@ -1,6 +1,6 @@ __mods[$module] = $m = PLModule::factory($module); $this->__hooks += $m->handlers(); } + + global $globals; + if ($globals->mode == '') { + pl_redirect('index.html'); + } } public function pl_self($n = null) @@ -254,7 +259,7 @@ class Platal } $val = call_user_func_array($hook['hook'], $args); - if ($val & PL_DO_AUTH) { + if ($val == PL_DO_AUTH) { // The handler need a better auth with the current args if (!call_user_func(array($globals->session, 'doAuth'))) { $this->force_login($page); @@ -266,6 +271,7 @@ class Platal public function force_login(PlatalPage &$page) { + header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden'); if (S::logged()) { $page->changeTpl('core/password_prompt_logged.tpl'); $page->addJsLink('do_challenge_response_logged.js');