diff --git a/.gitignore b/.gitignore
index c0452ec9..c70c3cf8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,3 +22,7 @@ plugins/htmlpurifier/standalone/HTMLPurifier/DefinitionCache/Serializer/URI/*
plugins/htmlpurifier/standalone/HTMLPurifier/DefinitionCache/Serializer/CSS/*
!plugins/htmlpurifier/standalone/HTMLPurifier/DefinitionCache/Serializer/CSS/.gitkeep
.vscode/settings.json
+xcustom/*
+!xcustom/readme.php
+post/xcustom
+!post/xcustom/readme.php
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
index 6e155a5f..1015954e 100644
--- a/CODE_OF_CONDUCT.md
+++ b/CODE_OF_CONDUCT.md
@@ -60,7 +60,7 @@ representative at an online or offline event.
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
-the forums / Discord.
+the forums.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
diff --git a/README.md b/README.md
index baf6d339..aa3b6cd6 100644
--- a/README.md
+++ b/README.md
@@ -121,6 +121,7 @@ If you want to improve ITFlow, feel free to fork the repo and create a pull requ
### Supporters
We’re incredibly grateful to the organizations and individuals who support the project - a big thank you to:
- CompuMatter
+- F1 for HELP
- JetBrains
diff --git a/accounts.php b/accounts.php
index 9703d683..f23a0f7e 100644
--- a/accounts.php
+++ b/accounts.php
@@ -6,6 +6,9 @@ $order = "ASC";
require_once "inc_all.php";
+// Perms
+enforceUserPermission('module_financial');
+
//Rebuild URL
$url_query_strings_sort = http_build_query($get_copy);
@@ -42,8 +45,16 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-
-
-
-
-
diff --git a/admin_legacy_debug.php b/admin_legacy_debug.php
new file mode 100644
index 00000000..61591900
--- /dev/null
+++ b/admin_legacy_debug.php
@@ -0,0 +1,335 @@
+ $count,
+ 'size' => $size
+ ];
+}
+
+// Function to compare two arrays recursively and return the differences
+function arrayDiffRecursive($array1, $array2) {
+ $diff = array();
+
+ foreach ($array1 as $key => $value) {
+ if (is_array($value)) {
+ if (!isset($array2[$key]) || !is_array($array2[$key])) {
+ $diff[$key] = $value;
+ } else {
+ $recursiveDiff = arrayDiffRecursive($value, $array2[$key]);
+ if (!empty($recursiveDiff)) {
+ $diff[$key] = $recursiveDiff;
+ }
+ }
+ } else {
+ if (!isset($array2[$key]) || $array2[$key] !== $value) {
+ $diff[$key] = $value;
+ }
+ }
+ }
+
+ return $diff;
+}
+
+// Function to load the table structures from an SQL dump file URL
+function loadTableStructuresFromSQLDumpURL($fileURL) {
+ $context = stream_context_create(array('http' => array('header' => 'Accept: application/octet-stream')));
+ $fileContent = file_get_contents($fileURL, false, $context);
+
+ if ($fileContent === false) {
+ return null;
+ }
+
+ $structure = array();
+ $queries = explode(";", $fileContent);
+
+ foreach ($queries as $query) {
+ $query = trim($query);
+
+ if (!empty($query)) {
+ if (preg_match("/^CREATE TABLE `(.*)` \((.*)\)$/s", $query, $matches)) {
+ $tableName = $matches[1];
+ $tableStructure = $matches[2];
+ $structure[$tableName] = array('structure' => $tableStructure);
+ }
+ }
+ }
+
+ return $structure;
+}
+
+// Function to fetch the database structure from the MySQL server
+function fetchDatabaseStructureFromServer() {
+
+ global $mysqli;
+
+ $tables = array();
+
+ // Fetch table names
+ $result = $mysqli->query("SHOW TABLES");
+
+ if ($result->num_rows > 0) {
+ while ($row = $result->fetch_row()) {
+ $tableName = $row[0];
+ $tables[$tableName] = array();
+ }
+ }
+
+ // Fetch table structures
+ foreach ($tables as $tableName => &$table) {
+ $result = $mysqli->query("SHOW CREATE TABLE `$tableName`");
+
+ if ($result->num_rows > 0) {
+ $row = $result->fetch_row();
+ $table['structure'] = $row[1];
+ }
+ }
+
+ return $tables;
+}
+
+//function to get current crontab and return it as an array
+function get_crontab() {
+ $crontab = shell_exec('crontab -l');
+ $crontab = explode(PHP_EOL, $crontab);
+ return $crontab;
+}
+
+// URL to the SQL dump file
+$fileURL = "https://raw.githubusercontent.com/itflow-org/itflow/master/db.sql";
+
+// Load the desired table structures from the SQL dump file URL
+$desiredStructure = loadTableStructuresFromSQLDumpURL($fileURL);
+
+if ($desiredStructure === null) {
+ die("Failed to load the desired table structures from the SQL dump file URL.");
+}
+
+// Fetch the current database structure from the MySQL server
+$currentStructure = fetchDatabaseStructureFromServer();
+
+if ($currentStructure === null) {
+ die("Failed to fetch the current database structure from the server.");
+}
+
+// Compare the structures and display the differences
+$differences = arrayDiffRecursive($desiredStructure, $currentStructure);
+
+//DB Stats
+// Query to fetch the number of tables
+$tablesQuery = "SHOW TABLES";
+$tablesResult = $mysqli->query($tablesQuery);
+
+$numTables = $tablesResult->num_rows;
+$numFields = 0;
+$numRows = 0;
+
+// Loop through each table
+while ($row = $tablesResult->fetch_row()) {
+ $tableName = $row[0];
+
+ // Query to fetch the number of fields
+ $fieldsQuery = "DESCRIBE `$tableName`";
+ $fieldsResult = $mysqli->query($fieldsQuery);
+
+ // Check if the query was successful
+ if ($fieldsResult) {
+ $numFields += $fieldsResult->num_rows;
+
+ // Query to fetch the number of rows
+ $rowsQuery = "SELECT COUNT(*) FROM `$tableName`";
+ $rowsResult = $mysqli->query($rowsQuery);
+
+ // Check if the query was successful
+ if ($rowsResult) {
+ $numRows += $rowsResult->fetch_row()[0];
+ } else {
+ echo "Error executing query: " . $mysqli->error;
+ }
+ } else {
+ echo "Error executing query: " . $mysqli->error;
+ }
+}
+
+//Get loaded PHP modules
+$loadedModules = get_loaded_extensions();
+
+//Get Server Info / Service versions
+$phpVersion = phpversion();
+$databaseInfo = mysqli_get_server_info($mysqli) . " / " . $mysqli->server_version;
+$operatingSystem = php_uname();
+$webServer = $_SERVER['SERVER_SOFTWARE'];
+$errorLog = ini_get('error_log') ?: "Debian/Ubuntu default is usually /var/log/apache2/error.log";
+$updates = fetchUpdates();
+
+?>
+
+
+
+
Debug
+
+
+
+
Debugging
+
+
If you are experiencing a problem with ITFlow you may be directed to this page to gather server/app info.
+
When creating forum posts / support requests ensure you share the information under Server Info, ITFlow app and Database stats.
+
Caution: Be careful when sharing the full debug output - it contains your PHP session variables/cookies ("PHPSESSID") which could allow anyone to login to your ITFlow instance
+
Note: Sometimes you might need to gather PHP error logs as well