-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchange-password-action.php
72 lines (62 loc) · 1.47 KB
/
change-password-action.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
<?php
include("extended-config.inc.php");
include($GLOBALS['admin_folder']."/config.inc.php");
includeClass("User");
includeClass("Form");
includeClass("Template");
if($single_account_mode==0)
{
header("Location: index.php");
exit(0);
}
if($_COOKIE['io_type']==md5("advertiser"))
{
$commonid=$mysql->echo_one("select common_account_id from ppc_users where username='".$_COOKIE['io_username']."'");
}
if($_COOKIE['io_type']==md5("publisher"))
{
$commonid=$mysql->echo_one("select common_account_id from ppc_publishers where username='".$_COOKIE['io_username']."'");
}
if($commonid==0)
{
if($_COOKIE['io_type']==md5("advertiser"))
{
header("Location: ppc-change-password.php");
exit(0);
}
elseif($_COOKIE['io_type']==md5("publisher"))
{
header("Location: ppc-change-publisher-password.php");
exit(0);
}
}
if($portal_system==1)
{
//redirect this page to portal corrensponding page
}
$user=new User("nesote_inoutscripts_users", "id");
if($user->getUsername()=="demouser" && $script_mode=="demo")
{
header("Location:error-message.php?id=6076");
exit(0);
}
if(!$user->validateUser())
{
header("Location:error-message.php?id=1006");
exit(0);
}
phpSafe($_POST['oldpass']);
phpSafe($_POST['newpass']);
phpSafe($_POST['newpass2']);
$msgid=$user->changePassword($_POST['oldpass'],$_POST['newpass'],$_POST['newpass2'],$min_user_password_length);
if($msgid==1010)
{
header("Location:success-message.php?id=1010");
exit;
}
else
{
header("Location:error-message.php?id=$msgid");
exit;
}
?>