-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupload.php
executable file
·58 lines (47 loc) · 1.43 KB
/
upload.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/**
* Copyright 2008, Jefferson González (JegoYalu.com)
* This file is part of Jaris CMS and licensed under the GPL,
* check the LICENSE.txt file for version and details or visit
* https://opensource.org/licenses/GPL-3.0.
*
* Script to manage file uploads.
*/
//Register autoloader
require 'src/Autoloader.php';
Jaris\Autoloader::register();
//Include backward compatible functions if include dir exists
if (file_exists("include/forms.php")) {
require 'src/DeprecatedFunctions.php';
}
//Initialize settings.
Jaris\Site::init();
//Starts the main session for the user
Jaris\Session::start();
//Initialize error handler
Jaris\System::initiateErrorCatchSystem();
//Check if cms is run for the first time and run the installer
Jaris\System::checkIfNotInstalled();
//Check if site status is online to continue
Jaris\Site::checkIfOffline();
if (Jaris\Forms::canUpload()) {
error_reporting(E_ALL | E_STRICT);
$upload_path = str_replace(
"data.php",
"uploads/",
Jaris\Users::getPath(
Jaris\Authentication::currentUser(),
Jaris\Authentication::currentUserGroup()
)
);
if (!is_dir($upload_path)) {
Jaris\FileSystem::makeDir($upload_path, 0755, true);
}
$upload_handler = new UploadHandler(
[
'script_url' => Jaris\Uri::url("upload.php"),
"upload_dir" => $upload_path,
'delete_type' => 'POST'
]
);
}