Projet

Général

Profil

Paste
Statistiques
| Branche: | Révision:

ryxeo-glpi-git / index_normal.php @ b67d8923

Historique | Voir | Annoter | Télécharger (5,72 ko)

1 b67d8923 Eric Seigne
<?php
2
/*
3
 * @version $Id: index.php 7763 2009-01-06 18:44:50Z moyo $
4
 -------------------------------------------------------------------------
5
 GLPI - Gestionnaire Libre de Parc Informatique
6
 Copyright (C) 2003-2009 by the INDEPNET Development Team.
7

8
 http://indepnet.net/   http://glpi-project.org
9
 -------------------------------------------------------------------------
10

11
 LICENSE
12

13
 This file is part of GLPI.
14

15
 GLPI is free software; you can redistribute it and/or modify
16
 it under the terms of the GNU General Public License as published by
17
 the Free Software Foundation; either version 2 of the License, or
18
 (at your option) any later version.
19

20
 GLPI is distributed in the hope that it will be useful,
21
 but WITHOUT ANY WARRANTY; without even the implied warranty of
22
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
 GNU General Public License for more details.
24

25
 You should have received a copy of the GNU General Public License
26
 along with GLPI; if not, write to the Free Software
27
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
28
 --------------------------------------------------------------------------
29
 */
