Skip to content

Commit

Permalink
Fixing #5823 - Don't fallback to 'classic'
Browse files Browse the repository at this point in the history
-issue#5823: If active theme is missing ensure the fallback is not the classic theme
  • Loading branch information
TheWitness committed Sep 16, 2024
1 parent 2aef389 commit 1c7aff3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Cacti CHANGELOG
-issue#5802: Cacti should not convert non-base tables as they may have an focused characters set and engine
-issue#5806: Issues with Cacti posix_kill wrapper in Windows
-issue#5813: Can't change password when first installing
-issue#5823: If active theme is missing ensure the fallback is not the classic theme
-issue#5824: Properly cache the data source information for dsstats processing
-feature#5784: Provide a means by which a user can track Cacti connections and disconnects from the php error_log
-feature#5796: Due to Conflicting Interpretations of TCP Ping, Introduce new Ping Method
Expand Down
20 changes: 11 additions & 9 deletions lib/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -796,23 +796,25 @@ function get_selected_theme() {
array($_SESSION['sess_user_id']), '', false);

// user has a theme
if (! empty($user_theme)) {
if (!empty($user_theme)) {
$theme = $user_theme;;
}
}

if (!file_exists($config['base_path'] . '/include/themes/' . $theme . '/main.css')) {
foreach($themes as $t => $name) {
if (file_exists($config['base_path'] . '/include/themes/' . $t . '/main.css')) {
$theme = $t;
if ($t != 'classic') {
if (file_exists($config['base_path'] . '/include/themes/' . $t . '/main.css')) {
$theme = $t;

db_execute_prepared('UPDATE settings_user
SET value = ?
WHERE user_id = ?
AND name="selected_theme"',
array($theme, $_SESSION['sess_user_id']));
db_execute_prepared('UPDATE settings_user
SET value = ?
WHERE user_id = ?
AND name = "selected_theme"',
array($theme, $_SESSION['sess_user_id']));

break;
break;
}
}
}
}
Expand Down

0 comments on commit 1c7aff3

Please sign in to comment.