Projet

Général

Profil

Paste
Statistiques
| Branche: | Révision:

ryxeo-glpi-git / index.php @ b67d8923

Historique | Voir | Annoter | Télécharger (6,29 ko)

1
<?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 "
85

86
<p style=\"margin-left: 50px; font-size: 18pt\">Choisissez votre point d'entrée dans notre plate-forme de support technique</p>
87

88
<a href=\"http://www.abuledu.net\"><div style=\"position: absolute; top: 0px; left: 50px; height: 328px;width: 300px;margin-top:100px;margin-left: auto;margin-right: auto;background:url('pics/logo-abuledu.png')  no-repeat;\"></div></a>
89

90
<div style=\"position: absolute; top: 0px; left: 450px; height: 328px;width: 300px;margin-top:100px;margin-left: auto;margin-right: auto;background:url('pics/logo-nouva.png')  no-repeat;\"></div>
91

92

93
";
94

    
95
/*
96
        echo "<div id='contenulogin'>";
97
        
98
        echo "<div id='logo-login'>";
99

100
        echo nl2br(unclean_cross_side_scripting_deep($CFG_GLPI['text_login']));
101

102
        
103
        echo "</div>";
104

105
        echo "<div id='boxlogin'>";
106

107
        echo "<form action='login.php' method='post'>";
108

109
        // Other CAS 
110
        if (isset($_GET["noAUTO"])) {
111
                echo "<input type='hidden' name='noAUTO' value='1' />";
112
        }
113

114
        // redirect to tracking
115
        if (isset($_GET["redirect"])){
116
                manageRedirect($_GET["redirect"]);
117
                echo '<input type="hidden" name="redirect" value="'.$_GET['redirect'].'">';
118
        }
119

120
        echo "<fieldset>";
121
        echo '<legend>'.$LANG["login"][10].'</legend>';
122

123

124
        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>';
125

126

127
        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>';
128

129

130

131
        echo "</fieldset>";
132
        echo '<p ><span> <input type="submit" name="submit" value="'.$LANG["buttons"][2].'" class="submit" /></span></p>';
133
        echo "</form>";
134

135
        echo "<script type='text/javascript' >\n";
136
        echo "document.getElementById('login_name').focus();";
137
        echo "</script>";
138

139
        echo "<p><a href=\"forget.php\">Mot de passe oublié ?</a></p>";
140
        echo "</div>";  // fin box login
141

142

143

144
        echo "<div class='error'>";
145
        echo "<noscript><p>";
146
        echo $LANG["login"][26];
147
        echo "</p></noscript>";
148
        if (isset($_GET['error'])){
149
                switch ($_GET['error']){
150
                        case 1 : // cookie error
151
                                echo $LANG["login"][27];
152
                                break;
153
                        case 2 : // GLPI_SESSION_DIR not writable
154
                                echo $LANG["install"][50].": ".GLPI_SESSION_DIR;
155
                                break;
156
                }
157
        }
158
        echo "</div>";
159

160

161
        // Affichage autorisee FAQ
162
        if ($CFG_GLPI["public_faq"]){
163
                echo '<div id="box-faq"><a href="front/helpdesk.faq.php">[ '.$LANG["knowbase"][24].' ]</a></div>';
164
        }
165
        
166

167
        echo "</div>"; // fin contenu login
168

169
        if ($CFG_GLPI["debug"]==DEMO_MODE){
170
                echo "<div align='center'";
171

172
                $query="SELECT count(*) 
173
                        FROM `glpi_event_log` 
174
                        WHERE message LIKE '%logged in%'";
175

176
                $query2="SELECT date 
177
                        FROM `glpi_event_log` 
178
                        ORDER BY date ASC 
179
                        LIMIT 1";
180

181
                $DB=new DB;
182
                $result=$DB->query($query);
183
                $result2=$DB->query($query2);
184
                $nb_login=$DB->result($result,0,0);
185
                $date=$DB->result($result2,0,0);
186

187
                echo '<b>'.$nb_login.'</b> logins since '.$date ;
188

189
                echo "</div>";
190
        }
191

192

193
        echo "<div id='footer-login'>";
194
        echo "<a href=\"http://glpi-project.org/\" title=\"Powered By Indepnet\"  >";
195
        echo 'GLPI version '.(isset($CFG_GLPI["version"])?$CFG_GLPI["version"]:"").' Copyright (C) 2003-'.date("Y").' INDEPNET Development Team.';
196
        echo "</a>";
197
        echo "</div>";
198

199
*/
200

    
201
}
202
// Appel de cron
203
if ($CFG_GLPI["debug"]!=DEMO_MODE){
204
        callCron();
205
}
206

    
207

    
208
echo "</body></html>";
209

    
210
// End
211

    
212

    
213
?>
Redmine Appliance - Powered by TurnKey Linux