-
Notifications
You must be signed in to change notification settings - Fork 40
/
internet.php
executable file
·61 lines (37 loc) · 1.2 KB
/
internet.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
require 'config.php';
require '/var/www/classes/Session.class.php';
require '/var/www/classes/Player.class.php';
require '/var/www/classes/Internet.class.php';
require '/var/www/classes/System.class.php';
$session = new Session();
$system = new System();
require 'template/contentStart.php';
$player = new Player($_SESSION['id']);
$internet = new Internet();
$ranking = new Ranking();
if(!$ranking->cert_have(2)){
$session->addMsg(sprintf(_("You need the certification %s to enable this page."), '<strong>'._('Hacking 101').'</strong>'), 'error');
header("Location:university?opt=certification");
exit();
}
if($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST)){
$internet->handlePost();
}
if($system->issetGet('ip')){
$getIP = trim($_GET['ip']);
if(!$system->validate($getIP, 'ip')){
exit("Invalid IP");
}
$internet->navigate(ip2long($getIP));
} else {
if($session->isInternetLogged()){
$internet->navigate($_SESSION['LOGGED_IN']);
} elseif($session->issetInternetSession()){
$internet->navigate($_SESSION['CUR_IP']);
} else {
$internet->navigate($internet->home_getIP());
}
}
require 'template/contentEnd.php';
?>