Module: check_mk
Branch: master
Commit: 92defe0494318ebe019af4c5b9aac46532dea845
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=92defe0494318e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 26 08:32:58 2016 +0200
3723 FIX Mobile GUI: Don't mix classic and mobile GUI when choosing classic on mobile device
---
.werks/3723 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/html_mod_python.py | 6 ++++++
3 files changed, 17 insertions(+)
diff --git a/.werks/3723 b/.werks/3723
new file mode 100644
index 0000000..6c52be3
--- /dev/null
+++ b/.werks/3723
@@ -0,0 +1,10 @@
+Title: Mobile GUI: Don't mix classic and mobile GUI when choosing classic on mobile device
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1469514754
+
+
diff --git a/ChangeLog b/ChangeLog
index 789f3ea..ac16e0c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -407,6 +407,7 @@
* 3670 FIX: Fixed empty AV PDF report when exporting it from a quicksearch result view
* 3622 FIX: Fix labelling of V-Achsis on graphs with very large numbers...
* 3722 FIX: Mobile GUI: Prevent it from being opened with regular sidebar
+ * 3723 FIX: Mobile GUI: Don't mix classic and mobile GUI when choosing classic on mobile device
WATO:
* 3244 WATO BI Module: swap order of aggregation function and child node selection...
diff --git a/web/htdocs/html_mod_python.py b/web/htdocs/html_mod_python.py
index 3e5239f..bc8a346 100644
--- a/web/htdocs/html_mod_python.py
+++ b/web/htdocs/html_mod_python.py
@@ -131,6 +131,12 @@ class html_mod_python(htmllib.html):
def init_mobile(self):
if self.has_var("mobile"):
self.mobile = bool(self.var("mobile"))
+ # Persist the explicitly set state in a cookie to have it maintained through further requests
+ self.set_cookie("mobile", str(int(self.mobile)))
+
+ elif self.has_cookie("mobile"):
+ self.mobile = self.cookie("mobile", "0") == "1"
+
else:
self.mobile = mobile.is_mobile(self.get_user_agent())
Module: check_mk
Branch: master
Commit: 8461df43820f66ef0805f732a220a21fa3c6e9e4
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8461df43820f66…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 26 08:26:54 2016 +0200
3722 FIX Mobile GUI: Prevent it from being opened with regular sidebar
---
.werks/3722 | 10 ++++++++++
ChangeLog | 2 ++
web/htdocs/mobile.py | 6 ++++++
3 files changed, 18 insertions(+)
diff --git a/.werks/3722 b/.werks/3722
new file mode 100644
index 0000000..344504c
--- /dev/null
+++ b/.werks/3722
@@ -0,0 +1,10 @@
+Title: Mobile GUI: Prevent it from being opened with regular sidebar
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1469514403
+
+
diff --git a/ChangeLog b/ChangeLog
index 394914a..789f3ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -406,6 +406,7 @@
* 3669 FIX: LDAP: Fixed very long running LDAP sync when using group based sync plugins
* 3670 FIX: Fixed empty AV PDF report when exporting it from a quicksearch result view
* 3622 FIX: Fix labelling of V-Achsis on graphs with very large numbers...
+ * 3722 FIX: Mobile GUI: Prevent it from being opened with regular sidebar
WATO:
* 3244 WATO BI Module: swap order of aggregation function and child node selection...
@@ -497,6 +498,7 @@
* 3583 FIX: Fixed loosing some services after saving services in WATO...
* 3588 FIX: BI aggregation: Fixed folding of tag groups in aggregation rules using host/service searches
* 3620 FIX: Do not longer put SNMP MIB files into WATO snapshots...
+ * 3542 FIX: WATO Web API: fixed exception when WATO Git is activated...
* 3547 FIX: Deleting a subfolder now generates a correct audit message...
* 3661 FIX: Service discovery is now possible with only "modify services" permission...
* 3152 FIX: lvm_vgs: fixed exception in host-specific settings if rule for LVM groups is set
diff --git a/web/htdocs/mobile.py b/web/htdocs/mobile.py
index 083aeaa..6f435e7 100644
--- a/web/htdocs/mobile.py
+++ b/web/htdocs/mobile.py
@@ -63,6 +63,12 @@ def mobile_html_head(title, ready_code=""):
if metrics.cmk_graphs_possible():
html.write(" <script type='text/javascript' src='js/graphs.js'></script>\n")
+ # Never allow the mobile page to be opened in a frameset. Redirect top page to the current content page.
+ # This will result in a full screen mobile interface page.
+ html.javascript('''if(top != self) {
+ window.top.location.href = location;
+}''')
+
html.write("""<script type='text/javascript'>
$(document).ready(function() { %s });
$(document).ready(function() {