Initial implementation of whitelabelling

This commit is contained in:
wrongecho
2024-09-05 10:31:18 +01:00
parent 0f6ed69008
commit 4458c87463
11 changed files with 107 additions and 8 deletions

View File

@@ -75,6 +75,10 @@ $config_log_retention = intval($row['config_log_retention']);
// Set Currency Format
$currency_format = numfmt_create($company_locale, NumberFormatter::CURRENCY);
// White label
$config_whitelabel_enabled = intval($row['config_whitelabel_enabled']);
$config_whitelabel_key = $row['config_whitelabel_key'];
$argv = $_SERVER['argv'];
// Check cron is enabled
@@ -137,6 +141,13 @@ mysqli_query($mysqli, "DELETE FROM logs WHERE log_created_at < CURDATE() - INTER
* ###############################################################################################################
*/
// Whitelabel - Disable if expired/invalid
if ($config_whitelabel_enabled && !validateWhitelabelKey($config_whitelabel_key)) {
mysqli_query($mysqli, "UPDATE settings SET config_whitelabel_enabled = 0, config_whitelabel_key = '' WHERE company_id = 1");
mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = 'Settings', notification = 'White-labelling was disabled due to expired/invalid key', notification_action = 'settings_modules.php'");
}
// GET NOTIFICATIONS
// DOMAINS EXPIRING