new_skinned_page('index.tpl', AUTH_PUBLIC);
if (empty($this->path)) {
- $page->run();
- }
-
+ $this->__mods['core']->handler_index($page);
+ } else
switch ($this->call_hook($page)) {
case PL_FORBIDDEN:
$this->__mods['core']->handler_403($page);
$globals->menu->addPrivateEntry(XOM_ADMIN, 00, 'Marketing', 'marketing');
$globals->menu->addPrivateEntry(XOM_ADMIN, 10, 'Administration', 'admin/');
- $globals->menu->addPrivateEntry(XOM_ADMIN, 20, 'Clear cache', 'clear_all_cache.php');
+ $globals->menu->addPrivateEntry(XOM_ADMIN, 20, 'Clear cache', 'purge_cache');
$globals->menu->addPrivateEntry(XOM_ADMIN, 30, 'Trackers', 'http://trackers.polytechnique.org');
$globals->menu->addPrivateEntry(XOM_ADMIN, 40, 'Support', 'http://support.polytechnique.org');
-DirectoryIndex test.php index.php
-
Options +FollowSymLinks
RewriteEngine on
# Rewrite URLs of the form 'index.php?q=x':
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
-RewriteRule ^(.*)$ test.php?p=$1 [L,QSA]
+RewriteRule ^(.*)$ index.php?p=$1 [L,QSA]
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- ***************************************************************************/
-
-require_once("xorg.inc.php");
-require_once("wiki.inc.php");
-
-new_skinned_page('index.tpl', AUTH_COOKIE);
-$page->clear_compiled_tpl();
-wiki_clear_all_cache();
-
-redirect(empty($_SERVER['HTTP_REFERER']) ? 'index.php' : $_SERVER['HTTP_REFERER']);
-
-?>
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- ***************************************************************************/
-require_once("xorg.inc.php");
-new_skinned_page('index.tpl', AUTH_PUBLIC);
-if (logged()) {
- redirect("login.php");
-}
-$page->run();
-?>
'403' => $this->make_hook('403', AUTH_PUBLIC),
'404' => $this->make_hook('404', AUTH_PUBLIC),
'exit' => $this->make_hook('exit', AUTH_PUBLIC),
+ 'purge_cache' => $this->make_hook('purge_cache', AUTH_COOKIE, 'admin')
);
}
+ function handler_index(&$page)
+ {
+ if (logged()) {
+ redirect("login.php");
+ }
+
+ return PL_OK;
+ }
+
function handler_exit(&$page, $level = null)
{
if (Session::has('suid')) {
$page->changeTpl('404.tpl');
return PL_OK;
}
+
+ function handler_purge_cache(&$page)
+ {
+ require_once 'wiki.inc.php';
+
+ $page->clear_compiled_tpl();
+ wiki_clear_all_cache();
+
+ redirect(empty($_SERVER['HTTP_REFERER']) ? './' : $_SERVER['HTTP_REFERER']);
+ }
}
?>