-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.php
153 lines (148 loc) · 4.87 KB
/
admin.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?
/*##################### Pagix Content Management System #######################
$Id: admin.php 23 2002-10-26 14:32:40Z skulawik $
$Revision: 1.1 $
$Author: skulawik $
$Date: 2002-10-26 16:32:40 +0200 (Sat, 26 Oct 2002) $
###############################################################################
$Log: admin.php,v $
Revision 1.1 2002/10/26 14:21:53 skulawik
*** empty log message ***
Revision 2.1 2002/04/12 12:35:49 skulawik
*** empty log message ***
###############################################################################
Defaultseite für die Administration
Über die Verwendung von IDs:
Die eindeutigen Bezeichner sind für jede Klasse eine ID.
Diese ist folgend benannt:
- ID PAGE ID
- SID SITE ID
- TID TEMPLATE ID
- MID MODULE ID
Die Verwendung von Action Types:
Ein Actiontype definiert als allererstes die genutze Klasse für den Aufruf.
Weitere Parameter werden nicht über diese $action gepflegt, sondern werden als
action2 übergeben, im Idealfall sollten keine weiteren Informationen angefragt
werden sondern anhand der Benutzerberechtigungen aus der Datenbank auslesbar
sein.
#############################################################################*/
require("config/prepend.php");
page_open(array("sess" => "CMS_Session",
"auth" => "CMS_Auth"));
//if (($HTTP_REFERER=="") or (!isset($HTTP_REFERER))) {$force_relogin ="yes";}
$auth->login_if(isset($force_relogin));
$err = new error($debug); // Errorobject öffnen, Übergabe ist Debuginfo.
//$action = $_REQUEST["action"];
switch($action)
{
case "top":
$t = new Template("templates/");
$t->set_file("page","admin_top.html");
$t->set_var(array("lnk_editieren"=>u("structure_frame.php"),
"lnk_media"=>u("structure_media.php"),
"lnk_vorschau"=>u("publish.php?action=demo"),
"lnk_speichern"=>u("publish.php"),
"lnk_module"=>u("admin.php?action=modules"),
"lnk_verwalten"=>u("admin.php?action=template"),
"lnk_benutzer"=>u("admin.php?action=user"),
"lnk_einstellungen"=>u("admin.php?action=site&action2=settings"),
"lnk_sites"=>u("admin.php?action=sites"),
"lnk_main"=>u("index.php")
));
if (!$auth->r("page", "editpage")) {
$t->set_block("page","editieren1","ed1");
$t->set_block("page","editieren2","ed2");
$t->set_var(array("ed1"=>"","ed2"=>""));
}
if (!$auth->r("media", "mediaview")) {
$t->set_block("page","media1","md1");
$t->set_block("page","media2","md2");
$t->set_var(array("md1"=>"","md2"=>""));
}
if (!$auth->r("publish", "demo")) {
$t->set_block("page","vorschau1","vs1");
$t->set_block("page","vorschau2","vs2");
$t->set_var(array("vs1"=>"","vs2"=>""));
}
if (!$auth->r("publish", "live")) {
$t->set_block("page","speichern1","sp1");
$t->set_block("page","speichern2","sp2");
$t->set_var(array("sp1"=>"","sp2"=>""));
}
if (!$auth->r("modules", "view")) {
$t->set_block("page","module1","me1");
$t->set_block("page","module2","me2");
$t->set_var(array("me1"=>"","me2"=>""));
}
if (!$auth->r("template", "templateview")) {
$t->set_block("page","verwalten1","vw1");
$t->set_block("page","verwalten2","vw2");
$t->set_var(array("vw1"=>"","vw2"=>""));
}
if (!$auth->r("user", "userview")) {
$t->set_block("page","benutzer1","be1");
$t->set_block("page","benutzer2","be2");
$t->set_var(array("be1"=>"","be2"=>""));
}
if (!$auth->r("settings", "view")) {
$t->set_block("page","einstellungen1","ei1");
$t->set_block("page","einstellungen2","ei2");
$t->set_var(array("ei1"=>"","ei2"=>""));
}
if (!$auth->auth["masteradmin"]) {
$t->set_block("page","sites1","st1");
$t->set_block("page","sites2","st2");
$t->set_var(array("st1"=>"","st2"=>""));
}
$t->parse("out", "page");
$t->p("out");
break;
case "page":
$site = new site($auth->auth["sid"]);
$page = new page($id);
$page->admin_panel();
break;
case "template":
$auth->r("template", "templateview", true);
$site = new site($auth->auth["sid"]);
$template = new cmstemplate($tid);
$template->admin_panel();
break;
case "modules":
$site = new site($auth->auth["sid"]);
$mdl = new modules();
$mdl->admin_panel();
break;
case "el":
$site = new site($auth->auth["sid"]);
$template = new cmstemplate($tid);
$el = new elements_list($elid, $tid,$language);
$el->admin_panel();
break;
case "media":
$auth->r("media", "mediaview", true);
$site = new site($auth->auth["sid"]);
$media = new media();
$media->admin_panel();
break;
case "sites":
if ($auth->auth["masteradmin"]) {
$sites = new sites();
$sites->admin_panel();
}else{
$t = new Template("templates/");
$t->set_file("page","admin_access_denied.html");
$t->parse("out", "page");
$t->p("out");
}
break;
case "user":
$auth->r("user", "userview", true);
$auth->admin_panel();
break;
default:
$site = new site($auth->auth["sid"]);
$site->admin_panel();
}
page_close();
?>