Project

General

Profile

« Previous | Next » 

Revision 1818

Added by Dietmar almost 12 years ago

  1. bugfix Ticket 10 usergroup show homefolder in media
    ! update users, create username homefolder in media/homefolders
  2. add mssing values in table settings by installing WebsiteBaker

View differences:

index.php
3 3
 *
4 4
 * @category        admin
5 5
 * @package         admintools
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
// Print admin header
19
require('../../config.php');
20
require_once(WB_PATH.'/framework/class.admin.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
}
27
if(!class_exists('admin', false)){ include(WB_PATH.'/framework/class.admin.php'); }
28

  
21 29
$admin = new admin('Media', 'media');
22 30

  
23 31
$starttime = explode(" ", microtime());
......
41 49
$dirs = directory_list(WB_PATH.MEDIA_DIRECTORY);
42 50
$currentHome = $admin->get_home_folder();
43 51

  
44
if ($currentHome){
52
if ($currentHome!=''){
45 53
	$dirs = directory_list(WB_PATH.MEDIA_DIRECTORY.$currentHome);
46 54
}
47 55
else
48 56
{
49 57
	$dirs = directory_list(WB_PATH.MEDIA_DIRECTORY);
50 58
}
59

  
51 60
$array_lowercase = array_map('strtolower', $dirs);
52 61
array_multisort($array_lowercase, SORT_ASC, SORT_STRING, $dirs);
53 62
foreach($dirs AS $name) {
54
	if(!isset($home_folders[str_replace(WB_PATH.MEDIA_DIRECTORY, '', $name)])) {
63

  
64
	if(!isset($home_folders[str_replace(WB_PATH.MEDIA_DIRECTORY, '', $name)]) || $currentHome =='' )
65
    {
55 66
		$template->set_var('NAME', str_replace(WB_PATH, '', $name));
56 67
		$template->parse('dir_list', 'dir_list_block', true);
57 68
	}
......
64 75
if($admin->get_permission('media_upload') != true) {
65 76
	$template->set_var('DISPLAY_UPLOAD', 'hide');
66 77
}
67
if ($_SESSION['GROUP_ID'] != 1 && $pathsettings['global']['admin_only']) { // Only show admin the settings link
78
if ($_SESSION['GROUP_ID'] != 1 && (isset($pathsettings['global']['admin_only']) && $pathsettings['global']['admin_only'])) {
79
    // Only show admin the settings link
68 80
	$template->set_var('DISPLAY_SETTINGS', 'hide');
69 81
}
70 82
// Workout if the up arrow should be shown
......
94 106
// Insert language text and messages
95 107
$template->set_var(array(
96 108
					'MEDIA_DIRECTORY' => MEDIA_DIRECTORY,
109
//					'MEDIA_DIRECTORY' => ($currentHome!='') ? MEDIA_DIRECTORY : $currentHome,
97 110
					'TEXT_NAME' => $TEXT['TITLE'],
98 111
					'TEXT_RELOAD' => $TEXT['RELOAD'],
99 112
					'TEXT_TARGET_FOLDER' => $TEXT['TARGET_FOLDER'],
100 113

  

Also available in: Unified diff