summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-11-02 11:06:52 -0400
committerjim-p <jimp@pfsense.org>2012-11-02 11:06:52 -0400
commit7e669778016a5fb09ea6ba913cac7b19ab13c19b (patch)
tree014b9164d6aaed9e64b31353643b38e81daab1b2 /usr/local
parent7cf76e8bb53dbb637f2800150380601105fb1ce2 (diff)
downloadpfsense-7e669778016a5fb09ea6ba913cac7b19ab13c19b.zip
pfsense-7e669778016a5fb09ea6ba913cac7b19ab13c19b.tar.gz
Make a function to get the current theme and use it everywhere rather than duplicating code or missing functions. (Fixes forced themes using the wrong theme for login screen)
Conflicts: etc/inc/util.inc usr/local/www/head.inc
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/guiconfig.inc17
-rwxr-xr-xusr/local/www/head.inc20
-rwxr-xr-xusr/local/www/progress.php5
3 files changed, 3 insertions, 39 deletions
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc
index 51cb475..1241fd2 100755
--- a/usr/local/www/guiconfig.inc
+++ b/usr/local/www/guiconfig.inc
@@ -62,23 +62,8 @@ foreach (scandir("/usr/local/www/classes/") as $file) {
require_once("classes/{$file}");
}
}
-/*
- * if user has selected a custom template, use it.
- * otherwise default to pfsense template
- */
-if($config['theme'] <> "")
- $g['theme'] = $config['theme'];
-else
- $g['theme'] = "pfsense";
-/*
- * If this device is an apple ipod/iphone
- * switch the theme to one that works with it.
- */
-$apple_ua = array("iPhone","iPod", "iPad");
-foreach($apple_ua as $useragent)
- if(strstr($_SERVER['HTTP_USER_AGENT'], $useragent))
- $g['theme'] = "pfsense";
+$g['theme'] = get_current_theme();
/* used by progress bar */
$lastseen = "-1";
diff --git a/usr/local/www/head.inc b/usr/local/www/head.inc
index 69e2019..e4e9b5e 100755
--- a/usr/local/www/head.inc
+++ b/usr/local/www/head.inc
@@ -3,25 +3,7 @@
pfSense_MODULE: header
*/
-/*
- * if user has selected a custom template, use it.
- * otherwise default to pfsense tempalte
- */
-if (($g["disablethemeselection"] === true) && !empty($g["default_theme"]) && (is_dir($g["www_path"].'/themes/'.$g["default_theme"])))
- $g['theme'] = $g["default_theme"];
-elseif($config['theme'] <> "" && (is_dir($g["www_path"].'/themes/'.$config['theme'])))
- $g['theme'] = $config['theme'];
-else
- $g['theme'] = "pfsense";
-
-/*
- * If this device is an apple ipod/iphone
- * switch the theme to one that works with it.
- */
-$lowres_ua = array("iPhone", "iPod", "iPad", "Android", "BlackBerry", "Opera Mini", "Opera Mobi");
-foreach($lowres_ua as $useragent)
- if(strstr($_SERVER['HTTP_USER_AGENT'], $useragent))
- $g['theme'] = empty($g['theme_lowres']) ? "pfsense" : $g['theme_lowres'];
+$g['theme'] = get_current_theme();
$pagetitle = gentitle( $pgtitle );
diff --git a/usr/local/www/progress.php b/usr/local/www/progress.php
index 0a6b50d..f222215 100755
--- a/usr/local/www/progress.php
+++ b/usr/local/www/progress.php
@@ -4,10 +4,7 @@
include("guiconfig.inc");
-if($config['theme'] <> "")
- $g['theme'] = $config['theme'];
-else
- $g['theme'] = "pfsense";
+$g['theme'] = get_current_theme();
$url = 'progress.php?UPLOAD_IDENTIFIER='. $_GET["UPLOAD_IDENTIFIER"] .'&e=1';
OpenPOWER on IntegriCloud