-
Notifications
You must be signed in to change notification settings - Fork 39
/
resetIP.php
executable file
·101 lines (65 loc) · 2.71 KB
/
resetIP.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
<?php
require '/var/www/classes/Session.class.php';
$session = new Session();
if($session->issetLogin()){
$redirectToISP = 'internet';
if($_SERVER['REQUEST_METHOD'] == 'POST'){
require '/var/www/classes/Player.class.php';
require '/var/www/classes/Finances.class.php';
require '/var/www/classes/Process.class.php';
$player = new Player();
$finances = new Finances();
$process = new Process();
$npc = new NPC();
$ispIP = $npc->getNPCByKey('ISP')->npcip;
$redirectToISP .= '?ip='.long2ip($ispIP);
$ipInfo = $player->ip_info();
if($ipInfo['NEXT_RESET'] != 0 && !isset($_POST['acc'])){
$session->addMsg('Calm down, boy, you cant reset your IP yet.', 'error');
header("Location:$redirectToISP");
exit();
}
if($ipInfo['PRICE'] > 0){
if(!isset($_POST['acc'])){
$session->addMsg('You sir, we dont work for free, I need da accountz', 'error');
header("Location:$redirectToISP");
exit();
}
$acc = $_POST['acc'];
if(!ctype_digit($acc)){
$session->addMsg('Sir, this account is not valid.', 'error');
header("Location:$redirectToISP");
exit();
}
if(!$finances->isPlayerAccount($acc)){
$session->addMsg('Sir, this account is not valid.', 'error');
header("Location:$redirectToISP");
exit();
}
if($finances->totalMoney() < $ipInfo['PRICE']){
$session->addMsg('You dont have enough money for this, sir', 'error');
header("Location:$redirectToISP");
exit();
}
} else {
$acc = '0';
}
//exit("aaa");
if($process->newProcess($_SESSION['id'], 'RESET_IP', '', 'local', '', $acc, '', 0)){
header("Location:$redirectToISP");
} else {
if (!$session->issetMsg()) {
$pid = $process->getPID($_SESSION['id'], 'RESET_IP', '', 'local', '', $acc, '', 0);
header("Location:processes?id=".$pid);
} else {
header("Location:$redirectToISP");
}
}
} else {
$session->addMsg('Invalid get', 'error');
header("Location:$redirectToISP");
}
} else {
header("Location:index.php");
}
?>