2 $core->url
->register('xorgAuth', 'Xorg', '^auth/(.*)$', array('xorgAuthentifier', 'doAuth'));
3 $core->url
->register('xorgLogin', 'XorgLogin', '^admin/(xorg\.php)$', array('xorgLoginPage', 'page'));
6 static public function widget(&$w) {
8 if ($core->auth
->xorg_infos
['forlife']) {
9 return '<p>Tu es ' . $core->auth
->xorg_infos
['prenom'] . ' ' . $core->auth
->xorg_infos
['nom'] . '<br />'
10 . '<a href="auth/exit">déconnexion</a></p>';
12 return '<p><a href="auth/Xorg?path=' . $_SERVER['REQUEST_URI'] . '">M\'authentifier via Polytechnique.org</a></p>';
17 class xorgLoginPage
extends dcUrlHandlers
{
18 static public function page($args) {
27 static protected function dispatchForm() {
28 # If we have a session cookie, go to index.php
29 if (isset($_SESSION['sess_user_id']))
31 header('Location: http://murphy.m4x.org/~x2003bruneau/dotclear/admin/index.php');
34 # Loading locales for detected language
35 $dlang = http
::getAcceptLanguage();
37 l10n
::set(dirname(__FILE__
).'/../locales/'.$dlang.'/main');
42 header('Content-Type: text/html; charset=UTF-8');
44 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
45 <html xmlns
="http://www.w3.org/1999/xhtml"
46 xml
:lang
="en" lang
="en">
48 <meta http
-equiv
="Content-Type" content
="text/html; charset=UTF-8" />
49 <meta http
-equiv
="Content-Script-Type" content
="text/javascript" />
50 <meta http
-equiv
="Content-Style-Type" content
="text/css" />
51 <meta http
-equiv
="Content-Language" content
="en" />
52 <meta name
="MSSmartTagsPreventParsing" content
="TRUE" />
53 <meta name
="ROBOTS" content
="NOARCHIVE,NOINDEX,NOFOLLOW" />
54 <meta name
="GOOGLEBOT" content
="NOSNIPPET" />
55 <title
><?php
echo html
::escapeHTML(DC_VENDOR_NAME
); ?
></title
>
58 echo dcPage
::jsLoadIE7();
59 echo dcPage
::jsCommon();
62 <style type
="text/css">
63 @import
url(style
/default.css
);
66 # --BEHAVIOR-- loginPageHTMLHead
67 $core->callBehavior('loginPageHTMLHead');
71 <body id
="dotclear-admin" class="auth">
73 <form action
="xorg.php" method
="post" id
="login-screen">
74 <h1
><?php
echo html
::escapeHTML(DC_VENDOR_NAME
); ?
></h1
>
78 echo '<div class="error">'.$err.'</div>';
81 echo '<p class="message">'.$msg.'</p>';
87 '<p><a href="http://murphy.m4x.org/~x2003bruneau/dotclear/auth/Xorg?path=/~x2003bruneau/dotclear/admin/index.php">Via Polytechnique.org</a></p>' .
88 '<p><a href="http://murphy.m4x.org/~x2003bruneau/dotclear/admin/auth.php">Via le formulaire</a></p>' .
91 '<p>'.__('You must accept cookies in order to use the private area.').'</p>';
93 if ($core->auth
->allowPassChange()) {
94 echo '<p><a href="auth.php?recover=1">'.__('I forgot my password').'</a></p>';
100 <script type
="text/javascript">
102 $
('input[@name="user_id"]').get(0).focus();
113 class xorgAuthentifier
extends dcUrlHandlers
{
114 static public function doAuth($args) {
118 $core->auth
->killSession();
121 if ($core->auth
->callXorg($_GET['path'])) {
122 header('Location: http://murphy.m4x.org' . $_GET['path']);
127 $core->auth
->returnXorg();