-
Notifications
You must be signed in to change notification settings - Fork 0
/
change.php
61 lines (50 loc) · 1.4 KB
/
change.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
<?php
include 'config/config.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="iso-8859-2">
</head>
<body>
<?php
if(isset($_POST["current"]))
{
$cur = Hash512(Escape($_POST["current"]));
$new = Hash512(Escape($_POST["newone"]));
if($cur !== $new)
{
$info = $db->LoadArray("SELECT * FROM `accounts` WHERE `username`=?", $_SESSION["username"]);
if($info[0][3] == $cur)
{
$db->Execute("UPDATE accounts SET `password`=? WHERE `username`=?", $new, $_SESSION["username"]);
}
}
Redirect('account.php?action=' . Hash512("PasswordChangedCodedbyvitorpegas"));
}
else if(isset($_POST["email"]))
{
$new = Escape($_POST["email"]);
$db->Execute("UPDATE accounts SET `email`=? WHERE `username`=?", $new, $_SESSION["username"]);
$link = "account.php?action=" . Hash512("EmailChangedCodedbyvitorpegas");
Redirect($link);
}
else if(isset($_POST["name"]))
{
$db->Execute("UPDATE accounts SET `nome`=? WHERE `username`=?", $_POST["name"], $_SESSION["username"]);
$link = "account.php?action=" . Hash512("NameChangedCodedbyvitorpegas");
Redirect($link);
}
else if(isset($_POST["phone"]))
{
$new = Escape($_POST["phone"]);
$db->Execute("UPDATE accounts SET `telefone`=? WHERE `username`=?", $new, $_SESSION["username"]);
Redirect('account.php?action=' . Hash512("PhoneChangedCodedbyvitorpegas"));
}
else
{
Redirect('index.php');
}
?>
</body>
</html>