@@ -105,7 +105,7 @@
- Archive
+ Archive (not yet implemented)
@@ -123,7 +123,7 @@
-
+
0) { ?>
@@ -165,7 +165,7 @@
-
+
@@ -192,7 +192,7 @@
-
+
0) { ?>
diff --git a/admin_roles.php b/admin_role.php
similarity index 100%
rename from admin_roles.php
rename to admin_role.php
diff --git a/admin_settings_defaults.php b/admin_settings_default.php
similarity index 100%
rename from admin_settings_defaults.php
rename to admin_settings_default.php
diff --git a/admin_settings_integrations.php b/admin_settings_integration.php
similarity index 100%
rename from admin_settings_integrations.php
rename to admin_settings_integration.php
diff --git a/admin_settings_modules.php b/admin_settings_module.php
similarity index 100%
rename from admin_settings_modules.php
rename to admin_settings_module.php
diff --git a/admin_settings_notifications.php b/admin_settings_notification.php
similarity index 100%
rename from admin_settings_notifications.php
rename to admin_settings_notification.php
diff --git a/admin_side_nav.php b/admin_side_nav.php
index 490d23dc9..1a0d1aa07 100644
--- a/admin_side_nav.php
+++ b/admin_side_nav.php
@@ -17,13 +17,13 @@
- ">
+ ">
Users
- ">
+ ">
Roles
@@ -42,7 +42,7 @@
-
-
+
-
+
diff --git a/admin_users.php b/admin_user.php
similarity index 100%
rename from admin_users.php
rename to admin_user.php
diff --git a/admin_vendor_templates.php b/admin_vendor_template.php
similarity index 100%
rename from admin_vendor_templates.php
rename to admin_vendor_template.php
diff --git a/client_overview.php b/client_overview.php
index 2d96cddc5..7fa139c02 100644
--- a/client_overview.php
+++ b/client_overview.php
@@ -345,7 +345,7 @@
diff --git a/expense_add_modal.php b/expense_add_modal.php
index 6238759d3..b6db01890 100644
--- a/expense_add_modal.php
+++ b/expense_add_modal.php
@@ -140,7 +140,7 @@
?>
diff --git a/expense_edit_modal.php b/expense_edit_modal.php
index 27738b4ca..ab87ffb9a 100644
--- a/expense_edit_modal.php
+++ b/expense_edit_modal.php
@@ -147,7 +147,7 @@
?>
diff --git a/functions.php b/functions.php
index 190c1f65a..9434776ca 100644
--- a/functions.php
+++ b/functions.php
@@ -215,7 +215,7 @@ function formatPhoneNumber($phoneNumber)
return $phoneNumber;
}
-
+
$phoneNumber = $phoneNumber ? preg_replace('/[^0-9]/', '', $phoneNumber) : "";
if (strlen($phoneNumber) > 10) {
@@ -733,12 +733,14 @@ function sanitizeInput($input)
{
global $mysqli;
- // Detect encoding
- $encoding = mb_detect_encoding($input, ['UTF-8', 'ISO-8859-1', 'Windows-1252', 'ISO-8859-15'], true);
+ if (!empty($input)) {
+ // Detect encoding
+ $encoding = mb_detect_encoding($input, ['UTF-8', 'ISO-8859-1', 'Windows-1252', 'ISO-8859-15'], true);
- // If not UTF-8, convert to UTF8 (primarily Windows-1252 is problematic)
- if ($encoding !== 'UTF-8') {
- $input = mb_convert_encoding($input, 'UTF-8', $encoding);
+ // If not UTF-8, convert to UTF8 (primarily Windows-1252 is problematic)
+ if ($encoding !== 'UTF-8') {
+ $input = mb_convert_encoding($input, 'UTF-8', $encoding);
+ }
}
// Remove HTML and PHP tags
@@ -1115,7 +1117,7 @@ function fetchUpdates() {
$updates->latest_version = $latest_version;
$updates->update_message = $update_message;
-
+
return $updates;
}
@@ -1301,3 +1303,11 @@ function enforceUserPermission($module, $check_access_level = 1) {
exit(WORDING_ROLECHECK_FAILED . "
Tell your admin: $map[$check_access_level] access to $module is not permitted for your role.");
}
}
+
+function enforceAdminPermission() {
+ global $session_is_admin;
+ if (!isset($session_is_admin) || !$session_is_admin) {
+ exit(WORDING_ROLECHECK_FAILED . "
Tell your admin: Your role does not have admin access.");
+ }
+ return true;
+}
diff --git a/inc_all_admin.php b/inc_all_admin.php
index 500af82bb..0d2e1f617 100644
--- a/inc_all_admin.php
+++ b/inc_all_admin.php
@@ -7,9 +7,9 @@
require_once "check_login.php";
validateAdminRole();
-//if (!isset($session_is_admin) || !$session_is_admin) {
-// exit(WORDING_ROLECHECK_FAILED . "
Tell your admin: Your role does not have admin access.");
-//}
+
+// TODO: Change this to enforceAdminPermission();
+// We can't do this until everyone has the new database fields added in 1.4.9 on Sept 14th 2024
require_once "header.php";
diff --git a/invoice_add_modal.php b/invoice_add_modal.php
index 70cdf4695..ba8f6dec9 100644
--- a/invoice_add_modal.php
+++ b/invoice_add_modal.php
@@ -73,7 +73,7 @@
?>
diff --git a/invoice_edit_modal.php b/invoice_edit_modal.php
index ddf6a39ae..29cb268ca 100644
--- a/invoice_edit_modal.php
+++ b/invoice_edit_modal.php
@@ -56,7 +56,7 @@
?>