Revision 1457
Added by Dietmar over 13 years ago
rename2.php | ||
---|---|---|
21 | 21 |
require_once(WB_PATH.'/framework/class.admin.php'); |
22 | 22 |
$admin = new admin('Media', 'media_rename', false); |
23 | 23 |
|
24 |
if (!$admin->checkFTAN()) |
|
25 |
{ |
|
26 |
$admin->print_error('RN5::'.$MESSAGE['GENERIC_SECURITY_ACCESS']); |
|
27 |
exit(); |
|
28 |
} |
|
29 |
|
|
30 | 24 |
// Include the WB functions file |
31 | 25 |
require_once(WB_PATH.'/framework/functions.php'); |
32 | 26 |
|
... | ... | |
40 | 34 |
$file_extensions=explode(",",$file_extension_string); |
41 | 35 |
|
42 | 36 |
// Get the current dir |
43 |
$directory = $admin->get_post('dir'); |
|
37 |
// $directory = $admin->get_post('dir'); |
|
38 |
|
|
39 |
// Target location |
|
40 |
$requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']); |
|
41 |
$directory = (isset(${$requestMethod}['dir'])) ? ${$requestMethod}['dir'] : ''; |
|
44 | 42 |
if($directory == '/') { |
45 | 43 |
$directory = ''; |
46 | 44 |
} |
... | ... | |
96 | 94 |
} |
97 | 95 |
} |
98 | 96 |
} |
99 |
|
|
97 |
$file_id = $admin->getIDKEY($file_id); |
|
100 | 98 |
if(!isset($rename_file)) { |
101 | 99 |
$admin->print_error($MESSAGE['MEDIA']['FILE_NOT_FOUND'], "browse.php?dir=$directory", false); |
102 | 100 |
} |
... | ... | |
158 | 156 |
|
159 | 157 |
// Try and rename the file/folder |
160 | 158 |
if(rename(WB_PATH.MEDIA_DIRECTORY.$directory.'/'.$rename_file, WB_PATH.MEDIA_DIRECTORY.$directory.'/'.$name)) { |
159 |
$usedFiles = array(); |
|
160 |
// feature freeze |
|
161 |
// require_once(ADMIN_PATH.'/media/dse.php'); |
|
162 |
|
|
161 | 163 |
$admin->print_success($MESSAGE['MEDIA']['RENAMED'], "browse.php?dir=$directory"); |
162 | 164 |
} else { |
163 | 165 |
$admin->print_error($MESSAGE['MEDIA']['CANNOT_RENAME'], "rename.php?dir=$directory&id=$file_id", false); |
164 | 166 |
} |
165 |
?> |
Also available in: Unified diff
Preparing 2.8.2 stable, last tests