diff --git a/webui/config.php b/webui/config.php index 854bf550..099bac98 100644 --- a/webui/config.php +++ b/webui/config.php @@ -237,6 +237,10 @@ require_once 'config-site.php'; if(isset($_SESSION['theme']) && preg_match("/^([a-zA-Z0-9\-\_]+)$/", $_SESSION['theme'])) { $config['THEME'] = $_SESSION['theme']; } +include("/system/helper/detectmobilebrowser.php"); + +if(MOBILE_DEVICE == 1) { $config['THEME'] = 'mobile'; } + // make sure auditors are restricted in a saas environment if($config['ENABLE_SAAS'] == 1) { $config['RESTRICTED_AUDITOR'] = 1; } if(isset($_SESSION['username']) && $_SESSION['username'] == 'auditor@local') { $config['RESTRICTED_AUDITOR'] = 0; } diff --git a/webui/system/controller.php b/webui/system/controller.php index 6bb88a15..6a5b017e 100644 --- a/webui/system/controller.php +++ b/webui/system/controller.php @@ -93,7 +93,8 @@ class Controller { $file = DIR_THEME . THEME . '/templates/' . $this->template; } - + if(MOBILE_DEVICE == 1) { $file = DIR_THEME . 'mobile' . '/templates/' . $this->template; } + if(file_exists($file)){ extract($this->data); diff --git a/webui/system/helper/detectmobilebrowser.php b/webui/system/helper/detectmobilebrowser.php new file mode 100644 index 00000000..a5e8ae8a --- /dev/null +++ b/webui/system/helper/detectmobilebrowser.php @@ -0,0 +1,7 @@ +