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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
|
<?php
/** * Initialize globals for Admin * @package admin */ // force UTF-8 Ø
define('UPLOAD_ERR_QUOTA', -1); define('UPLOAD_ERR_BLOCKED', -2);
require_once(dirname(__FILE__) . '/functions-basic.php');
zp_session_start(); require_once(dirname(__FILE__) . '/admin-functions.php'); httpsRedirect(); $_SESSION['adminRequest'] = @$_COOKIE['zp_user_auth']; // Allow "unprotected" i.php if the request came from an admin session $zenphoto_tabs = array();
if (OFFSET_PATH != 2 && !getOption('license_accepted')) { require_once(dirname(__FILE__) . '/license.php'); }
$sortby = array(gettext('Filename') => 'filename', gettext('Date') => 'date', gettext('Title') => 'title', gettext('ID') => 'id', gettext('Filemtime') => 'mtime', gettext('Owner') => 'owner', gettext('Published') => 'show' );
// setup sub-tab arrays for use in dropdown if ($_zp_loggedin) { if ($_zp_current_admin_obj->reset) { $_zp_loggedin = USER_RIGHTS; } else { if ($_zp_loggedin & ADMIN_RIGHTS) { $_zp_loggedin = ALL_RIGHTS; } else { if ($_zp_loggedin & MANAGE_ALL_ALBUM_RIGHTS) { // these are lock-step linked! $_zp_loggedin = $_zp_loggedin | ALBUM_RIGHTS; } if ($_zp_loggedin & MANAGE_ALL_NEWS_RIGHTS) { // these are lock-step linked! $_zp_loggedin = $_zp_loggedin | ZENPAGE_NEWS_RIGHTS; } if ($_zp_loggedin & MANAGE_ALL_PAGES_RIGHTS) { // these are lock-step linked! $_zp_loggedin = $_zp_loggedin | ZENPAGE_PAGES_RIGHTS; } } }
if ($_zp_loggedin & OVERVIEW_RIGHTS) { $zenphoto_tabs['overview'] = array('text' => gettext("overview"), 'link' => WEBPATH . "/" . ZENFOLDER . '/admin.php', 'subtabs' => NULL); } $zenphoto_tabs['upload'] = NULL;
if ($_zp_loggedin & ALBUM_RIGHTS) { $zenphoto_tabs['edit'] = array('text' => gettext("albums"), 'link' => WEBPATH . "/" . ZENFOLDER . '/admin-edit.php', 'subtabs' => NULL); } if (extensionEnabled('zenpage')) { if ($_zp_loggedin & ZENPAGE_PAGES_RIGHTS) { $zenphoto_tabs['pages'] = array('text' => gettext("pages"), 'link' => WEBPATH . "/" . ZENFOLDER . '/' . PLUGIN_FOLDER . '/zenpage/admin-pages.php', 'subtabs' => NULL); } if ($_zp_loggedin & ZENPAGE_NEWS_RIGHTS) { $zenphoto_tabs['news'] = array('text' => gettext("news"), 'link' => WEBPATH . "/" . ZENFOLDER . '/' . PLUGIN_FOLDER . '/zenpage/admin-news-articles.php', 'subtabs' => array(gettext('articles') => PLUGIN_FOLDER . '/zenpage/admin-news-articles.php?page=news&tab=articles', gettext('categories') => PLUGIN_FOLDER . '/zenpage/admin-categories.php?page=news&tab=categories'), 'default' => 'articles'); } }
if ($_zp_loggedin & TAGS_RIGHTS) { $zenphoto_tabs['tags'] = array('text' => gettext("tags"), 'link' => WEBPATH . "/" . ZENFOLDER . '/admin-tags.php', 'subtabs' => NULL); }
if ($_zp_loggedin & USER_RIGHTS) { $zenphoto_tabs['users'] = array('text' => gettext("users"), 'link' => WEBPATH . "/" . ZENFOLDER . '/admin-users.php?page=users', 'subtabs' => NULL); }
$subtabs = array(); $optiondefault = ''; if ($_zp_loggedin & OPTIONS_RIGHTS) { if ($_zp_loggedin & ADMIN_RIGHTS) { $optiondefault = '&tab=general'; $subtabs[gettext("general")] = 'admin-options.php?page=options&tab=general'; } else { $optiondefault = '&tab=gallery'; } $subtabs[gettext("gallery")] = 'admin-options.php?page=options&tab=gallery'; if ($_zp_loggedin & ADMIN_RIGHTS) { $subtabs[gettext("security")] = 'admin-options.php?page=options&tab=security'; } $subtabs[gettext("image")] = 'admin-options.php?page=options&tab=image'; } if ($_zp_loggedin & ADMIN_RIGHTS) { if (empty($optiondefault)) $optiondefault = '&tab=plugin'; $subtabs[gettext("plugin")] = 'admin-options.php?page=options&tab=plugin'; } if ($_zp_loggedin & OPTIONS_RIGHTS) { $subtabs[gettext("search")] = 'admin-options.php?page=options&tab=search'; if ($_zp_loggedin & THEMES_RIGHTS) { if (empty($optiondefault)) $optiondefault = '&tab=theme'; $subtabs[gettext("theme")] = 'admin-options.php?page=options&tab=theme'; } $zenphoto_tabs['options'] = array('text' => gettext("options"), 'link' => WEBPATH . "/" . ZENFOLDER . '/admin-options.php?page=options' . $optiondefault, 'subtabs' => $subtabs, 'default' => 'gallery'); }
if ($_zp_loggedin & THEMES_RIGHTS) { $zenphoto_tabs['themes'] = array('text' => gettext("themes"), 'link' => WEBPATH . "/" . ZENFOLDER . '/admin-themes.php', 'subtabs' => NULL); }
if ($_zp_loggedin & ADMIN_RIGHTS) { list($subtabs, $default) = getPluginTabs(); $zenphoto_tabs['plugins'] = array('text' => gettext("plugins"), 'link' => WEBPATH . "/" . ZENFOLDER . '/admin-plugins.php', 'subtabs' => $subtabs, 'default' => $default); }
if ($_zp_loggedin & ADMIN_RIGHTS) { list($subtabs, $default) = getLogTabs(); $zenphoto_tabs['logs'] = array('text' => gettext("logs"), 'link' => WEBPATH . "/" . ZENFOLDER . '/admin-logs.php?page=logs', 'subtabs' => $subtabs, 'default' => $default); } if (!$_zp_current_admin_obj->getID()) { $filelist = safe_glob(SERVERPATH . "/" . BACKUPFOLDER . '/*.zdb'); if (count($filelist) > 0) { $zenphoto_tabs['restore'] = array('text' => gettext("Restore"), 'link' => WEBPATH . "/" . ZENFOLDER . '/utilities/backup_restore.php?page=backup', 'subtabs' => NULL); } }
$zenphoto_tabs = zp_apply_filter('admin_tabs', $zenphoto_tabs); foreach ($zenphoto_tabs as $tab => $value) { if (is_null($value)) { unset($zenphoto_tabs[$tab]); } } // so as to make it generally available as we make much use of it if (OFFSET_PATH != 2) { require_once(SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/colorbox_js.php'); }
loadLocalOptions(false, $_zp_gallery->getCurrentTheme()); } ?>
|