-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfirm-publisher-account-action.php
202 lines (180 loc) · 5.78 KB
/
confirm-publisher-account-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
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
<?php
include("extended-config.inc.php");
include($GLOBALS['admin_folder']."/config.inc.php");
includeClass("User");
includeClass("Template");
includeClass("Form");
$user=new User("ppc_users");
if($single_account_mode==0)
{
header("Location: index.php");
exit(0);
}
if(!$user->validateUser())
{
header("Location:show-message.php?id=1006");
exit(0);
}
$uname= $_COOKIE['io_username'];
$pass=$_COOKIE['io_password'];
phpsafe($uname);
phpsafe($pass);
$uid=$user->getUserID();
$advertiser=mysql_query("select * from ppc_users where username='$uname' and password='$pass'");
$adve=mysql_fetch_row($advertiser);
if($adve[17]!=0)
{
header("Location:ppc-user-control-panel.php");
exit(0);
}
if($_POST['radiobutton']==1) //yes
{
// $username=$_POST['username'];
// $password=$_POST['password'];
//phpSafe($username);
//phpSafe($password);
//if($username==""||$password=="")
//{
//header("Location:show-message.php?id=1001");
//exit(0);
//}
//else
//
//{
// $password=md5($password);
//
// $publisher1=mysql_query("select * from ppc_publishers where username='$username' and password='$password'");
// $publisher=mysql_num_rows($publisher1);
// if($publisher==0)
// {
// echo "please enter correct username and password";
// exit;
// }
// else
// {
// header("Location:ppc-single-account.php");
// exit;
// }
//}
}
else //no
{
$lastid="";
$condition="username='$uname' and password='$pass'";
$main1=mysql_query("select * from nesote_inoutscripts_users where username='$uname' ");
$main=mysql_num_rows($main1);
$publisher1=mysql_query("select * from ppc_publishers where username='$uname'");
$publisher=mysql_num_rows($publisher1);
$mainemail=$mysql->echo_one("select count(*) from nesote_inoutscripts_users where email='$adve[3]' ");
$adve_email=$mysql->echo_one("select count(*) from ppc_publishers where email='$adve[3]'");
if(($main==0) && ($publisher==0))
{
if(($mainemail==0) && ($adve_email==0))
{
if($pub_status==1)
{
$pstatus=1;
}
else
{
$pstatus=-1;
}
$name=$adve[12]." ".$adve[13];
// echo "insert into nesote_inoutscripts_users(`username`, `password`, `name`, `email`, `joindate`, `status`) values ('$uname','$pass','$name','$adve[3]','$adve[7]','1')')";
// exit;
mysql_query("BEGIN");
if(!mysql_query("insert into nesote_inoutscripts_users(`username`, `password`, `name`, `email`, `joindate`, `status`) values ('$uname','$pass','$name','$adve[3]','$adve[7]','1')"))
{
$flag=1;
}
$lastid=mysql_insert_id();
if(!mysql_query("insert into ppc_publishers (`username`, `password`,`email`, `status`,`country`,`domain`,`regtime`,`lastlogin`,`firstname`,`lastname`,`phone_no`,`address`,`common_account_id`,`parent_status`,`taxidentification`) values ('$uname','$pass','$adve[3]','$pstatus','$adve[5]','$adve[6]','$adve[7]','$adve[8]','$adve[12]','$adve[13]','$adve[14]','$adve[15]','$lastid','1','$adve[19]')"))
{
$flag=1;
}
if(!mysql_query("update ppc_users set common_account_id='$lastid',parent_status='1' where uid='$uid'"))
{
$flag=1;
}
if($flag==1)
{
mysql_query("ROLLBACK");
header("Location:show-message.php?id=1004");
exit(0);
}
else
{
mysql_query("COMMIT");
setcookie("io_type",md5("Common"),0,'/');
$sub=$mysql->echo_one("select email_subject from email_templates where id='2'");
$sub=str_replace("{USERNAME}",$uname,$sub);
$sub=str_replace("{ENGINE_NAME}",$ppc_engine_name,$sub);
$body=$mysql->echo_one("select email_body from email_templates where id='2'");
$body=str_replace("{USERNAME}",$uname,$body);
//$body=str_replace("{PASSWORD}",$password,$body);
$body=str_replace("{ENGINE_NAME}",$ppc_engine_name,$body);
$body=str_replace("{PUB_LOGIN_PATH}",$server_dir."login.php",$body);
$body=html_entity_decode($body,ENT_QUOTES);
$body=html_entity_decode($body,ENT_QUOTES);
if($script_mode!="demo")
{
include($GLOBALS['admin_folder']."/class.Email.php");
$message = new Email($adve[3], $admin_general_notification_email, $sub, '');
$message->Cc = '';
$message->Bcc = '';
$message->SetHtmlContent(nl2br($body));
$message->Send();
}
if($pstatus==-1)
{
header("Location:show-success.php?id=9995&page=control-panel.php");
exit(0);
}
else
{
header("Location:show-success.php?id=9996&page=control-panel.php");
exit(0);
}
}
}
else
{
header("Location:show-message.php?id=8896");
exit(0);
}
}
else
{
$template=new Template();
$template->loadTemplate("ppc-templates/confirm-publisher-account-action.tpl.html");
$form=new Form("userLogin","new-account-action.php");
$template->includePage("{TABS}","advertiser-loggedin-header.php");
$template->includePage("{FOOTER}","common-footer.php");
$form->isNotNull("username",$template->checkmsg(6001));
$form->isNotNull("password",$template->checkmsg(6002));
$form->isWhitespacePresent("username",$template->checkmsg(1028));
$form->isNotShort("password",$min_user_password_length,$template->checkmsg(6005));
$template->setValue("{SUBMIT}",$form->addSubmit($template->checkAdvMsg(8883)));
$template->setValue("{USERFIELD}",'<input type="text" name="username" id="un" onblur="show()">');
$template->setValue("{PASSFIELD}",$form->addPassword("password"));
$template->setValue("{FORMSTART}",$form->formStart());
$template->setValue("{FORMCLOSE}",$form->formClose());
$selected_colorcode=array();
foreach ($color_code as $key=>$value)
{
if($key==$color_theme)
{
$selected_colorcode=$value;
break;
}
}
$template->setValue("{COLORTHEME3}","style=\" background-color:$selected_colorcode[2]\"");
$template->setValue("{COLORTHEME4}","style=\" color:$selected_colorcode[3]\"");
$template->setValue("{COLORTHEME5}","style=\" color:$selected_colorcode[4]\"");
$template->setValue("{ENGINE_NAME}",$template->checkAdvMsg(0001));
$template->setValue("{PAGEWIDTH}",$page_width);
$template->setValue("{ENCODING}",$ad_display_char_encoding);
eval('?>'.$template->getPage().'<?php ');
}
}
?>