30
31
// ----------------------------------------------------------------------
32
// Original Author of file:
33
// Purpose of file:
34
// ----------------------------------------------------------------------
35
36
// Test si config_db n'existe pas on lance l'installation
37
38
define('GLPI_ROOT', '.');
39
40
include (GLPI_ROOT . "/config/based_config.php");
41
if(!file_exists(GLPI_CONFIG_DIR . "/config_db.php")) {
42
        include (GLPI_ROOT . "/inc/common.function.php");
43
        glpi_header("install/install.php");
44
        die();
45
}
46
else
47
{
48
        include (GLPI_ROOT . "/inc/includes.php");
49
        $_SESSION["glpitest"]='testcookie';
50
51
        // For compatibility reason
52
        if (isset($_GET["noCAS"])) {
53
                $_GET["noAUTO"]=$_GET["noCAS"];
54
        }
55
        
56
        checkAlternateAuthSystems(true,isset($_GET["redirect"])?$_GET["redirect"]:"");
57
        
58
        // Send UTF8 Headers
59
        header("Content-Type: text/html; charset=UTF-8");
60
        // Start the page
61
62
63
        echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
64
        echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"fr\" lang=\"fr\">";
65
        echo "<head><title>GLPI Login</title>\n";
66
        echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8 \" />\n";
67
        echo "<meta http-equiv=\"Content-Script-Type\" content=\"text/javascript\" />\n";
68
        echo '<link rel="shortcut icon" type="images/x-icon" href="'.$CFG_GLPI["root_doc"].'/pics/favicon.ico" />';
69
70
        // Appel CSS
71
        echo '<link rel="stylesheet"  href="'.$CFG_GLPI["root_doc"].'/css/styles.css" type="text/css" media="screen" />';
72
        // surcharge CSS hack for IE 
73
        echo "<!--[if lte IE 6]>" ; 
74
        echo "<link rel='stylesheet' href='".$CFG_GLPI["root_doc"]."/css/styles_ie.css' type='text/css' media='screen' >\n"; 
75
        echo "<![endif]-->";
76
        echo "<script type=\"text/javascript\"><!--document.getElementById('var_login_name').focus();--></script>";
77
78
        echo "</head>";
79
80
        // Body with configured stuff
81
        echo "<body>";
82
        // contenu
83
84
        echo "<div id='contenulogin'>";
85
        
86
        echo "<div id='logo-login'>";
87
88
        echo nl2br(unclean_cross_side_scripting_deep($CFG_GLPI['text_login']));
89
        
90
        echo "</div>";
91
92
        echo "<div id='boxlogin'>";
93
94
        echo "<form action='login.php' method='post'>";
95
96
        // Other CAS 
97
        if (isset($_GET["noAUTO"])) {
98
                echo "<input type='hidden' name='noAUTO' value='1' />";
99
        }
100
101
        // redirect to tracking
102
        if (isset($_GET["redirect"])){
103
                manageRedirect($_GET["redirect"]);
104
                echo '<input type="hidden" name="redirect" value="'.$_GET['redirect'].'">';
105
        }
106
107
        echo "<fieldset>";
108
        echo '<legend>'.$LANG["login"][10].'</legend>';
109
110
111
        echo '<div class="row"><span class="label"><label>'.$LANG["login"][6].' :  </label></span><span class="formw"> <input type="text" name="login_name" id="login_name" size="15" /></span></div>';
112
113
114
        echo '<div class="row"><span class="label"><label>'.$LANG["login"][7].' : </label></span><span class="formw"><input type="password" name="login_password" id="login_password" size="15" /> </span></div>';
115
116
117
118
119
120
        echo "</fieldset>";
121
        echo '<p ><span> <input type="submit" name="submit" value="'.$LANG["buttons"][2].'" class="submit" /></span></p>';
122
        echo "</form>";
123
124
        echo "<script type='text/javascript' >\n";
125
        echo "document.getElementById('login_name').focus();";
126
        echo "</script>";
127
128
        echo "<p><a href=\"forget.php\">Mot de passe oublié ?</a></p>";
129
        echo "</div>";  // fin box login
130
131
132
133
        echo "<div class='error'>";
134
        echo "<noscript><p>";
135
        echo $LANG["login"][26];
136
        echo "</p></noscript>";
137
        if (isset($_GET['error'])){
138
                switch ($_GET['error']){
139
                        case 1 : // cookie error
140
                                echo $LANG["login"][27];
141
                                break;
142
                        case 2 : // GLPI_SESSION_DIR not writable
143
                                echo $LANG["install"][50].": ".GLPI_SESSION_DIR;
144
                                break;
145
                }
146
        }
147
        echo "</div>";
148
149
150
        // Affichage autorisee FAQ
151
        if ($CFG_GLPI["public_faq"]){
152
                echo '<div id="box-faq"><a href="front/helpdesk.faq.php">[ '.$LANG["knowbase"][24].' ]</a></div>';
153
        }
154
        
155
156
        echo "</div>"; // fin contenu login
157
158
        if ($CFG_GLPI["debug"]==DEMO_MODE){
159
                echo "<div align='center'";
160
161
                $query="SELECT count(*) 
162
                        FROM `glpi_event_log` 
163
                        WHERE message LIKE '%logged in%'";
164
165
                $query2="SELECT date 
166
                        FROM `glpi_event_log` 
167
                        ORDER BY date ASC 
168
                        LIMIT 1";
169
170
                $DB=new DB;
171
                $result=$DB->query($query);
172
                $result2=$DB->query($query2);
173
                $nb_login=$DB->result($result,0,0);
174
                $date=$DB->result($result2,0,0);
175
176
                echo '<b>'.$nb_login.'</b> logins since '.$date ;
177
178
                echo "</div>";
179
        }
180
181
        echo "<div id='footer-login'>";
182
        echo "<a href=\"http://glpi-project.org/\" title=\"Powered By Indepnet\"  >";
183
        echo 'GLPI version '.(isset($CFG_GLPI["version"])?$CFG_GLPI["version"]:"").' Copyright (C) 2003-'.date("Y").' INDEPNET Development Team.';
184
        echo "</a>";
185
        echo "</div>";
186
187
}
188
// Appel de cron
189
if ($CFG_GLPI["debug"]!=DEMO_MODE){
190
        callCron();
191
}
192
193
194
echo "</body></html>";
195
196
// End
197
198
199
?>
Redmine Appliance - Powered by TurnKey Linux