This repository has been archived by the owner on Sep 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathedit-account.php
executable file
·115 lines (97 loc) · 3.12 KB
/
edit-account.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
<?php
/***************************************************************************
*
* PROJECT: eLitius Open Source Affiliate Software
* VERSION: 1.0
* LISENSE: GNU GPL (http://www.opensource.org/licenses/gpl-license.html)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation.
*
* Link to eLitius.com can not be removed from the software pages without
* permission of the eLitius respective owners. It is the only requirement
* for using this software.
*
* Copyright 2009 Intelliants LLC
* http://www.intelliants.com/
*
***************************************************************************/
$gProtected = TRUE;
require_once('header.php');
$form = $gXpDb->getAffiliateInfo($aff);
if ($_POST['edit'])
{
/** magic quotes stripping **/
$tmp = get_magic_quotes_gpc() ? array_map('stripslashes', $_POST) : $_POST;
unset($temp);
$temp['firstname'] = addslashes($tmp['firstname']);
$temp['lastname'] = addslashes($tmp['lastname']);
$temp['taxid'] = addslashes($tmp['taxid']);
$temp['check'] = addslashes($tmp['check']);
$temp['company'] = addslashes($tmp['company']);
$temp['url'] = addslashes($tmp['url']);
$temp['address'] = addslashes($tmp['address']);
$temp['zip'] = addslashes($tmp['zip']);
$temp['city'] = addslashes($tmp['city']);
$temp['state'] = addslashes($tmp['state']);
$temp['phone'] = addslashes($tmp['phone']);
foreach($temp as $key=>$value)
{
if(empty($value))
{
$error = true;
$msg .= "<li>".sprintf($gXpLang['msg_please_correct'], $key)."</li>";
}
}
$temp['fax'] = addslashes($tmp['fax']);
$temp['email'] = addslashes($tmp['email']);
/** check email **/
if (!valid_email($_POST['email']))
{
$error = true;
$msg .= "<li>{$gXpLang['error_email_incorrect']}</li>";
}
/** check password **/
if($tmp['password'] && $tmp['password2'])
{
if ($tmp['password'] != $tmp['password2'])
{
$error = true;
$msg .= "<li>{$gXpLang['error_password_match']}</li>";
}
else
{
$temp['password'] = md5($tmp['password']);
aff_passwd_changed($temp['password']);
}
}
elseif(!$tmp['password'] && !$tmp['password2'])
{
//$temp['password'] = $tmp['password'];
}
else
{
$error = true;
$msg .= "<li>{$gXpLang['error_password_match']}</li>";
}
if (!$error)
{
$gXpDb->editAffiliateAccount($temp);
$msg .= "<li>".$gXpLang['msg_your_account_modified']."</li>";
}
$form = $tmp;
$msgstyle = $error?'error':'notify';
$msg = "<ul class=\"{$msgstyle}\">{$msg}</ul>";
}
$tpl = 'edit-account.tpl';
$title = $gXpLang['site_title'].' - '.$gXpLang['edit_account'];
$description = $gXpLang['desc_edit_account'];
$keywords = $gXpLang['keyword_edit_account'];
$gXpSmarty->assign_by_ref('description', $description);
$gXpSmarty->assign_by_ref('keywords', $keywords);
$gXpSmarty->assign_by_ref('title', $title);
$gXpSmarty->assign_by_ref('form', $form);
$gXpSmarty->assign_by_ref('msg', $msg);
$gXpSmarty->display("edit-account.tpl");
?>