-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathTianguisCabalOlvidarPass.php
400 lines (369 loc) · 14.9 KB
/
TianguisCabalOlvidarPass.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="FixAnotherMSIEBug.xsl"?>
<?php
include( "includes/TianguisCabalFunctions.inc" );
include( "includes/TianguisCabalROEnviron.inc" );
require_once( "/etc/TianguisCabal.inc" );
if( @$_POST{'Accion'} == "CambiaPWD" )
{
if( !@$_POST{'UserID'} )
{
header( "Location: MensajeError.php?Errno=2211&Lang=$Lang&From=$From" );
//Falta Non User suplied Campos Obligatorios
exit();
}
if( !@$_POST{'PNuevo'} || !@$_POST{'PVer'} )
{
header( "Location: MensajeError.php?Errno=2207&Lang=$Lang&From=$From" );
//Falta Campos Obligatorios
exit();
}
if( @$_POST{'PNuevo'} !== $_POST{'PVer'} )
{
header( "Location: MensajeError.php?Errno=2208&Lang=$Lang&From=$From" );
//Contraseñas No son Egual
exit();
}
if( !IsPWDSeguro( $_POST{'PNuevo'} ) )
{
header( "Location: MensajeError.php?Errno=2209&Lang=$Lang&From=$From" );
//PWD no está Seguro
exit();
}
$PWD = md5( $_POST{'PNuevo'} );
$Conn = mysqli_init();
mysqli_options($Conn, MYSQLI_INIT_COMMAND, "SET AUTOCOMMIT=1");
mysqli_options($Conn, MYSQLI_OPT_CONNECT_TIMEOUT, 5);
mysqli_real_connect( $Conn, 'localhost', $Clase, $AccessType,
'TianguisCabal', MYSQLI_CLIENT_SSL );
if( mysqli_connect_errno() )
{
mysqli_close( $Conn );
header( "Location: MensajeError.php?Errno=2206&Lang=$Lang&From=$From" );
exit();
}
$Query = "update Vendedores set PWD = '{$PWD}', Fecha = CURDATE()
where UserID = {$_POST{'UserID'}}";
if( !$QueryRes = mysqli_query( $Conn, $Query ) )
{
mysqli_close( $Conn );
header( "Location: MensajeError.php?Errno=2210&Lang=$Lang&From=$From" );
//No puede insert PWD
exit();
}
unlink( $_POST{'FileName'} );
$Block = " <p class=\"SubTitleFont\" style=\"font-weight:bold;
color:#0000aa; text-align:center;\">";
if( $Lang == ' en' )
$Block .= "-= Cambio de Tu Contraseña =-
<br />
¡ CONFIRMADA !";
else
$Block .= "-= Password Change =-
<br />
CONFIRMED!";
$Block .= "<br />
</p>";
}
elseif( @$_POST{'Accion'} == "EnviarLiga" )
{
if( !@$_POST{'Correo'} )
{
mysqli_close( $Conn );
header( "Location: MensajeError.php?Errno=2202&Lang=$Lang&From=$From" );
exit();
}
require_once('recaptchalib.php');
$publickey = $CaptchaPubKey;
$privatekey = $CaptchaPrivKey;
$resp = recaptcha_check_answer ($privatekey,
$_SERVER{'REMOTE_ADDR'},
$_POST{'recaptcha_challenge_field'},
$_POST{'recaptcha_response_field'});
if (!$resp->is_valid)
{
header( "Location: MensajeError.php?Errno=2203&Lang=$Lang&From=$From" );
//Captcha Validation Error
exit();
}
$Conn = mysqli_init();
mysqli_options($Conn, MYSQLI_INIT_COMMAND, "SET AUTOCOMMIT=1");
mysqli_options($Conn, MYSQLI_OPT_CONNECT_TIMEOUT, 5);
mysqli_real_connect( $Conn, 'localhost', $ClaseRO, $AccessTypeRO,
'TianguisCabal', MYSQLI_CLIENT_SSL );
if( mysqli_connect_errno() )
{
mysqli_close( $Conn );
header( "Location: MensajeError.php?Errno=2201&Lang=$Lang&From=$From" );
exit();
}
$Query = "select UserID, Nombres, Login from Vendedores
where Correo = '{$_POST{'Correo'}}'";
if( !$QueryRes = mysqli_query( $Conn, $Query ) )
{
mysqli_close( $Conn );
header( "Location: MensajeError.php?Errno=2204&Lang=$Lang&From=$From" );
//No Puede select
exit();
}
if( ( mysqli_num_rows( $QueryRes ) ) != 1 )
{
header( "Location:MensajeError.php?Errno=2205&Var={$_POST{'Correo'}}" );
// No Tengo este E-Mail
exit();
}
$Pedidor = mysqli_fetch_array( $QueryRes );
$LigaBase = md5( ( time() . $Pedidor{'UserID'} ) );
$LigaArchivo = "TianguisCabalMaint/{$LigaBase}.php";
$LigaURL = "https://www.imat.com/linuxcabal.org/{$LigaArchivo}?Lang=$Lang&From=$From&DD=../";
copy( "TianguisCabalCambiarPWDHead.php", $LigaArchivo );
$Handle = fopen( "/var/www/html/linuxcabal.org/{$LigaArchivo}", "a+" );
$CambiarPWDBody = "
<?php
echo( \"<p class=\\\"SubTitleFont\\\" style=\\\"text-align:center;\\\">
Del Usuario {$Pedidor{'Nombres'}}
</p>
<form method=\\\"post\\\" action=\\\"{$_SERVER{'PHP_SELF'}}?Lang=$Lang&From=Tianguis\\\">
<p class=\\\"LargeTextFont\\\"
style=\\\"text-align:center;\\\">
Contraseña Nueva: <input type=\\\"password\\\"
name=\\\"PNuevo\\\"
size=\\\"25\\\"
maxlength=\\\"50\\\" />
</p>
<p class=\\\"LargeTextFont\\\"
style=\\\"text-align:center;\\\">
Verificar Contraseña: <input type=\\\"password\\\"
name=\\\"PVer\\\"
size=\\\"25\\\"
maxlength=\\\"50\\\" />
</p>
<p class=\\\"LargeTextFont\\\"
style=\\\"text-align:center;\\\">
<br />
<input type=\\\"hidden\\\" name=\\\"Accion\\\"
value=\\\"CambiaPWD\\\" />
<input type=\\\"hidden\\\" name=\\\"FileName\\\"
value=\\\"/var/www/html/linuxcabal.org/{$LigaArchivo}\\\" />
<input type=\\\"hidden\\\" name=\\\"UserID\\\"
value={$Pedidor{'UserID'}} />
<input type=\\\"submit\\\" name=\\\"Submit\\\"
style=\\\"font-weight:bold\\\"
value =\\\"A P L I C A R\\\" />
<input type=\\\"reset\\\" value=\\\"Reset\\\" />
</p>
</form>\" );
?>";
fwrite( $Handle, $CambiarPWDBody );
$CambiarPWDFoot = "<div class=\"content-main-after\">
<img src=\"../images/LowerCornerLeft.gif\"
alt=\"LowerCornerLeft.gif\" />
</div>
</div>
<div class=\"content-footer\">
<?php
include( \"../includes/incCommonFooter.php\" );
?>
</div>
</div>
</body>
</html>";
fwrite( $Handle, $CambiarPWDFoot );
$Mensaje ="Saludos {$Pedidor{'Nombres'}}\r\n
Recibimos una petición a cambiar la contraseña del usuario
qeu tiene tu E-Mail\r\n
Si quieres cambiar la contraseña del usuario
\"{$Pedidor{'Login'}}\", haga click en la URL:\r\n
{$LigaURL}\r\n
\r\n
Este URL expire en 1 (una) hora\r\n
\r\n
Gracias para usar el TianguisCabal\r\n\r\n
webmaster@LinuxCabal.org";
$Headers = "From: webmaster@LinuxCabal.org";
$Resultado = mail( "{$_POST{'Correo'}}", 'Recuperar TianguiCabal Acceso',
$Mensaje, $Headers );
if( $Resultado )
$Block = "<p class=\"SubTitleFont\" style=\"text-align:center;\">
Correo enviado a {$_POST{'Correo'}} con éxito";
else
$Block = "<p class=\"SubTitleFont\" style=\"text-align:center;\">
Envio de Correo a {$_POST{'Correo'}} falló";
}
else
{
if( $Lang == 'en' )
$Block .= "<p class=\"LargeTextFont\" style=\"text-align:center;\">
It is not possible to recover your existing password
<br />
but,
<br />
we can help you in re-assigning a new password.
</p>
<p class=\"LargeTextFont\" style=\"text-align:center;\">
Use the form below to send us your E-Mail address.
<br />
If it corresponds to an E-Mail address in our database
<br />
we will send you a link which will enable you
<br />
to assign a new password to your account
</p>";
else
$Block .= "<p class=\"LargeTextFont\" style=\"text-align:center;\">
No es posible para nosotros a recuperar tu contraseña,
<br />
pero,
<br />
podemos facilitarte a re-asignar una contraseña nueva.
</p>
<p class=\"LargeTextFont\" style=\"text-align:center;\">
Usa la forma que sigue para enviarnos la
<br />
dirección de tu correo electrónico.
<br />
Si el corresponde a una dirección en nuestra base de
datos,
<br />
vamos enviarte una liga que
<br />
te permitirá asignar una contraseña nueva.
</p>";
$Block .= "<form method=\"post\" action=\"{$_SERVER{'PHP_SELF'}}?Lang=$Lang&From=$From\">
<table cellspacing=\"20\" cellpadding=\"0\"
style=\"margin: 2%; width:95%;\">
<tr>
<td align = \"center\">
E-Mail: <input type=\"text\" name=\"Correo\"
size=\"25\" maxlength=\"50\" />
<br />
</td>
</tr>";
require_once('recaptchalib.php');
$publickey = $CaptchaPubKey;
$Block .= "<tr>
<td align=\"center\">"
. recaptcha_get_html($publickey, $use_ssl=true )
. "</td>
</tr>
<tr>
<td align=\"center\">
<input type=\"hidden\" name=\"Accion\"
value=\"EnviarLiga\" />
<input type=\"submit\" name=\"Submit\"
style=\"font-weight:bold\"";
if( $Lang == 'en' )
$Block .= " value =\"S E N D\" />";
else
$Block .= " value =\"E N V I A R\" />";
$Block .= "
<input type=\"reset\" value=\"Reset\" />
</td>
</tr>
</table>
</form>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml;
charset=UTF-8" />
<meta http-equiv="expires" content="-1" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="keywords" content="linux cabal, linuxcabal, TianguisCabal,
open source, free software, F/OSS, FOSS, GNU,
GNU/Linux, Linux, GNU & Linux, Free and Open Source
Software, Free y Open Source Software, CoffeeNet, Coffee Net,
Richard Couture, Guadalajara, Jalisco, Mexico, México,
Software Freedom Day, SFD, FLISoL, resumen del mes, Mandriva,
Fedora, CentOS, Red Hat, Ubuntu, Kubuntu, Edubuntu, Xubuntu,
Debian, Puppy, SUSE, Damn Small, Yellow Dog, Moblin, OpenSuSE,
Linux From Scratch, OpenBSD, BSD, NetBSD, DesktopBSD,
FreeBSD, TianguisCabal" />
<script type="text/javascript">
var RecaptchaOptions = {
theme : 'blackglass',
lang : 'es',
tabindex : 2
};
</script>
<title>
TianguisCabal On Line - Un Lugar Donde Confiar
</title>
<link rel="stylesheet" type="text/css" href="includes/org.css" />
</head>
<body>
<?php
include( "./includes/Environ.php" );
?>
<div class="menu">
<?php
include( "./includes/incMenu.php" );
echo( "$DisplayBlock" );
?>
</div>
<div class="content">
<div class="content-head">
<div class="content-head-before">
<img src="images/UpperCornerLeft.gif" alt="UpperCornerLeft.gif" />
<?php
include( "./includes/incCommonHeader.php" );
?>
<p class="TitleFont">
<?php
if( $Lang == 'en' )
echo( "Recover Access to My Account" );
else
echo( "Recuperar Acceso a Mi Cuenta" );
?>
</p>
</div>
</div>
<div class="content-main">
<?php
echo( "$Block" );
?>
<p style="text-align: center;">
<?php
if( $Lang == 'en' )
print( "LinuxCabal accepts absolutely no responsiblity
what-so-ever as to the servicabilty of items bought and
sold via this system.
<br />
Each buyer and seller is solely and individually
responsible." );
else
print( "LinuxCabal no se hace responsable; cada usuario
será responsable de sus compras y/o ventas." );
?>
</p>
<p style="text-align: center; font-weight:bold;" class="LargeTextFont">
CAVEAT EMPTOR
</p>
<p style="text-align: center;">
<?php
if( $Lang == 'en' )
print( "You may download the
<a href=\"TianguisCabalOnLine.tar.bz\">Source Code of
TianguisCabalOnLine</a> here" );
else
print( "¡Puedes descargar el
<a href=\"TianguisCabalOnLine.tar.bz\">Codigo Fuente de
TianguisCabalOnLine</a> aquí" );
?>
</p>
<div class="content-main-after">
<img src="images/LowerCornerLeft.gif" alt="LowerCornerLeft.gif" />
</div>
</div>
<div class="content-footer">
<?php
include( "./includes/incCommonFooter.php" );
?>
</div>
</div>
</body>
</html>