Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -1,4 +1,20 @@
|
||||
<?php
|
||||
session_start();
|
||||
$user = $_SESSION['user'];
|
||||
if ( !$user ) {
|
||||
header('HTTP/1.1 403 Forbidden');
|
||||
exit('Access denied');
|
||||
}
|
||||
|
||||
$akey = $_GET['akey'] ?? $_POST['akey'] ?? '';
|
||||
if (
|
||||
empty($_SESSION['rfm_akey']) ||
|
||||
$akey !== $_SESSION['rfm_akey'] ||
|
||||
(($_SESSION['rfm_akey_expires'] ?? 0) < time())
|
||||
) {
|
||||
header('HTTP/1.1 403 Forbidden');
|
||||
exit('Invalid key');
|
||||
}
|
||||
|
||||
$time = time();
|
||||
|
||||
@@ -20,7 +36,7 @@ $_SESSION['RF']["verify"] = "RESPONSIVEfilemanager";
|
||||
|
||||
if (!empty($_FILES)) {
|
||||
$directorio = $config['current_path'];
|
||||
if (!file_exists($directorio)) {
|
||||
if (!file_exists($directorio)) {
|
||||
mkdir($directorio);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user