Skip to content

Commit

Permalink
theme: fix selection; closes #388
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Sep 18, 2015
1 parent cd4b826 commit d89614a
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions src/www/guiconfig.inc
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,15 @@
require_once("config.inc");
require_once("util.inc");

/* Include authentication routines */
/* THIS MUST BE ABOVE ALL OTHER CODE */
if(empty($nocsrf)) {

function csrf_startup() {
if (empty($nocsrf)) {
function csrf_startup()
{
csrf_conf('rewrite-js', '/csrf/csrf-magic.js');
$timeout_minutes = isset($config['system']['webgui']['session_timeout']) ? $config['system']['webgui']['session_timeout'] : 240;
csrf_conf('expires', $timeout_minutes * 60);
}
require_once("csrf/csrf-magic.php");
require_once('csrf/csrf-magic.php');
}

function set_language($lang)
Expand All @@ -54,7 +53,18 @@ function set_language($lang)
bind_textdomain_codeset($textdomain, $lang_encoding);
}

function get_current_theme()
{
global $config;

$theme = 'opnsense';

if (isset($config['theme']) && is_dir('/usr/local/opnsense/www/themes/' . $config['theme'])) {
$theme = $config['theme'];
}

return $theme;
}

/* make sure nothing is cached */
if (isset($omit_nocacheheaders) && $omit_nocacheheaders) {
Expand Down Expand Up @@ -699,14 +709,3 @@ function get_menu_messages()

return ($menu_messages);
}

function get_current_theme()
{
$theme = 'opnsense';

if (isset($config['theme']) && is_dir('/usr/local/opnsense/www/themes/' . $config['theme'])) {
$theme = $config['theme'];
}

return $theme;
}

0 comments on commit d89614a

Please sign in to comment.