-
Notifications
You must be signed in to change notification settings - Fork 1
/
internet.php
64 lines (42 loc) · 1.24 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
62
63
64
<?php
require 'config.php';
require 'classes/Session.class.php';
require 'classes/Player.class.php';
require 'classes/Internet.class.php';
require 'classes/System.class.php';
$session = new Session();
$system = new System();
ob_start();
$sub = 'Internet';
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());
}
}
ob_end_flush();
ob_start();
require 'template/contentEnd.php';
ob_end_flush();
?>