Use $core->blog->url when possible.
[dotclear.git] / page.auth.admin.php
CommitLineData
b519995b
FB
1<?php
2
3class xorgLoginPage extends dcUrlHandlers {
4 static public function page($args) {
5 switch ($args) {
6 case 'xorg.php':
7 self::dispatchForm();
8 default:
9 self::p404();
10 }
11 }
12
13 static protected function dispatchForm() {
14 # If we have a session cookie, go to index.php
15 if (isset($_SESSION['sess_user_id']))
16 {
9d447124
FB
17 global $core;
18 header('Location: ' . $core->blog->url . 'admin/index.php');
b519995b
FB
19 }
20
21 # Loading locales for detected language
22 $dlang = http::getAcceptLanguage();
23 if ($dlang) {
24 l10n::set(dirname(__FILE__).'/../locales/'.$dlang.'/main');
25 }
26
27 global $core;
28 $msg = $err = null;
29 header('Content-Type: text/html; charset=UTF-8');
30 ?>
31 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
32 <html xmlns="http://www.w3.org/1999/xhtml"
33 xml:lang="en" lang="en">
34 <head>
35 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
36 <meta http-equiv="Content-Script-Type" content="text/javascript" />
37 <meta http-equiv="Content-Style-Type" content="text/css" />
38 <meta http-equiv="Content-Language" content="en" />
39 <meta name="MSSmartTagsPreventParsing" content="TRUE" />
40 <meta name="ROBOTS" content="NOARCHIVE,NOINDEX,NOFOLLOW" />
41 <meta name="GOOGLEBOT" content="NOSNIPPET" />
42 <title><?php echo html::escapeHTML(DC_VENDOR_NAME); ?></title>
43
44 <?php
45 echo dcPage::jsLoadIE7();
46 echo dcPage::jsCommon();
47 ?>
48
49 <style type="text/css">
50 @import url(style/default.css);
51 </style>
52 <?php
53 # --BEHAVIOR-- loginPageHTMLHead
54 $core->callBehavior('loginPageHTMLHead');
55 ?>
56 </head>
57
58 <body id="dotclear-admin" class="auth">
59
60 <form action="xorg.php" method="post" id="login-screen">
61 <h1><?php echo html::escapeHTML(DC_VENDOR_NAME); ?></h1>
62
63 <?php
64 if ($err) {
65 echo '<div class="error">'.$err.'</div>';
66 }
67 if ($msg) {
68 echo '<p class="message">'.$msg.'</p>';
69 }
70
71 {
72 echo
73 '<fieldset>'.
9d447124
FB
74 '<p><a href="' . $core->blog->url . 'auth/Xorg?path=/~x2003bruneau/dotclear/admin/index.php">Via Polytechnique.org</a></p>' .
75 '<p><a href="' . $core->blog->url . 'admin/auth.php">Via le formulaire</a></p>' .
b519995b
FB
76 '</fieldset>'.
77
78 '<p>'.__('You must accept cookies in order to use the private area.').'</p>';
79
80 if ($core->auth->allowPassChange()) {
81 echo '<p><a href="auth.php?recover=1">'.__('I forgot my password').'</a></p>';
82 }
83 }
84 ?>
85 </form>
86
87 <script type="text/javascript">
88 //<![CDATA[
89 $('input[@name="user_id"]').get(0).focus();
90 //]]>
91 </script>
92
93 </body>
94 </html>
95<?php
96 exit;
97 }
98}
99
100?>