url->register('xorgAuth', 'Xorg', '^auth/(.*)$', array('xorgAuthentifier', 'doAuth')); $core->url->register('xorgLogin', 'XorgLogin', '^admin/(xorg\.php)$', array('xorgLoginPage', 'page')); class xorgAuthWidget { static public function widget(&$w) { global $core; if ($core->auth->xorg_infos['forlife']) { return '
Tu es ' . $core->auth->xorg_infos['prenom'] . ' ' . $core->auth->xorg_infos['nom'] . '
'
. 'déconnexion
M\'authentifier via Polytechnique.org
'; } } } class xorgLoginPage extends dcUrlHandlers { static public function page($args) { switch ($args) { case 'xorg.php': self::dispatchForm(); default: self::p404(); } } static protected function dispatchForm() { # If we have a session cookie, go to index.php if (isset($_SESSION['sess_user_id'])) { header('Location: http://murphy.m4x.org/~x2003bruneau/dotclear/admin/index.php'); } # Loading locales for detected language $dlang = http::getAcceptLanguage(); if ($dlang) { l10n::set(dirname(__FILE__).'/../locales/'.$dlang.'/main'); } global $core; $msg = $err = null; header('Content-Type: text/html; charset=UTF-8'); ?>