-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuserarea.php
More file actions
104 lines (88 loc) · 3.89 KB
/
userarea.php
File metadata and controls
104 lines (88 loc) · 3.89 KB
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
<?php
require "Html.php";
require "Stier.php";
require "lib/Localizer.php";
require "lib/SiteContext.php";
require "lib/UsersArea/Utils.php";
//Stier og options
$stier = new Stier();
//Henter variable udefra
$ind = Html::setPostOrGetVars($_POST, $_GET);
if (isset($ind['username']))
$username = $ind['username'];
if (isset($ind['password']))
$password = $ind['password'];
//Temporarely instance for error handling
$siteContext = new ShortSiteContext($stier, $ind, 'da');
$errors = new Errors();
if (isset($ind) and isset($username)) {
//Tjekker brugernavnet
$datafil = DataSource::createInstance($username, $stier);
//Henter datafilen
$res = $datafil->hentFil();
//Was the datafile fetched successfully
if ($res === -2) {
$errors->addError(new ZsError(2, sprintf($siteContext->getLocale('errDamagedDatasource'), $stier->getOption('name_of_service'))));
} elseif (! $res or $res === 0) {
$errors->addError(new ZsError(2, sprintf($siteContext->getLocale('errDatasourceInaccessible'), $stier->getOption('name_of_service'))));
}
}
//Instantierer klassen med standardkode
$lib = new Html($ind,$datafil);
$siteContext = new SiteContext($lib, $stier, $ind, 'da');
$lib->setSiteContext($siteContext);
$lib->setStier($stier);
if ((! isset($ind)) or (! isset($username))) {
$uaUtils = new UsersAreaUtils($siteContext);
$uaUtils->doLoginForm(1, $stier->getOption('urlUserArea'));
exit;
} else if (!$datafil->authenticate($username, $password, 'admin', array('admin', 'statsite'))) {
$uaUtils = new UsersAreaUtils($siteContext);
$uaUtils->doLoginForm(2, $stier->getOption('urlUserArea'));
exit;
} else if ($errors->isOccured()) {
$uaUtils = new UsersAreaUtils($siteContext);
$uaUtils->showErrors($errors);
exit;
}
//Find out what page to start with
if (isset($ind['start']) and isset($ind['start_type'])) {
if ($ind['start_type'] === "adminmain")
$main = $stier->getOption('urlUserAreaMain')."?username=".$username."&type=".$ind['start'];
elseif ($ind['start_type'] === "kodegen")
$main = $stier->getOption('urlUserAreaCodegen')."?username=".$username."&type=".$ind['start'];
else
$main = $stier->getOption('urlUserAreaMain')."?username=".$username;
} else {
$main = $stier->getOption('urlStatsite')."?brugernavn=".$username."&enkeltstat=vis&prognoser=vis&menu=hide&tabelWidth=100%25&show%5B0%5D=BasicStats&show%5B0%5D=Projection";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>[<?php echo $username;?>] - Administration</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="robots" content="none,noindex,follow">
<meta http-equiv="expires" content="sat, 01 jan 1980 12:35:00 gmt">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-store">
<FRAMESET FRAMEBORDER="0" FRAMESPACING="0" BORDER="0" ROWS="62,*" COLS="100%">
<FRAME SRC="<?php echo htmlentities($stier->getOption('urlUserAreaTopmenu'))."?username=".htmlentities(urlencode($username))."&password=".htmlentities(urlencode($password)); ?>" NAME="top" SCROLLING="NO">
<FRAMESET COLS="20%,*">
<FRAME SRC="<?php echo htmlentities($stier->getOption('urlUserAreaLeftmenu'))."?username=".htmlentities(urlencode($username))."&password=".htmlentities(urlencode($password)); ?>" NAME="menu" SCROLLING="AUTO">
<FRAME SRC="<?php echo $main; ?>" NAME="main" SCROLLING="AUTO">
</FRAMESET>
</FRAMESET>
</head>
<body>
<noframes>
<h3>Menufaciliteten er kun tilgngelig i browsere der understtter frames.<h3>
<p>Men bare rolig. Du kan flge nedenstende link til menuen.</p>
<a href="<?php echo htmlentities($stier->getOption('urlUserAreaLeftmenu'))."?username=".htmlentities(urlencode($username))."&password=".htmlentities(urlencode($password)); ?>">G til menuen...</a>
</noframes>
</body>
</html>
<?php
exit;
?>