ryxeo-glpi-git / htdocs / forget.php @ b069f62c
Historique | Voir | Annoter | Télécharger (10,3 ko)
1 | 1c14bcc4 | Eric Seigne | <?php
|
---|---|---|---|
2 | /*
|
||
3 | -------------------------------------------------------------------------
|
||
4 | GLPI - Gestionnaire Libre de Parc Informatique
|
||
5 | Copyright (C) 2003-2009 by the INDEPNET Development Team.
|
||
6 | Copyright (C) 2009 Eric Seigne <eric.seigne@ryxeo.com>
|
||
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 | define('GLPI_ROOT', '.'); |
||
37 | |||
38 | include (GLPI_ROOT . "/config/based_config.php"); |
||
39 | include_once (GLPI_ROOT . "/inc/dbmysql.class.php"); |
||
40 | include_once (GLPI_ROOT . "/inc/mailing.class.php"); |
||
41 | include_once (GLPI_CONFIG_DIR . "/config_db.php"); |
||
42 | include (GLPI_ROOT . "/inc/includes.php"); |
||
43 | |||
44 | |||
45 | // Send UTF8 Headers
|
||
46 | header("Content-Type: text/html; charset=UTF-8"); |
||
47 | // Start the page
|
||
48 | |||
49 | echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"; |
||
50 | echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"fr\" lang=\"fr\">"; |
||
51 | echo "<head><title>GLPI - Password</title>\n"; |
||
52 | echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8 \" />\n"; |
||
53 | echo "<meta http-equiv=\"Content-Script-Type\" content=\"text/javascript\" />\n"; |
||
54 | echo '<link rel="shortcut icon" type="images/x-icon" href="'.$CFG_GLPI["root_doc"].'/pics/favicon.ico" />'; |
||
55 | |||
56 | //ryxeo
|
||
57 | echo "<link rel='stylesheet' href='".$CFG_GLPI["root_doc"]."/css/navbar.css' type='text/css' />\n"; |
||
58 | echo "<link rel='stylesheet' type='text/css' href='".$CFG_GLPI["root_doc"]."/css/abuledunet-vert.css' media='screen' title='Style par défaut de AbulÉdu.Net' />\n"; |
||
59 | |||
60 | // Appel CSS
|
||
61 | echo '<link rel="stylesheet" href="'.$CFG_GLPI["root_doc"].'/css/styles.css" type="text/css" media="screen" />'; |
||
62 | // surcharge CSS hack for IE
|
||
63 | echo "<!--[if lte IE 6]>" ; |
||
64 | echo "<link rel='stylesheet' href='".$CFG_GLPI["root_doc"]."/css/styles_ie.css' type='text/css' media='screen' >\n"; |
||
65 | echo "<![endif]-->"; |
||
66 | echo "<script type=\"text/javascript\"><!--document.getElementById('var_login_name').focus();--></script>"; |
||
67 | |||
68 | echo "</head>"; |
||
69 | |||
70 | // Body with configured stuff
|
||
71 | echo "<body>"; |
||
72 | |||
73 | //ryxeo
|
||
74 | echo "<body>"; |
||
75 | |||
76 | echo " <div id=\"page\"> |
||
77 | <div id=\"top\">
|
||
78 | <a href=\"/index\"
|
||
79 | title=\"Retouner directement à la page d'accueil\"
|
||
80 | id=\"link_home\"><h1>AbulÉdu.net</h1></a>
|
||
81 | </div>
|
||
82 | <div id=\"navbar\">
|
||
83 | <ul>
|
||
84 | <li><a href=\"http://www.abuledu.org\" id=\"navbar_www\" title=\"Le projet AbulÉdu\" class=\"ttip\">AbulÉdu</a></li>
|
||
85 | <li><a href=\"http://www.abuledu.org/leterrier/\" id=\"navbar_leterrier\" title=\"Les logiciels libres pédagogiques fait par des enseignants dans le cadre du projet AbulÉdu\" class=\"ttip\">LeTerrier</a></li>
|
||
86 | <li><a href=\"http://libre.pedagosite.net/\" id=\"navbar_pedagosite\" title=\"Consultez les ressources pédagogiques réalisées par des enseignants et participez en envoyant vos contributions sur libre.pedagosite.net\" class=\"ttip\">Pédagosite</a></li>
|
||
87 | <li><a href=\"http://docs.abuledu.org/\" id=\"navbar_doc\" title=\"Toute la documentation d'AbulÉdu est disponible sur ce site internet\" class=\"ttip\">Documentation</a></li>
|
||
88 |
|
||
89 | <li><a href=\"http://forum.abuledu.org/\" id=\"navbar_forum\" title=\"Les forums\" class=\"ttip\">Forums</a></li>
|
||
90 | <li><a href=\"http://planete.abuledu.org/\" id=\"navbar_actu\" title=\"Suivez toute l'actualité du projet AbulÉdu sur la planète\" class=\"ttip\">Planète</a></li>
|
||
91 | <li><a href=\"http://www.abuledu.com/\" id=\"navbar_aepro\" title=\"AbulEdu.PRO vous propose un certain nombre de services professionnels.\" class=\"ttip\">Services PRO</a></li>
|
||
92 | b069f62c | root | <li id=\"active\"><a href=\"http://support.abuledu.net/\" id=\"navbar_anet\" title=\"AbulEdu.NET vous permet de gérer vos demandes d'interventions ou de superviser votre parc de serveurs. Ce service n'est disponible qu'aux abonnés au service AbulEdu.NET\" class=\"ttip\">AbulEdu.NET</a></li>
|
93 | 1c14bcc4 | Eric Seigne | <li><a href=\"http://servecole.abuledu.info/admin.php\" id=\"navbar_webadmin\" title=\"Administration de votre serveur AbulÉdu. Attention, Cet outil n'est accessible que si vous êtes à l'interieur d'un réseau AbulÉdu !\" class=\"ttip\">WebAdmin</a></li>
|
94 | </ul>
|
||
95 | <p> </p>
|
||
96 | </div>
|
||
97 |
|
||
98 | <div id=\"navigation\">
|
||
99 | <div id=\"navWiki\">
|
||
100 | <h2>Liens rapides</h2>
|
||
101 | <ul>
|
||
102 | b069f62c | root | <li><a href=\"http://support.abuledu.net/epack/new\">Enregistrement d'un epack</a></li>
|
103 | 1c14bcc4 | Eric Seigne | <li><a href=\"https://secure.ryxeo.com/glpi/index2.php\">Accès partenaires</a></li>
|
104 | <li><a href=\"/forget.php\">Demander un mot de passe</a></li>
|
||
105 | </ul>
|
||
106 | </div>
|
||
107 | <div id=\"nav_connexion\">
|
||
108 | <h2>Connexion</h2>
|
||
109 | <div id=\"user_top_bar\">
|
||
110 | <div id=\"box_unlogged\" class=\"identification_box\">
|
||
111 | b069f62c | root | <li><a href=\"http://support.abuledu.net/aide.pdf\">Aide AbulEdu.NET 2009</a></li>
|
112 | 1c14bcc4 | Eric Seigne | </div>
|
113 | </div>
|
||
114 | </div>
|
||
115 | </div>
|
||
116 | <div id=\"main\">\n";
|
||
117 | |||
118 | // contenu
|
||
119 | |||
120 | echo "<div id='contenulogin'>"; |
||
121 | |||
122 | echo "<div id='logo-login'>"; |
||
123 | |||
124 | echo nl2br(unclean_cross_side_scripting_deep($CFG_GLPI['text_login'])); |
||
125 | |||
126 | |||
127 | echo "</div>"; |
||
128 | |||
129 | |||
130 | if (!isset ($_POST['login_email'])){ |
||
131 | echo "<div id='boxlogin'>"; |
||
132 | |||
133 | echo "<form action='forget.php' method='post'>"; |
||
134 | |||
135 | // Other CAS
|
||
136 | if (isset($_GET["noAUTO"])) { |
||
137 | echo "<input type='hidden' name='noAUTO' value='1' />"; |
||
138 | } |
||
139 | |||
140 | // redirect to tracking
|
||
141 | if (isset($_GET["redirect"])){ |
||
142 | manageRedirect($_GET["redirect"]); |
||
143 | echo '<input type="hidden" name="redirect" value="'.$_GET['redirect'].'">'; |
||
144 | } |
||
145 | |||
146 | echo "<fieldset>"; |
||
147 | echo '<legend>Envoyez-moi mon mot de passe</legend>'; |
||
148 | |||
149 | echo '<div class="row"><span class="label"><label>Adresse email : </label></span><span class="formw"> <input type="text" name="login_email" id="login_email" size="15" /></span></div>'; |
||
150 | |||
151 | echo "</fieldset>"; |
||
152 | echo '<p ><span> <input type="submit" name="submit" value="'.$LANG["buttons"][2].'" class="submit" /></span></p>'; |
||
153 | echo "</form>"; |
||
154 | |||
155 | echo "<script type='text/javascript' >\n"; |
||
156 | echo "document.getElementById('login_name').focus();"; |
||
157 | echo "</script>"; |
||
158 | |||
159 | echo "<p><a href=\"index.php\">Retour à l'accueil</a></p>"; |
||
160 | echo "</div>"; // fin box login |
||
161 | } |
||
162 | //On a tappe l'adresse email
|
||
163 | else {
|
||
164 | |||
165 | function nbAleatoire() { |
||
166 | mt_srand((double)microtime()*1000000); |
||
167 | $num = mt_rand(48, 122); |
||
168 | return $num; |
||
169 | } |
||
170 | |||
171 | function genChar() { |
||
172 | do {
|
||
173 | $num = nbAleatoire();
|
||
174 | } while (( $num > 57 && $num < 65 ) || ( $num > 90 && $num < 97 )); |
||
175 | $char = chr($num); |
||
176 | return $char; |
||
177 | } |
||
178 | |||
179 | function makePassword($size){ |
||
180 | $lepass = ""; |
||
181 | for($i=1; $i<=$size; $i++) { |
||
182 | $lepass = $lepass . genChar(); |
||
183 | } |
||
184 | $lepass = strtolower($lepass); |
||
185 | return $lepass; |
||
186 | } |
||
187 | |||
188 | $query="SELECT name FROM `glpi_users` WHERE email='" . addslashes($_POST['login_email']) . "'"; |
||
189 | $DB=new DB(); |
||
190 | $result=$DB->query($query); |
||
191 | $login=$DB->result($result,0,0); |
||
192 | if($login != "") { |
||
193 | $password=makePassword(8); |
||
194 | $password_md5=md5($password); |
||
195 | $query2="UPDATE `glpi_users` SET password_md5='" . $password_md5 . "' WHERE email='" . addslashes($_POST['login_email']) . "'"; |
||
196 | $DB->query($query2) or die("Error: ".$DB->error()); |
||
197 | |||
198 | $email = " |
||
199 |
|
||
200 | Bonjour,
|
||
201 | vous trouverez ci-dessous les informations vous permettant de vous connecter
|
||
202 | sur la plate-forme de suivi abuledu.net:
|
||
203 |
|
||
204 | - Votre identifiant: $login
|
||
205 | - Votre mot de passe: $password
|
||
206 | b069f62c | root | - Adresse de connexion: http://support.abuledu.net/
|
207 | 1c14bcc4 | Eric Seigne |
|
208 | Lorsque vous serez sur le site internet en question vous pourrez télécharger
|
||
209 | un fichier d'aide (présent dans le menu gauche du site).
|
||
210 |
|
||
211 | Nous vous conseillons d'utiliser le navigateur libre firefox pour accéder à
|
||
212 | b069f62c | root | support.abuledu.net
|
213 | 1c14bcc4 | Eric Seigne |
|
214 | Cordialement,
|
||
215 | RyXéo
|
||
216 |
|
||
217 | --
|
||
218 | RyXéo SARL - Maison éditrice d'AbulÉdu
|
||
219 | 21 Avenue E. et M. Dulout
|
||
220 | 33600 Pessac
|
||
221 | ";
|
||
222 | |||
223 | $mmail=new glpi_phpmailer(); |
||
224 | $mmail->From=$CFG_GLPI["admin_email"]; |
||
225 | $mmail->FromName=$CFG_GLPI["admin_email"]; |
||
226 | $mmail->AddAddress($_POST['login_email'],""); |
||
227 | //Copy to admin
|
||
228 | $mmail->AddBCC($CFG_GLPI["admin_email"], "GLPI"); |
||
229 | $mmail->Subject="[SUPPORT RYXEO] -- MOT DE PASSE -- "; |
||
230 | $mmail->Body=$email; |
||
231 | |||
232 | if (!$mmail->Send()) { |
||
233 | echo "Erreur"; |
||
234 | } |
||
235 | else {
|
||
236 | echo "Votre mot de passe a été envoyé par email"; |
||
237 | } |
||
238 | } |
||
239 | else {
|
||
240 | |||
241 | echo "<div class='error'>"; |
||
242 | echo "<noscript><p>"; |
||
243 | echo $LANG["login"][26]; |
||
244 | echo "</p></noscript>"; |
||
245 | if (isset($_GET['error'])){ |
||
246 | switch ($_GET['error']){ |
||
247 | case 1 : // cookie error |
||
248 | echo $LANG["login"][27]; |
||
249 | break;
|
||
250 | case 2 : // GLPI_SESSION_DIR not writable |
||
251 | echo $LANG["install"][50].": ".GLPI_SESSION_DIR; |
||
252 | break;
|
||
253 | } |
||
254 | } |
||
255 | echo "Identifiant inconnu !"; |
||
256 | echo "</div>"; |
||
257 | } |
||
258 | |||
259 | } |
||
260 | |||
261 | echo "</div>"; // fin contenu login |
||
262 | |||
263 | echo "<div id='footer-login'>"; |
||
264 | echo "<a href=\"http://glpi-project.org/\" title=\"Powered By Indepnet\" >"; |
||
265 | echo 'GLPI version '.(isset($CFG_GLPI["version"])?$CFG_GLPI["version"]:"").' Copyright (C) 2003-'.date("Y").' INDEPNET Development Team.'; |
||
266 | echo "</a>"; |
||
267 | echo "</div>"; |
||
268 | |||
269 | |||
270 | //ryxeo
|
||
271 | echo " </div> |
||
272 | <p id=\"footer\">
|
||
273 | <a id=\"ryxeo\" href=\"http://www.ryxeo.com\">
|
||
274 | <img src=\"" . $CFG_GLPI["root_doc"] . "/pics/abuledu/logo_ryxeo.png\" alt=\"Hébergé par RyXeo\"/> |
||
275 | </a>
|
||
276 | <!--
|
||
277 | accueil.txt · Dernière modification: 2007/06/07 19:46 par bafriss · -->
|
||
278 |
|
||
279 | <a href=\"http://www.ubuntu-fr.org/\" title=\"Squelette wiki inspire de celui de ubuntu-fr.org\">Squelette wiki inspire de celui de ubuntu-fr.org !</a>
|
||
280 | - Propulsé par AbulEdu.NET
|
||
281 | </div>
|
||
282 | </div>
|
||
283 | ";
|
||
284 | |||
285 | echo "</body></html>"; |
||
286 | |||
287 | // End
|
||
288 | |||
289 | |||
290 | ?> |