44f9d4307bd1a52450ca6fbfee5230508cb5e441
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 $name = $core->auth
->userID();
10 return '<p>Tu es ' . $core->auth
->getInfo('user_displayname') . '<br />'
11 . '<a href="' . $core->blog
->url
. 'auth/exit">déconnexion</a></p>';
13 return '<p><a href="' . $core->blog
->url
. 'auth/Xorg?path=' . $_SERVER['REQUEST_URI'] . '">M\'authentifier via Polytechnique.org</a></p>';
18 class xorgLoginPage
extends dcUrlHandlers
{
19 static public function page($args) {
28 static protected function dispatchForm() {
29 # If we have a session cookie, go to index.php
30 if (isset($_SESSION['sess_user_id']))
32 header('Location: http://murphy.m4x.org/~x2003bruneau/dotclear/admin/index.php');
35 # Loading locales for detected language
36 $dlang = http
::getAcceptLanguage();
38 l10n
::set(dirname(__FILE__
).'/../locales/'.$dlang.'/main');
43 header('Content-Type: text/html; charset=UTF-8');
45 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
46 <html xmlns
="http://www.w3.org/1999/xhtml"
47 xml
:lang
="en" lang
="en">
49 <meta http
-equiv
="Content-Type" content
="text/html; charset=UTF-8" />
50 <meta http
-equiv
="Content-Script-Type" content
="text/javascript" />
51 <meta http
-equiv
="Content-Style-Type" content
="text/css" />
52 <meta http
-equiv
="Content-Language" content
="en" />
53 <meta name
="MSSmartTagsPreventParsing" content
="TRUE" />
54 <meta name
="ROBOTS" content
="NOARCHIVE,NOINDEX,NOFOLLOW" />
55 <meta name
="GOOGLEBOT" content
="NOSNIPPET" />
56 <title
><?php
echo html
::escapeHTML(DC_VENDOR_NAME
); ?
></title
>
59 echo dcPage
::jsLoadIE7();
60 echo dcPage
::jsCommon();
63 <style type
="text/css">
64 @import
url(style
/default.css
);
67 # --BEHAVIOR-- loginPageHTMLHead
68 $core->callBehavior('loginPageHTMLHead');
72 <body id
="dotclear-admin" class="auth">
74 <form action
="xorg.php" method
="post" id
="login-screen">
75 <h1
><?php
echo html
::escapeHTML(DC_VENDOR_NAME
); ?
></h1
>
79 echo '<div class="error">'.$err.'</div>';
82 echo '<p class="message">'.$msg.'</p>';
88 '<p><a href="http://murphy.m4x.org/~x2003bruneau/dotclear/auth/Xorg?path=/~x2003bruneau/dotclear/admin/index.php">Via Polytechnique.org</a></p>' .
89 '<p><a href="http://murphy.m4x.org/~x2003bruneau/dotclear/admin/auth.php">Via le formulaire</a></p>' .
92 '<p>'.__('You must accept cookies in order to use the private area.').'</p>';
94 if ($core->auth
->allowPassChange()) {
95 echo '<p><a href="auth.php?recover=1">'.__('I forgot my password').'</a></p>';
101 <script type
="text/javascript">
103 $
('input[@name="user_id"]').get(0).focus();
114 class xorgAuthentifier
extends dcUrlHandlers
{
115 static public function doAuth($args) {
119 $core->auth
->killSession();
122 if ($core->auth
->callXorg($_GET['path'])) {
123 header('Location: http://murphy.m4x.org' . $_GET['path']);
128 $core->auth
->returnXorg();