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:

rename.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
// Create admin object
19
require('../../config.php');
20
require_once(WB_PATH.'/framework/class.admin.php');
21
$admin = new admin('Media', 'media_rename', false);
18
if(!defined('WB_URL'))
19
{
20
    $config_file = realpath('../../config.php');
21
    if(file_exists($config_file) && !defined('WB_URL'))
22
    {
23
    	require($config_file);
24
    }
25
}
26
if(!class_exists('admin', false)){ include(WB_PATH.'/framework/class.admin.php'); }
22 27

  
28
$admin = new admin('Media', 'media', false);
29

  
23 30
// Include the WB functions file
24 31
require_once(WB_PATH.'/framework/functions.php');
25 32

  
......
31 38
$rootlink = 'browse.php?dir=';
32 39
// $file_id = intval($admin->get_get('id'));
33 40

  
41
// Get the current dir
42
$currentHome = $admin->get_home_folder();
43
// check for correct directory
44
if ($currentHome && stripos(WB_PATH.MEDIA_DIRECTORY.$rootlink,WB_PATH.MEDIA_DIRECTORY.$currentHome)===false) {
45
	$rootlink = $currentHome;
46
}
47

  
34 48
// first Check to see if it contains ..
35 49
if (!check_media_path($directory)) {
36
	$admin->print_error($MESSAGE['MEDIA']['DIR_DOT_DOT_SLASH'],$rootlink, false);
50
	$admin->print_error($MESSAGE['MEDIA_DIR_DOT_DOT_SLASH'],$rootlink, false);
37 51
}
38 52

  
39 53
// Get the temp id
......
91 105
}
92 106

  
93 107
if(!isset($rename_file)) {
94
	$admin->print_error($MESSAGE['MEDIA']['FILE_NOT_FOUND'], $dirlink, false);
108
	$admin->print_error($MESSAGE['MEDIA_FILE_NOT_FOUND'], $dirlink, false);
95 109
}
96 110

  
97 111
// Setup template object, parse vars to it, then parse it
98 112

  

Also available in: Unified diff