-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedite.php
executable file
·46 lines (41 loc) · 1.13 KB
/
edite.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
<?php
include 'libaweb/seculib.php';
include 'libaweb/dblib.php';
$pass = $_GET['pwd'];
$newPass = $_GET['n-pwd'];
$reNewPass = $_GET['re-n-pwd'];
$dbContoller = new DbContoller();
echo "string";
if(!$dbContoller->isConn){
echo "connect is fail!";
}
else if(strlen($pass) > 0 && strlen($newPass) > 0 && strlen($reNewPass) > 0)
{
$pass = clean($pass);
$newPass = clean($newPass);
$reNewPass = clean($reNewPass);
$return_pass = $dbContoller->selectPassword();
if($return_pass){
echo $return_pass["salt"];
$salt = $return_pass["salt"];
//echo $salt . "<br/>";
$hash_string = createHash($salt, $pass);
if($hash_string == $return_pass["password"]){
echo $hash_string;
if($newPass == $reNewPass){
$newSalt = genSalt();
$newPass = createHash($newSalt, $newPass);
$update = $dbContoller->updatePassword($newPass, $newSalt);
if($update) header( "location: index.html");
else echo "fail";
}
$dbContoller->dbClose();
}
else echo "Pass invalid...";
}
else
echo "Connect is fail....";
}
else
echo "Info is missing...";
?>