Revision 1818
Added by Luisehahne over 12 years ago
create.php | ||
---|---|---|
3 | 3 |
* |
4 | 4 |
* @category admin |
5 | 5 |
* @package admintools |
6 |
* @author WebsiteBaker Project |
|
7 |
* @copyright 2004-2009, Ryan Djurovich |
|
8 |
* @copyright 2009-2011, Website Baker Org. e.V. |
|
6 |
* @author Ryan Djurovich (2004-2009), WebsiteBaker Project |
|
7 |
* @copyright 2009-2012, WebsiteBaker Org. e.V. |
|
9 | 8 |
* @link http://www.websitebaker2.org/ |
10 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
11 | 10 |
* @platform WebsiteBaker 2.8.x |
12 | 11 |
* @requirements PHP 5.2.2 and higher |
13 | 12 |
* @version $Id$ |
14 |
* @filesource $HeadURL: $
|
|
15 |
* @lastmodified $Date: $
|
|
13 |
* @filesource $HeadURL$ |
|
14 |
* @lastmodified $Date$ |
|
16 | 15 |
* |
17 | 16 |
*/ |
18 | 17 |
|
19 |
// Print admin header |
|
20 |
require('../../config.php'); |
|
21 |
|
|
22 |
require_once(WB_PATH.'/framework/class.admin.php'); |
|
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'); } |
|
23 | 27 |
// Include the WB functions file |
24 | 28 |
require_once(WB_PATH.'/framework/functions.php'); |
25 | 29 |
|
... | ... | |
33 | 37 |
// Check to see if name or target contains ../ |
34 | 38 |
if(strstr($name, '..')) { |
35 | 39 |
$admin->print_header(); |
36 |
$admin->print_error($MESSAGE['MEDIA']['NAME_DOT_DOT_SLASH']);
|
|
40 |
$admin->print_error($MESSAGE['MEDIA_NAME_DOT_DOT_SLASH']);
|
|
37 | 41 |
} |
38 | 42 |
|
39 | 43 |
// Remove bad characters |
... | ... | |
52 | 56 |
$admin->print_header(); |
53 | 57 |
|
54 | 58 |
if (!check_media_path($target, false)) { |
55 |
$admin->print_error($MESSAGE['MEDIA']['TARGET_DOT_DOT_SLASH']);
|
|
59 |
$admin->print_error($MESSAGE['MEDIA_TARGET_DOT_DOT_SLASH']);
|
|
56 | 60 |
} |
57 | 61 |
|
58 | 62 |
// Create relative path of the new dir name |
... | ... | |
60 | 64 |
|
61 | 65 |
// Check to see if the folder already exists |
62 | 66 |
if(file_exists($directory)) { |
63 |
$admin->print_error($MESSAGE['MEDIA']['DIR_EXISTS']);
|
|
67 |
$admin->print_error($MESSAGE['MEDIA_DIR_EXISTS']);
|
|
64 | 68 |
} |
65 | 69 |
|
66 | 70 |
if ( sizeof(createFolderProtectFile( $directory )) ) |
67 | 71 |
{ |
68 |
$admin->print_error($MESSAGE['MEDIA']['DIR_NOT_MADE']);
|
|
72 |
$admin->print_error($MESSAGE['MEDIA_DIR_NOT_MADE']);
|
|
69 | 73 |
} else { |
70 | 74 |
$usedFiles = array(); |
71 | 75 |
// feature freeze |
72 | 76 |
// require_once(ADMIN_PATH.'/media/dse.php'); |
73 |
$admin->print_success($MESSAGE['MEDIA']['DIR_MADE']);
|
|
77 |
$admin->print_success($MESSAGE['MEDIA_DIR_MADE']);
|
|
74 | 78 |
} |
75 | 79 |
|
76 | 80 |
// Print admin |
77 | 81 |
Also available in: Unified diff
! update users, create username homefolder in media/homefolders