diff --git a/client_file_rename_modal.php b/client_file_rename_modal.php new file mode 100644 index 00000000..b34d004a --- /dev/null +++ b/client_file_rename_modal.php @@ -0,0 +1,33 @@ + diff --git a/client_files.php b/client_files.php index 97e6ac3a..ffbca6cd 100644 --- a/client_files.php +++ b/client_files.php @@ -1,111 +1,228 @@ -
-
-

Files

-
- -
+
+ +
+

Files

+
+
-
+
+ +
+ +
+ + +
+
+
+ +
+ +
+
+
+
+
+ "> + "> +
+
+
+
+ +
+ +

No Records Here

"; + } + + if($view == 1){ + + ?> + +

No Records Here

"; - } ?> -
+ while ($row = mysqli_fetch_array($sql)) { + $file_id = intval($row['file_id']); + $file_name = nullable_htmlentities($row['file_name']); + $file_reference_name = nullable_htmlentities($row['file_reference_name']); + $file_ext = nullable_htmlentities($row['file_ext']); + + ?> + + +
- while ($row = mysqli_fetch_array($sql_files_images)) { + + + + + + +
+
CURRENT_DATABASE_VERSION) { mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.7.3'"); } - //if (CURRENT_DATABASE_VERSION == '0.7.3') { + if (CURRENT_DATABASE_VERSION == '0.7.3') { //Insert queries here required to update to DB version 0.7.4 + mysqli_query($mysqli, "ALTER TABLE `files` ADD `file_folder_id` INT(11) NOT NULL DEFAULT 0 AFTER `file_accessed_at`"); // Then, update the database to the next sequential version - //mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.7.4'"); + mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.7.4'"); + } + + //if (CURRENT_DATABASE_VERSION == '0.7.4') { + //Insert queries here required to update to DB version 0.7.5 + + // Then, update the database to the next sequential version + //mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.7.5'"); //} } else { diff --git a/database_version.php b/database_version.php index 073e080c..644f57a6 100644 --- a/database_version.php +++ b/database_version.php @@ -5,4 +5,4 @@ * It is used in conjunction with database_updates.php */ -DEFINE("LATEST_DATABASE_VERSION", "0.7.3"); +DEFINE("LATEST_DATABASE_VERSION", "0.7.4"); diff --git a/post/file.php b/post/file.php index 99185a2e..ca4dbead 100644 --- a/post/file.php +++ b/post/file.php @@ -48,6 +48,26 @@ if (isset($_POST['add_files'])) { header("Location: " . $_SERVER["HTTP_REFERER"]); } +if (isset($_POST['rename_file'])) { + + validateTechRole(); + + $file_id = intval($_POST['file_id']); + $client_id = intval($_POST['client_id']); + $file_name = sanitizeInput($_POST['file_name']); + + // Folder edit query + mysqli_query($mysqli,"UPDATE files SET file_name = '$file_name' WHERE file_id = $file_id"); + + //Logging + mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'File', log_action = 'Rename', log_description = '$session_name renamed file to $file_name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $file_id"); + + $_SESSION['alert_message'] = "File $file_name renamed"; + + header("Location: " . $_SERVER["HTTP_REFERER"]); + +} + if (isset($_POST['delete_file'])) { validateAdminRole();