<?php
/***************************************************************************
- * Copyright (C) 2003-2007 Polytechnique.org *
+ * Copyright (C) 2003-2008 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
$this->__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)
}
$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);
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');