Revision 1818
Added by Dietmar about 12 years ago
browse.php | ||
---|---|---|
3 | 3 |
* |
4 | 4 |
* @category admin |
5 | 5 |
* @package media |
6 |
* @author Ryan Djurovich, WebsiteBaker Project |
|
7 |
* @copyright 2009-2011, Website Baker Org. e.V.
|
|
6 |
* @author Ryan Djurovich (2004-2009), WebsiteBaker Project
|
|
7 |
* @copyright 2009-2012, WebsiteBaker Org. e.V.
|
|
8 | 8 |
* @link http://www.websitebaker2.org/ |
9 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
10 | 10 |
* @platform WebsiteBaker 2.8.x |
11 | 11 |
* @requirements PHP 5.2.2 and higher |
12 | 12 |
* @version $Id$ |
13 |
* @filesource $HeadURL: $
|
|
14 |
* @lastmodified $Date: $
|
|
13 |
* @filesource $HeadURL$ |
|
14 |
* @lastmodified $Date$ |
|
15 | 15 |
* |
16 | 16 |
*/ |
17 | 17 |
|
18 | 18 |
// Create admin object |
19 |
require('../../config.php'); |
|
19 |
if(!defined('WB_URL')) |
|
20 |
{ |
|
21 |
$config_file = realpath('../../config.php'); |
|
22 |
if(file_exists($config_file) && !defined('WB_URL')) |
|
23 |
{ |
|
24 |
require($config_file); |
|
25 |
} |
|
26 |
} |
|
20 | 27 |
if(!class_exists('admin', false)){ include(WB_PATH.'/framework/class.admin.php'); } |
28 |
|
|
21 | 29 |
$admin = new admin('Media', 'media', false); |
22 | 30 |
|
23 | 31 |
$starttime = explode(" ", microtime()); |
... | ... | |
122 | 130 |
|
123 | 131 |
// Get the current dir |
124 | 132 |
$currentHome = $admin->get_home_folder(); |
133 |
// set directory if you call from menu |
|
125 | 134 |
$directory = (($currentHome) AND (!array_key_exists('dir',$_GET))) |
126 | 135 |
? |
127 | 136 |
$currentHome |
128 | 137 |
: |
129 | 138 |
$admin->strip_slashes($admin->get_get('dir')) ; |
130 | 139 |
|
140 |
// check for correct directory |
|
141 |
if ($currentHome && stripos(WB_PATH.MEDIA_DIRECTORY.$directory,WB_PATH.MEDIA_DIRECTORY.$currentHome)===false) { |
|
142 |
$directory = $currentHome; |
|
143 |
} |
|
144 |
|
|
131 | 145 |
if($directory == '/' OR $directory == '\\') { |
132 | 146 |
$directory = ''; |
133 | 147 |
} |
... | ... | |
152 | 166 |
exit(0); |
153 | 167 |
} |
154 | 168 |
|
155 |
if ($_SESSION['GROUP_ID'] != 1 && $pathsettings['global_admin_only']) { // Only show admin the settings link
|
|
169 |
if ($_SESSION['GROUP_ID'] != 1 && (isset($pathsettings['global']['admin_only']) && $pathsettings['global']['admin_only']) ) { // Only show admin the settings link
|
|
156 | 170 |
$template->set_var('DISPLAY_SETTINGS', 'hide'); |
157 | 171 |
} |
158 | 172 |
|
... | ... | |
200 | 214 |
if(substr($file, 0, 1) != '.' AND $file != '.svn' AND $file != 'index.php') { |
201 | 215 |
if( !preg_match('/'.$forbidden_file_types.'$/i', $ext) ) { |
202 | 216 |
if(is_dir(WB_PATH.MEDIA_DIRECTORY.$directory.'/'.$file)) { |
203 |
if(!isset($home_folders[$directory.'/'.$file])) { |
|
217 |
// if( !isset($home_folders[$directory.'/'.$file]) ) { |
|
218 |
if(!isset($home_folders[$directory.'/'.$file]) || $currentHome =='' ) |
|
219 |
{ |
|
204 | 220 |
$DIR[] = $file; |
205 | 221 |
} |
206 | 222 |
} else { |
... | ... | |
267 | 283 |
$icon = ''; |
268 | 284 |
$tooltip = ''; |
269 | 285 |
|
270 |
|
|
271 |
if (!$pathsettings['global_show_thumbs']) { |
|
286 |
if ( (isset($pathsettings['global']['show_thumbs']) && ($pathsettings['global']['show_thumbs']==false) ) ) { |
|
272 | 287 |
$info = getimagesize(WB_PATH.MEDIA_DIRECTORY.$directory.'/'.$name); |
273 | 288 |
if ($info[0]) { |
274 | 289 |
$imgdetail = fsize(filesize(WB_PATH.MEDIA_DIRECTORY.$directory.'/'.$name)).'<br /> '.$info[0].' x '.$info[1].' px'; |
... | ... | |
315 | 330 |
$template->set_var('DISPLAY_NONE_FOUND', 'hide'); |
316 | 331 |
} |
317 | 332 |
|
333 |
if($currentHome=='') { |
|
318 | 334 |
// Insert permissions values |
319 |
if($admin->get_permission('media_rename') != true) { |
|
320 |
$template->set_var('DISPLAY_RENAME', 'hide'); |
|
335 |
if($admin->get_permission('media_rename') != true) { |
|
336 |
$template->set_var('DISPLAY_RENAME', 'hide'); |
|
337 |
} |
|
338 |
if($admin->get_permission('media_delete') != true) { |
|
339 |
$template->set_var('DISPLAY_DELETE', 'hide'); |
|
340 |
} |
|
321 | 341 |
} |
322 |
if($admin->get_permission('media_delete') != true) { |
|
323 |
$template->set_var('DISPLAY_DELETE', 'hide'); |
|
324 |
} |
|
325 | 342 |
|
326 | 343 |
// Insert language text and messages |
327 | 344 |
$template->set_var(array( |
328 | 345 |
Also available in: Unified diff
! update users, create username homefolder in media/homefolders