function handlers() { die("implement me"); }
function menu_entries() { die("implement me"); }
- function make_hook($fun, $auth, $perms, $type = SKINNED)
+ function make_hook($fun, $auth, $perms = '', $type = SKINNED)
{
- return array('hook' => array($this, $fun),
+ return array('hook' => array($this, 'handler_'.$fun),
'auth' => $auth,
- 'perms' => split('[ ,|]', $perms),
+ 'perms' => $perms,
'type' => $type);
}
{
$p = $this->path;
- while ($path) {
+ while ($p) {
if (array_key_exists($p, $this->__hooks))
break;
--- /dev/null
+DirectoryIndex test.php index.php
+
+Options +FollowSymLinks
+RewriteEngine on
+
+RewriteBase /~x2000habouzit
+
+# wiki
+
+RewriteRule ^([A-Z].*) wiki.php?n=$1 [L,QSA]
+
+# Rewrite URLs of the form 'index.php?q=x':
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule ^(.*)$ test.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');
-
-if (isset($_SESSION['suid'])) { require_once('./exit.php'); }
-
-if (Get::has('forget')) {
- setcookie('ORGaccess', '', time() - 3600, '/', '', 0);
- Cookie::kill('ORGaccess');
- if (isset($_SESSION['log']))
- $_SESSION['log']->log("cookie_off");
-}
-
-if (Get::has('forgetUid')) {
- setcookie('ORGuid', '', time() - 3600, '/', '', 0);
- Cookie::kill('ORGuid');
- setcookie('ORGdomain', '', time() - 3600, '/', '', 0);
- Cookie::kill('ORGdomain');
-}
-
-if (isset($_SESSION['log'])) {
- $ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
- $_SESSION['log']->log('deconnexion',$ref);
-}
-
-XorgSession::destroy();
-
-if (Get::has('redirect')) {
- redirect(rawurldecode(Get::get('redirect')));
-} else {
- new_skinned_page('deconnexion.tpl', AUTH_PUBLIC);
- $page->run();
-}
-
-// vim:set et sws=4 sts=4 sw=4:
-?>
+++ /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_MDP);
-
-if (Session::has('suid')) {
- $a4l = Session::get('forlife');
- $suid = Session::getMixed('suid');
- $log = Session::getMixed('log');
- $log->log("suid_stop", Session::get('forlife') . " by " . $suid['forlife']);
- $_SESSION = $suid;
- Session::kill('suid');
- redirect($globals->baseurl.'/admin/utilisateurs.php?login='.$a4l);
-} else {
- redirect("login.php");
-}
-
-?>
{
$res = logged() ? $this->_int : $this->_ext;
if (identified()) {
- $res[XOM_NO][] = Array(0, 'text' => 'Déconnexion', 'url' => 'deconnexion.php');
+ $res[XOM_NO][] = Array(0, 'text' => 'Déconnexion', 'url' => 'exit');
} elseif (Cookie::has('ORGaccess')) {
- $res[XOM_NO][] = Array(0, 'text' => 'Déconnexion totale', 'url' => 'deconnexion.php?forget=1');
+ $res[XOM_NO][] = Array(0, 'text' => 'Déconnexion totale', 'url' => 'exit/forget');
}
if (!has_perms()) {
unset($res[XOM_ADMIN]);
function handlers()
{
return array(
- '403' => $this->make_hook('handler_403', AUTH_PUBLIC, ''),
- '404' => $this->make_hook('handler_404', AUTH_PUBLIC, ''),
+ '403' => $this->make_hook('403', AUTH_PUBLIC),
+ '404' => $this->make_hook('404', AUTH_PUBLIC),
+ 'exit' => $this->make_hook('exit', AUTH_PUBLIC),
);
}
- function handler_auth(&$page)
+ function handler_exit(&$page, $level = null)
{
+ if (Session::has('suid')) {
+ if (Session::has('suid')) {
+ $a4l = Session::get('forlife');
+ $suid = Session::getMixed('suid');
+ $log = Session::getMixed('log');
+ $log->log("suid_stop", Session::get('forlife') . " by " . $suid['forlife']);
+ $_SESSION = $suid;
+ Session::kill('suid');
+ redirect($globals->baseurl.'/admin/utilisateurs.php?login='.$a4l);
+ } else {
+ redirect("login.php");
+ }
+ }
+
+ if ($level == 'forget' || $level == 'forgetall') {
+ setcookie('ORGaccess', '', time() - 3600, '/', '', 0);
+ Cookie::kill('ORGaccess');
+ if (isset($_SESSION['log']))
+ $_SESSION['log']->log("cookie_off");
+ }
+
+ if ($level == 'forgetuid' || $level == 'forgetall') {
+ setcookie('ORGuid', '', time() - 3600, '/', '', 0);
+ Cookie::kill('ORGuid');
+ setcookie('ORGdomain', '', time() - 3600, '/', '', 0);
+ Cookie::kill('ORGdomain');
+ }
+
+ if (isset($_SESSION['log'])) {
+ $ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
+ $_SESSION['log']->log('deconnexion',$ref);
+ }
+
+ XorgSession::destroy();
+
+ if (Get::has('redirect')) {
+ redirect(rawurldecode(Get::get('redirect')));
+ } else {
+ $page->changeTpl('exit.tpl');
+ }
return PL_OK;
}
des fonctionnalités de consultation du site.
</p>
<p>
-Tu peux donc aussi te <a href='?forget=1'>deconnecter complètement</a>.
+Tu peux donc aussi te <a href='{rel}/exit/forget'>deconnecter complètement</a>.
</p>
<p>
De plus, ton adresse e-mail est toujours en mémoire dans ton navigateur afin de faciliter ta
prochaine connexion. Si tu utilises un ordinateur public ou que tu désires l'effacer, tu peux
-<a href='?forgetUid=1&forget=1'>supprimer cette information et te déconnecter complètement</a>.
+<a href='{rel}/exit/forgetall'>supprimer cette information et te déconnecter complètement</a>.
</p>
{elseif $smarty.cookies.ORGuid}
<p>
Ton adresse e-mail est toujours en mémoire dans ton navigateur afin de faciliter ta prochaine
connexion. Si tu utilises un ordinateur public ou que tu désires l'effacer, tu peux
-<a href='?forgetUid=1'>supprimer cette information</a>.
+<a href='{rel}/exit/forgetuid'>supprimer cette information</a>.
</p>
{/if}
<tr>
<td>
{$smarty.session.suid} ({$smarty.session.forlife})
- [<a href="{rel}/exit.php">exit</a>]
+ [<a href="{rel}/exit">exit</a>]
</td>
</tr>
</table>
<tr>
<td>
{$smarty.session.suid} ({$smarty.session.forlife})
- [<a href="{"exit.php"|url}">exit</a>]
+ [<a href="{rel}/exit">exit</a>]
</td>
</tr>
</table>
<tr>
<td>
{$smarty.session.suid} ({$smarty.session.forlife})
- [<a href="{"exit.php"|url}">exit</a>]
+ [<a href="{rel}/exit">exit</a>]
</td>
</tr>
</table>
<tr>
<td>
{$smarty.session.suid} ({$smarty.session.forlife})
- [<a href="{"exit.php"|url}">exit</a>]
+ [<a href="{rel}/exit">exit</a>]
</td>
</tr>
</table>
<tr>
<td>
{$smarty.session.suid} ({$smarty.session.forlife})
- [<a href="{"exit.php"|url}">exit</a>]
+ [<a href="{rel}/exit">exit</a>]
</td>
</tr>
</table>
<tr>
<td>
{$smarty.session.suid} ({$smarty.session.forlife})
- [<a href="{"exit.php"|url}">exit</a>]
+ [<a href="{rel}/exit">exit</a>]
</td>
</tr>
</table>
<tr>
<td>
{$smarty.session.suid} ({$smarty.session.forlife})
- [<a href="{"exit.php"|url}">exit</a>]
+ [<a href="{rel}/exit">exit</a>]
</td>
</tr>
</table>
<tr>
<td>
{$smarty.session.suid} ({$smarty.session.forlife})
- [<a href="{"exit.php"|url}">exit</a>]
+ [<a href="{rel}/exit">exit</a>]
</td>
</tr>
</table>
<tr>
<td>
{$smarty.session.suid} ({$smarty.session.forlife})
- [<a href="{rel}/exit.php">exit</a>]
+ [<a href="{rel}/exit">exit</a>]
</td>
</tr>
</table>
<tr>
<td>
{$smarty.session.suid} ({$smarty.session.forlife})
- [<a href="{"exit.php"|url}">exit</a>]
+ [<a href="{rel}/exit">exit</a>]
</td>
</tr>
</table>
<tr>
<td>
{$smarty.session.suid} ({$smarty.session.forlife})
- [<a href="{"exit.php"|url}">exit</a>]
+ [<a href="{rel}/exit">exit</a>]
</td>
</tr>
</table>
<tr>
<td>
{$smarty.session.suid} ({$smarty.session.forlife})
- [<a href="{"exit.php"|url}">exit</a>]
+ [<a href="{rel}/exit">exit</a>]
</td>
</tr>
</table>