This repository has been archived by the owner on Sep 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathswitcher.php
83 lines (70 loc) · 2.13 KB
/
switcher.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
<?php
# security protection
defined('_we_are_one') || die('Direct access not allowed.');
function switcher($page, $loggedin)
{
global $abspath;
try {
switch($page) {
case 'profile':
if ($loggedin)
include("$abspath/profile.php");
else
log_badpage($page);
break;
case 'view_order':
if ($loggedin)
include("$abspath/view_order.php");
else
log_badpage($page);
break;
case 'view_request':
if ($loggedin)
include("$abspath/view_request.php");
else
log_badpage($page);
break;
case 'login':
if (!$loggedin)
include("$abspath/login.php");
else
log_badpage($page);
break;
case 'deposit':
include("$abspath/deposit.php");
break;
case 'withdraw':
include("$abspath/withdraw.php");
break;
case 'help':
include("$abspath/help.php");
break;
case 'orderbook':
include("$abspath/orderbook.php");
break;
case 'place_order':
if ($loggedin)
include("$abspath/place_order.php");
else
log_badpage($page);
break;
case '':
include("$abspath/index.php");
break;
default:
log_badpage($page);
break;
}
}
catch (Error $e) {
report_exception($e, SEVERITY::ERROR);
# Same as below, but flag + log this for review,
echo "<div class='content_box'><h3>{$e->getTitle()}</h3>";
echo "<p>{$e->getMessage()}</p></div>";
}
catch (Problem $e) {
echo "<div class='content_box'><h3>{$e->getTitle()}</h3>";
echo "<p>{$e->getMessage()}</p></div>";
}
}
?>