summaryrefslogtreecommitdiffstats
path: root/modules-available
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available')
-rw-r--r--modules-available/baseconfig_bwlp/baseconfig/settings.json6
-rw-r--r--modules-available/baseconfig_bwlp/lang/de/config-variables.json1
-rw-r--r--modules-available/baseconfig_bwlp/lang/en/config-variables.json1
-rw-r--r--modules-available/bootstrap_datepicker/config.json8
-rw-r--r--modules-available/bootstrap_dialog/config.json8
-rw-r--r--modules-available/bootstrap_multiselect/config.json8
-rw-r--r--modules-available/bootstrap_switch/config.json9
-rw-r--r--modules-available/bootstrap_timepicker/config.json8
-rw-r--r--modules-available/dozmod/lang/de/messages.json3
-rw-r--r--modules-available/dozmod/lang/de/module.json1
-rw-r--r--modules-available/dozmod/lang/en/messages.json3
-rw-r--r--modules-available/dozmod/lang/en/module.json1
-rw-r--r--modules-available/dozmod/page.inc.php28
-rw-r--r--modules-available/exams/lang/de/template-tags.json4
-rw-r--r--modules-available/exams/lang/en/template-tags.json4
-rw-r--r--modules-available/exams/page.inc.php12
-rw-r--r--modules-available/exams/templates/page-add-edit-exam.html10
-rw-r--r--modules-available/exams/templates/page-upcoming-lectures.html5
-rw-r--r--modules-available/js_chart/config.json9
-rw-r--r--modules-available/js_circles/config.json9
-rw-r--r--modules-available/js_jqueryui/config.json8
-rw-r--r--modules-available/js_moment/config.json8
-rw-r--r--modules-available/js_selectize/config.json8
-rw-r--r--modules-available/js_stupidtable/config.json9
-rw-r--r--modules-available/js_vis/config.json8
-rw-r--r--modules-available/locationinfo/api.inc.php57
-rw-r--r--modules-available/locationinfo/config.json2
-rwxr-xr-xmodules-available/locationinfo/frontend/doorsign.html158
-rw-r--r--modules-available/locationinfo/frontend/panel.html354
-rw-r--r--modules-available/locationinfo/install.inc.php2
-rw-r--r--modules-available/locationinfo/lang/de/module.json2
-rw-r--r--modules-available/locationinfo/lang/de/template-tags.json51
-rw-r--r--modules-available/locationinfo/lang/en/template-tags.json27
-rw-r--r--modules-available/locationinfo/page.inc.php25
-rw-r--r--modules-available/locationinfo/templates/server-settings.html16
-rw-r--r--modules-available/locations/inc/location.inc.php2
-rw-r--r--modules-available/main/category-icons.json3
-rw-r--r--modules-available/main/lang/de/categories.json1
-rw-r--r--modules-available/main/lang/en/categories.json1
-rw-r--r--modules-available/main/templates/main-menu.html1
-rw-r--r--modules-available/news/lang/de/template-tags.json2
-rw-r--r--modules-available/news/lang/en/module.json2
-rw-r--r--modules-available/news/lang/en/template-tags.json2
-rw-r--r--modules-available/rebootcontrol/api.inc.php12
-rw-r--r--modules-available/rebootcontrol/config.json2
-rw-r--r--modules-available/rebootcontrol/inc/rebootqueries.inc.php21
-rw-r--r--modules-available/rebootcontrol/lang/de/template-tags.json6
-rw-r--r--modules-available/rebootcontrol/templates/_page.html4
-rw-r--r--modules-available/statistics/hooks/config-tgz.inc.php40
-rw-r--r--modules-available/statistics/inc/filter.inc.php1
-rw-r--r--modules-available/statistics/install.inc.php2
-rw-r--r--modules-available/statistics/lang/de/template-tags.json1
-rw-r--r--modules-available/statistics/lang/en/template-tags.json1
-rw-r--r--modules-available/statistics/templates/machine-main.html6
-rw-r--r--modules-available/statistics_reporting/config.json2
-rw-r--r--modules-available/statistics_reporting/inc/remotereport.inc.php13
-rw-r--r--modules-available/statistics_reporting/lang/de/template-tags.json3
-rw-r--r--modules-available/statistics_reporting/lang/en/template-tags.json1
-rw-r--r--modules-available/statistics_reporting/templates/columnChooser.html1
-rw-r--r--modules-available/sysconfig/addmodule_adauth.inc.php1
-rw-r--r--modules-available/sysconfig/addmodule_ldapauth.inc.php1
-rw-r--r--modules-available/sysconfig/api.inc.php7
-rw-r--r--modules-available/sysconfig/templates/ad_ldap-homedir.html4
-rw-r--r--modules-available/systemstatus/lang/de/module.json7
-rw-r--r--modules-available/systemstatus/lang/de/template-tags.json5
-rw-r--r--modules-available/systemstatus/lang/en/module.json7
-rw-r--r--modules-available/systemstatus/lang/en/template-tags.json5
-rw-r--r--modules-available/systemstatus/page.inc.php8
-rw-r--r--modules-available/systemstatus/templates/_page.html199
-rw-r--r--modules-available/webinterface/lang/de/template-tags.json5
-rw-r--r--modules-available/webinterface/lang/en/template-tags.json5
-rw-r--r--modules-available/webinterface/page.inc.php48
-rw-r--r--modules-available/webinterface/templates/customization.html30
-rw-r--r--modules-available/webinterface/templates/https.html6
74 files changed, 710 insertions, 631 deletions
diff --git a/modules-available/baseconfig_bwlp/baseconfig/settings.json b/modules-available/baseconfig_bwlp/baseconfig/settings.json
index 3eebcc1f..79127ccc 100644
--- a/modules-available/baseconfig_bwlp/baseconfig/settings.json
+++ b/modules-available/baseconfig_bwlp/baseconfig/settings.json
@@ -138,5 +138,11 @@
"defaultvalue": "",
"permissions": "2",
"validator": "regex:\/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|)$\/i"
+ },
+ "SLX_PVS_DEFAULT": {
+ "catid": "vmchooser",
+ "defaultvalue": "OFF",
+ "permissions": "2",
+ "validator": "list:ON|OFF"
}
}
diff --git a/modules-available/baseconfig_bwlp/lang/de/config-variables.json b/modules-available/baseconfig_bwlp/lang/de/config-variables.json
index a19c89ac..cae524b0 100644
--- a/modules-available/baseconfig_bwlp/lang/de/config-variables.json
+++ b/modules-available/baseconfig_bwlp/lang/de/config-variables.json
@@ -12,6 +12,7 @@
"SLX_PROXY_MODE": "Legt fest, ob zum Zugriff aufs Internet ein Proxy-Server ben\u00f6tigt wird.\r\n*off* = keinen Proxy benutzen.\r\n*on* = Proxy immer benutzen.\r\n*auto* = Proxy nur benutzen, wenn sich der Client-PC in einem privaten Adressbereich befindet.",
"SLX_PROXY_PORT": "Der Port des zu verwendenden Proxy Servers.",
"SLX_PROXY_TYPE": "Art des Proxys: *socks4*, *socks5*, *http-connect* (HTTP Proxy mit Unterst\u00fctzung der CONNECT-Methode), *http-relay* (Klassischer HTTP Proxy)",
+ "SLX_PVS_DEFAULT": "Legt fest, ob der Haken zur PVS-Teilnahme im vmChooser standardm\u00e4\u00dfig gesetzt ist oder nicht.",
"SLX_REBOOT_SCHEDULE": "Feste Uhrzeit, zu der sich die Rechner neustarten, auch wenn noch ein Benutzer aktiv ist.\r\nMehrere Zeitpunkte k\u00f6nnen durch Leerzeichen getrennt angegeben werden.",
"SLX_REMOTE_LOG_SESSIONS": "Legt fest, ob Logins und Logouts der Benutzer an den Satelliten gemeldet werden sollen.\r\n*yes* = Mit Benutzerkennung loggen\r\n*anonymous* = Anonym loggen\r\n*no* = Nicht loggen",
"SLX_ROOT_PASS": "Das root-Passwort des Grundsystems. Wird nur f\u00fcr Diagnosezwecke am Client ben\u00f6tigt.\r\nFeld leer lassen, um root-Logins zu verbieten.\r\n\/Hinweis\/: Das Passwort wird im Klartext in der lokalen Datenbank hinterlegt, jedoch immer gehasht an die Clients \u00fcbermittelt (SHA-512 mit Salt). Wenn Sie das Passwort auch im Satelliten nicht im Klartext speichern wollen, k\u00f6nnen Sie hier auch ein vorgehashtes Passwort eintragen (im *$6$....*-Format).",
diff --git a/modules-available/baseconfig_bwlp/lang/en/config-variables.json b/modules-available/baseconfig_bwlp/lang/en/config-variables.json
index 64788fee..37f983ad 100644
--- a/modules-available/baseconfig_bwlp/lang/en/config-variables.json
+++ b/modules-available/baseconfig_bwlp/lang/en/config-variables.json
@@ -12,6 +12,7 @@
"SLX_PROXY_MODE": "Determines whether a proxy server is required to access the Internet.\r\n*off* = do not use a Proxy.\r\n*on* = Always use proxy.\r\n*auto* = Only use proxy when the client PC is in a private address space.",
"SLX_PROXY_PORT": "The port to use for the proxy server.",
"SLX_PROXY_TYPE": "Type of the proxy.*socks4*, *socks5*, *http-connect* (HTTP proxy with support from the CONNECT method), *http-relay* (Classic HTTP proxy)",
+ "SLX_PVS_DEFAULT": "Set whether the \"Join PVS\" checkbox in vmChooser is checked by default.",
"SLX_REBOOT_SCHEDULE": "Fixed time to reboot the computer, even if there is a user active.\r\nSeveral times can be specified, separated by spaces.",
"SLX_REMOTE_LOG_SESSIONS": "Determines whether logins and logouts of the users should be reported to the satellite.\r\n*yes* = log with user ID\r\n*anonymous* = anonymous logging\r\n*no* = no logging",
"SLX_ROOT_PASS": "The root password of the client system. Only required for diagnostic purposes on the client.Leave field blank to disallow root logins.\r\n\/Hint\/: The password SHA-512-with-salt hashed before it's being sent to the client. It's only stored in clear text on the Satellite Server. If you want to have it hashed on the server too, you can supply a pre-hashed passoword in \/$6$...$...\/-format.",
diff --git a/modules-available/bootstrap_datepicker/config.json b/modules-available/bootstrap_datepicker/config.json
index d1261653..5a0c7960 100644
--- a/modules-available/bootstrap_datepicker/config.json
+++ b/modules-available/bootstrap_datepicker/config.json
@@ -1,3 +1,9 @@
{
- "dependencies" : []
+ "dependencies" : [],
+ "css": {
+ "style.css": true
+ },
+ "scripts": {
+ "clientscript.js": true
+ }
}
diff --git a/modules-available/bootstrap_dialog/config.json b/modules-available/bootstrap_dialog/config.json
index d1261653..5a0c7960 100644
--- a/modules-available/bootstrap_dialog/config.json
+++ b/modules-available/bootstrap_dialog/config.json
@@ -1,3 +1,9 @@
{
- "dependencies" : []
+ "dependencies" : [],
+ "css": {
+ "style.css": true
+ },
+ "scripts": {
+ "clientscript.js": true
+ }
}
diff --git a/modules-available/bootstrap_multiselect/config.json b/modules-available/bootstrap_multiselect/config.json
index d1261653..5a0c7960 100644
--- a/modules-available/bootstrap_multiselect/config.json
+++ b/modules-available/bootstrap_multiselect/config.json
@@ -1,3 +1,9 @@
{
- "dependencies" : []
+ "dependencies" : [],
+ "css": {
+ "style.css": true
+ },
+ "scripts": {
+ "clientscript.js": true
+ }
}
diff --git a/modules-available/bootstrap_switch/config.json b/modules-available/bootstrap_switch/config.json
index 9e26dfee..de4d37b4 100644
--- a/modules-available/bootstrap_switch/config.json
+++ b/modules-available/bootstrap_switch/config.json
@@ -1 +1,8 @@
-{} \ No newline at end of file
+{
+ "css": {
+ "style.css": true
+ },
+ "scripts": {
+ "clientscript.js": true
+ }
+} \ No newline at end of file
diff --git a/modules-available/bootstrap_timepicker/config.json b/modules-available/bootstrap_timepicker/config.json
index d1261653..5a0c7960 100644
--- a/modules-available/bootstrap_timepicker/config.json
+++ b/modules-available/bootstrap_timepicker/config.json
@@ -1,3 +1,9 @@
{
- "dependencies" : []
+ "dependencies" : [],
+ "css": {
+ "style.css": true
+ },
+ "scripts": {
+ "clientscript.js": true
+ }
}
diff --git a/modules-available/dozmod/lang/de/messages.json b/modules-available/dozmod/lang/de/messages.json
index e72fb1be..47580bcb 100644
--- a/modules-available/dozmod/lang/de/messages.json
+++ b/modules-available/dozmod/lang/de/messages.json
@@ -2,8 +2,9 @@
"all-templates-reset": "Alle Templates wurden zur\u00fcckgesetzt",
"delete-images": "L\u00f6schung: {{0}}",
"dozmod-error": "Fehler bei der Kommunikation mit dem bwLehrpool-Suite server: {{0}}",
- "images-pending-delete-exist": "Zur L\u00f6schung markierte Abbilder: {{0}}",
+ "images-pending-delete-exist": "Zur L\u00f6schung markierte VM-Versionen: {{0}}",
"mail-config-saved": "Mail-Konfiguration gespeichert",
+ "no-expired-images": "Keine Abgelaufenen VM-Versionen",
"nothing-submitted": "Es wurde nichts \u00fcbermittelt",
"runtimelimits-config-saved": "Einstellungen gespeichert",
"templates-saved": "Templates wurden gespeichert",
diff --git a/modules-available/dozmod/lang/de/module.json b/modules-available/dozmod/lang/de/module.json
index 5840d8af..02e8c84d 100644
--- a/modules-available/dozmod/lang/de/module.json
+++ b/modules-available/dozmod/lang/de/module.json
@@ -2,6 +2,7 @@
"module_name": "bwLehrpool-Suite",
"page_title": "Verwalten der bwLehrpool-Suite",
"submenu_actionlog": "Aktions-Log",
+ "submenu_expiredimages": "Abgelaufene VM-Versionen",
"submenu_mailconfig": "Email-Konfiguration",
"submenu_runtime": "Limits und Standardwerte",
"submenu_templates": "Textbausteine f\u00fcr E-Mails",
diff --git a/modules-available/dozmod/lang/en/messages.json b/modules-available/dozmod/lang/en/messages.json
index e1b5eea6..a17eae37 100644
--- a/modules-available/dozmod/lang/en/messages.json
+++ b/modules-available/dozmod/lang/en/messages.json
@@ -2,8 +2,9 @@
"all-templates-reset": "All templates have been reset",
"delete-images": "Delete: {{0}}",
"dozmod-error": "Error communicating with the bwLehrpool-Suite server: {{0}}",
- "images-pending-delete-exist": "Images marked for deletion: {{0}}",
+ "images-pending-delete-exist": "VMs marked for deletion: {{0}}",
"mail-config-saved": "Mail config saved",
+ "no-expired-images": "No expired VMs",
"nothing-submitted": "There was nothing submitted",
"runtimelimits-config-saved": "Configuration saved successfully",
"templates-saved": "Templates saved successfully",
diff --git a/modules-available/dozmod/lang/en/module.json b/modules-available/dozmod/lang/en/module.json
index 742aa848..17a2b838 100644
--- a/modules-available/dozmod/lang/en/module.json
+++ b/modules-available/dozmod/lang/en/module.json
@@ -2,6 +2,7 @@
"module_name": "bwLehrpool-Suite",
"page_title": "Manage the bwLehrpool-Suite",
"submenu_actionlog": "action log",
+ "submenu_expiredimages": "Expired VM versions",
"submenu_mailconfig": "email configuration",
"submenu_runtime": "limits and defaults",
"submenu_templates": "templates",
diff --git a/modules-available/dozmod/page.inc.php b/modules-available/dozmod/page.inc.php
index 9635aef1..9c247770 100644
--- a/modules-available/dozmod/page.inc.php
+++ b/modules-available/dozmod/page.inc.php
@@ -32,6 +32,20 @@ class Page_DozMod extends Page
Util::redirect('?do=Main');
}
+ /* add sub-menus */
+ Dashboard::addSubmenu('?do=dozmod&section=expiredimages', Dictionary::translate('submenu_expiredimages', true));
+ Dashboard::addSubmenu('?do=dozmod&section=mailconfig', Dictionary::translate('submenu_mailconfig', true));
+ Dashboard::addSubmenu('?do=dozmod&section=templates', Dictionary::translate('submenu_templates', true));
+ Dashboard::addSubmenu('?do=dozmod&section=runtimeconfig', Dictionary::translate('submenu_runtime', true));
+ Dashboard::addSubmenu('?do=dozmod&section=users', Dictionary::translate('submenu_users', true));
+ Dashboard::addSubmenu('?do=dozmod&section=actionlog', Dictionary::translate('submenu_actionlog', true));
+
+ $this->setupSubPage();
+ if ($this->subPage !== false) {
+ $this->subPage->doPreprocess();
+ return;
+ }
+
/* execute actions */
$action = Request::post('action', false, 'string');
@@ -48,20 +62,6 @@ class Page_DozMod extends Page
} elseif ($action !== false) {
Util::traceError('Invalid action: ' . $action);
}
-
- /* add sub-menus */
- Dashboard::addSubmenu('?do=dozmod&section=expiredimages', Dictionary::translate('submenu_expiredimages', true));
- Dashboard::addSubmenu('?do=dozmod&section=mailconfig', Dictionary::translate('submenu_mailconfig', true));
- Dashboard::addSubmenu('?do=dozmod&section=templates', Dictionary::translate('submenu_templates', true));
- Dashboard::addSubmenu('?do=dozmod&section=runtimeconfig', Dictionary::translate('submenu_runtime', true));
- Dashboard::addSubmenu('?do=dozmod&section=users', Dictionary::translate('submenu_users', true));
- Dashboard::addSubmenu('?do=dozmod&section=actionlog', Dictionary::translate('submenu_actionlog', true));
-
- $this->setupSubPage();
- if ($this->subPage !== false) {
- $this->subPage->doPreprocess();
- return;
- }
}
protected function doRender()
diff --git a/modules-available/exams/lang/de/template-tags.json b/modules-available/exams/lang/de/template-tags.json
index 6f4dce62..e011ee20 100644
--- a/modules-available/exams/lang/de/template-tags.json
+++ b/modules-available/exams/lang/de/template-tags.json
@@ -11,6 +11,7 @@
"lang_begin": "Beginn",
"lang_begin_date": "Beginn Datum",
"lang_begin_time": "Uhrzeit",
+ "lang_comfirmGlobalExam": "Wollen Sie wirklich eine globale Pr\u00fcfung definieren? Im gew\u00e4hlten Zeitraum werden s\u00e4mtliche R\u00e4ume in den Pr\u00fcfungsmodus geschaltet.",
"lang_deleteConfirmation": "Wirklich l\u00f6schen?",
"lang_description": "Beschreibung",
"lang_duration": "Dauer",
@@ -20,7 +21,7 @@
"lang_end_time": "Uhrzeit",
"lang_examModeDescription": "Hier k\u00f6nnen Sie bwLehrpool-R\u00e4ume zeitgesteuert in den Pr\u00fcfungsmodus versetzen. Im Pr\u00fcfungsmodus ist das Client-System st\u00e4rker abgeriegelt, sodass es sich zum Schreiben von E-Pr\u00fcfungen eignet. Nach dem Ein- bzw. Ausschalten des Pr\u00fcfungsmodus ist es notwendig, die Rechner in den betroffenen R\u00e4umen neuzustarten.",
"lang_global": "Global",
- "lang_headingAllExamLectures": "Liste ausstehender Pr\u00fcfungsveranstaltungen",
+ "lang_headingAllExamLectures": "Ausstehende Pr\u00fcfungsveranstaltungen (30 Tage)",
"lang_headingGraphicalOverview": "Grafische Darstellung",
"lang_headingMain": "bwLehrpool Pr\u00fcfungsmodus",
"lang_id": "ID",
@@ -29,6 +30,7 @@
"lang_location": "Raum\/Ort",
"lang_locationInfo": "W\u00e4hlen Sie hier die R\u00e4ume und Orte aus, die w\u00e4hrend des unten ausgew\u00e4hlten Zeitraums in den Pr\u00fcfungsmodus versetzt werden. Wenn sie hier keine Auswahl treffen, werden alle R\u00e4ume in den Pr\u00fcfungsmodus versetzt.",
"lang_locations": "R\u00e4ume\/Orte",
+ "lang_moreThanOneDay": "Mehr als ein Tag",
"lang_noDescription": "Keine Beschreibung",
"lang_none": "(Keine)",
"lang_timeFrame": "Zeitraum"
diff --git a/modules-available/exams/lang/en/template-tags.json b/modules-available/exams/lang/en/template-tags.json
index f91329c9..a4ae9325 100644
--- a/modules-available/exams/lang/en/template-tags.json
+++ b/modules-available/exams/lang/en/template-tags.json
@@ -11,6 +11,7 @@
"lang_begin": "Begin",
"lang_begin_date": "Begin Date",
"lang_begin_time": "Time",
+ "lang_comfirmGlobalExam": "Do you really want to create a global exam? Every single room will be set to lecture mode during the selected time period.",
"lang_deleteConfirmation": "Are you sure?",
"lang_description": "Description",
"lang_duration": "Duration",
@@ -20,7 +21,7 @@
"lang_end_time": "Time",
"lang_examModeDescription": "Here you can define time spans during which selected rooms will be set to exam mode. In exam mode, the client computers are more locked down than usual so it is suitable for writing electronic exams.",
"lang_global": "Global",
- "lang_headingAllExamLectures": "Upcoming lectures marked as exams",
+ "lang_headingAllExamLectures": "Upcoming lectures marked as exams (30 days)",
"lang_headingGraphicalOverview": "Graphical overview",
"lang_headingMain": "bwLehrpool exam mode",
"lang_id": "ID",
@@ -29,6 +30,7 @@
"lang_location": "Room\/Location",
"lang_locationInfo": "Select the rooms and locations you want to enable the exam mode in. Selecting nothing at all means that all clients will boot into exam mode during the given time period.",
"lang_locations": "Rooms\/Locations",
+ "lang_moreThanOneDay": "More than one day",
"lang_noDescription": "No description",
"lang_none": "(None)",
"lang_timeFrame": "Time frame"
diff --git a/modules-available/exams/page.inc.php b/modules-available/exams/page.inc.php
index 930ba62c..48af287a 100644
--- a/modules-available/exams/page.inc.php
+++ b/modules-available/exams/page.inc.php
@@ -3,9 +3,9 @@
class Page_Exams extends Page
{
var $action = false;
- var $exams;
- var $locations;
- var $lectures;
+ var $exams = [];
+ var $locations = [];
+ var $lectures = [];
private $currentExam;
private $rangeMin;
private $rangeMax;
@@ -35,7 +35,8 @@ class Page_Exams extends Page
. "NATURAL LEFT JOIN exams_x_location exl "
. "NATURAL LEFT JOIN location loc "
. "LEFT JOIN sat.lecture l USING (lectureid) "
- . "GROUP BY examid ");
+ . "GROUP BY examid "
+ . "ORDER BY examid ASC");
while ($exam = $tmp->fetch(PDO::FETCH_ASSOC)) {
$this->exams[] = $exam;
}
@@ -49,7 +50,8 @@ class Page_Exams extends Page
"INNER JOIN sat.user ON (user.userid = lecture.ownerid) " .
"NATURAL LEFT JOIN sat.lecture_x_location " .
"WHERE isexam <> 0 AND starttime < :rangeMax AND endtime > :rangeMin " .
- "GROUP BY lectureid",
+ "GROUP BY lectureid " .
+ "ORDER BY starttime ASC, displayname ASC",
['rangeMax' => $this->rangeMax, 'rangeMin' => $this->rangeMin]);
while ($lecture = $tmp->fetch(PDO::FETCH_ASSOC)) {
$this->lectures[] = $lecture;
diff --git a/modules-available/exams/templates/page-add-edit-exam.html b/modules-available/exams/templates/page-add-edit-exam.html
index 106c6641..bf000df5 100644
--- a/modules-available/exams/templates/page-add-edit-exam.html
+++ b/modules-available/exams/templates/page-add-edit-exam.html
@@ -110,7 +110,7 @@
<input type="hidden" name="action" value="save">
<input type="hidden" name="token" value="{{token}}">
<input type="hidden" name="examid" value="{{exam.examid}}">
- <button class="btn btn-success">{{lang_save}}</button>
+ <button class="btn btn-success" type="submit">{{lang_save}}</button>
</form>
<script type="application/javascript"><!--
@@ -206,5 +206,13 @@ document.addEventListener("DOMContentLoaded", function () {
end_time.change(startEndChanged);
$('#lecturelist').change(updateLectureInfo);
+ $('#tolleform').submit(function(ev) {
+ if ($('#locations option:selected').length === 0 && $('#locations option').length > 1) {
+ if (!confirm('{{lang_comfirmGlobalExam}}')) {
+ ev.preventDefault();
+ }
+ }
+ });
+
}, false);
// --></script>
diff --git a/modules-available/exams/templates/page-upcoming-lectures.html b/modules-available/exams/templates/page-upcoming-lectures.html
index a1867444..323b1017 100644
--- a/modules-available/exams/templates/page-upcoming-lectures.html
+++ b/modules-available/exams/templates/page-upcoming-lectures.html
@@ -17,7 +17,10 @@
</td>
<td width="30%" class="text-nowrap">
{{starttime_s}} &ensp; {{endtime_s}}
- <div class="small">{{duration_s}}</div>
+ <div class="small">
+ {{lang_duration}}: {{duration_s}}
+ {{^duration_s}}{{lang_moreThanOneDay}}{{/duration_s}}
+ </div>
</td>
<td width="20%">
<div class="pull-right text-nowrap">
diff --git a/modules-available/js_chart/config.json b/modules-available/js_chart/config.json
index 9e26dfee..de4d37b4 100644
--- a/modules-available/js_chart/config.json
+++ b/modules-available/js_chart/config.json
@@ -1 +1,8 @@
-{} \ No newline at end of file
+{
+ "css": {
+ "style.css": true
+ },
+ "scripts": {
+ "clientscript.js": true
+ }
+} \ No newline at end of file
diff --git a/modules-available/js_circles/config.json b/modules-available/js_circles/config.json
index 9e26dfee..de4d37b4 100644
--- a/modules-available/js_circles/config.json
+++ b/modules-available/js_circles/config.json
@@ -1 +1,8 @@
-{} \ No newline at end of file
+{
+ "css": {
+ "style.css": true
+ },
+ "scripts": {
+ "clientscript.js": true
+ }
+} \ No newline at end of file
diff --git a/modules-available/js_jqueryui/config.json b/modules-available/js_jqueryui/config.json
index d1261653..5a0c7960 100644
--- a/modules-available/js_jqueryui/config.json
+++ b/modules-available/js_jqueryui/config.json
@@ -1,3 +1,9 @@
{
- "dependencies" : []
+ "dependencies" : [],
+ "css": {
+ "style.css": true
+ },
+ "scripts": {
+ "clientscript.js": true
+ }
}
diff --git a/modules-available/js_moment/config.json b/modules-available/js_moment/config.json
index d1261653..5a0c7960 100644
--- a/modules-available/js_moment/config.json
+++ b/modules-available/js_moment/config.json
@@ -1,3 +1,9 @@
{
- "dependencies" : []
+ "dependencies" : [],
+ "css": {
+ "style.css": true
+ },
+ "scripts": {
+ "clientscript.js": true
+ }
}
diff --git a/modules-available/js_selectize/config.json b/modules-available/js_selectize/config.json
index d1261653..5a0c7960 100644
--- a/modules-available/js_selectize/config.json
+++ b/modules-available/js_selectize/config.json
@@ -1,3 +1,9 @@
{
- "dependencies" : []
+ "dependencies" : [],
+ "css": {
+ "style.css": true
+ },
+ "scripts": {
+ "clientscript.js": true
+ }
}
diff --git a/modules-available/js_stupidtable/config.json b/modules-available/js_stupidtable/config.json
index 9e26dfee..cf932d7e 100644
--- a/modules-available/js_stupidtable/config.json
+++ b/modules-available/js_stupidtable/config.json
@@ -1 +1,8 @@
-{} \ No newline at end of file
+{
+ "css": {
+ "style.css": true
+ },
+ "scripts": {
+ "clientscript.js": true
+ }
+} \ No newline at end of file
diff --git a/modules-available/js_vis/config.json b/modules-available/js_vis/config.json
index ccdf64b7..3b027d31 100644
--- a/modules-available/js_vis/config.json
+++ b/modules-available/js_vis/config.json
@@ -1,3 +1,9 @@
{
- "dependencies" : ["js_moment"]
+ "dependencies" : ["js_moment"],
+ "css": {
+ "style.css": true
+ },
+ "scripts": {
+ "clientscript.js": true
+ }
}
diff --git a/modules-available/locationinfo/api.inc.php b/modules-available/locationinfo/api.inc.php
index 9b698d65..945c4c92 100644
--- a/modules-available/locationinfo/api.inc.php
+++ b/modules-available/locationinfo/api.inc.php
@@ -189,26 +189,28 @@ function formatOpeningtime($openingtime)
{
$result = array();
$weekarray = array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday");
- foreach ($weekarray as $d) {
+ foreach ($weekarray as $checkDay) {
$array = array();
foreach ($openingtime as $opt) {
- foreach ($opt['days'] as $val) {
- if ($val == $d) {
- $arr = array();
-
- $openTime = explode(':', $opt['openingtime']);
- $arr['HourOpen'] = $openTime[0];
- $arr['MinutesOpen'] = $openTime[1];
-
- $closeTime = explode(':', $opt['closingtime']);
- $arr['HourClose'] = $closeTime[0];
- $arr['MinutesClose'] = $closeTime[1];
-
+ if (!isset($opt['days']) || !is_array($opt['days']))
+ continue;
+ $openTime = explode(':', $opt['openingtime']);
+ $closeTime = explode(':', $opt['closingtime']);
+ if (count($openTime) !== 2 || count($closeTime) !== 2)
+ continue;
+ $arr = array(
+ 'HourOpen' => $openTime[0],
+ 'MinutesOpen' => $openTime[1],
+ 'HourClose' => $closeTime[0],
+ 'MinutesClose' => $closeTime[1],
+ );
+ foreach ($opt['days'] as $calDay) {
+ if ($calDay === $checkDay) {
$array[] = $arr;
}
}
if (!empty($array)) {
- $result[$d] = $array;
+ $result[$checkDay] = $array;
}
}
}
@@ -272,32 +274,32 @@ function defaultConfig()
* Gets the pc states of the given locations.
*
* @param int[] $idList list of the location ids.
- * @return string PC state JSON
+ * @return array aggregated PC states
*/
function getPcStates($idList)
{
$pcStates = array();
-
- $locationInfoList = getLocationInfo($idList);
- foreach ($locationInfoList as $locationInfo) {
- $result = array(
- 'id' => $locationInfo['id'],
+ foreach ($idList as $id) {
+ $pcStates[$id] = array(
+ 'id' => $id,
'idle' => 0,
'occupied' => 0,
'off' => 0,
'broken' => 0,
);
-
+ }
+ $locationInfoList = getLocationInfo($idList);
+ foreach ($locationInfoList as $locationInfo) {
+ $id = $locationInfo['id'];
foreach ($locationInfo['computer'] as $computer) {
$key = strtolower($computer['pcState']);
- if (isset($result[$key])) {
- $result[$key]++;
+ if (isset($pcStates[$id][$key])) {
+ $pcStates[$id][$key]++;
}
}
-
- $pcStates[] = $result;
}
- return $pcStates;
+
+ return array_values($pcStates);
}
/**
@@ -308,6 +310,9 @@ function getPcStates($idList)
*/
function getLocationTree($idList)
{
+ if (in_array(0, $idList)) {
+ return array_values(Location::getTree());
+ }
$locations = Location::getTree();
$ret = findLocations($locations, $idList);
diff --git a/modules-available/locationinfo/config.json b/modules-available/locationinfo/config.json
index d4cab3f0..87825809 100644
--- a/modules-available/locationinfo/config.json
+++ b/modules-available/locationinfo/config.json
@@ -1,4 +1,4 @@
{
- "category":"main.content",
+ "category":"main.beta",
"dependencies": ["js_jqueryui", "bootstrap_timepicker", "locations", "bootstrap_switch"]
}
diff --git a/modules-available/locationinfo/frontend/doorsign.html b/modules-available/locationinfo/frontend/doorsign.html
index 6c943e03..ee4f8c6c 100755
--- a/modules-available/locationinfo/frontend/doorsign.html
+++ b/modules-available/locationinfo/frontend/doorsign.html
@@ -134,7 +134,7 @@ optional:
.calendar {
float: left;
padding: 0;
- dboxSizing: border-box;
+ box-sizing: border-box;
background: linear-gradient(#cccccc, white);
}
@@ -416,6 +416,55 @@ optional:
}
+ const PARAM_STRING = 1;
+ const PARAM_INT = 2;
+ const PARAM_BOOL = 3;
+
+ /**
+ * Read given parameter from URL, replacing it in the config object if present.
+ * @param config object config object
+ * @param property string name of property in object, URL param of same name is being checked
+ * @param paramType int one of PARAM_STRING, PARAM_INT, PARAM_BOOL
+ * @param intScaleFactor int optional scale factor that will be applied if paramType == PARAM_INT
+ */
+ function setRoomConfigFromUrl(config, property, paramType, intScaleFactor) {
+ var val = getUrlParameter(property);
+ if (val === true || val === false)
+ return;
+ if (paramType === PARAM_STRING) {
+ config[property] = val;
+ } else if (paramType === PARAM_INT) {
+ config[property] = parseInt(val);
+ if (intScaleFactor) {
+ config[property] *= intScaleFactor;
+ }
+ } else if (paramType === PARAM_BOOL) {
+ val = val.toLowerCase();
+ config[property] = val.length > 0 && val !== 'false' && val !== 'off' ? true : false;
+ } else {
+ console.log('Invalid paramType: ' + paramType);
+ }
+ }
+
+ /**
+ * Put given numeric config property in range min..max (both inclusive),
+ * if not in range, set to default.
+ * @param config - object config object
+ * @param property - string config property
+ * @param min int - min allowed value (inclusive)
+ * @param max int - max allowed value (inclusive)
+ * @param defaultval - default value to use if out of range
+ * @param scaleFactor int - optional scale factor to apply
+ */
+ function putInRange(config, property, min, max, defaultval, scaleFactor) {
+ var v = config[property];
+ if (!scaleFactor) {
+ scaleFactor = 1;
+ }
+ if (!v || !isFinite(v) || isNaN(v) || v < min * scaleFactor || v > max * scaleFactor) {
+ config[property] = defaultval * scaleFactor;
+ }
+ }
/**
* gets Additional Parameters from the URL, and from the
@@ -423,91 +472,38 @@ optional:
* also makes sure parameters are in a given range
* @param room Room Object
*/
-
function getParamerter(room) {
- if (room.config != null) {
+ if (room.config) {
room.config.switchtime = room.config.switchtime * 1000;
room.config.calupdate = room.config.calupdate * 60 * 1000;
room.config.roomupdate = room.config.roomupdate * 1000;
room.config.configupdate = room.config.configupdate * 60 * 1000;
}
- if (getUrlParameter("mode") != null) {
- room.config.mode = parseInt(getUrlParameter("mode"));
- }
- if (getUrlParameter("calupdate") != null) {
- room.config.calupdate = (parseInt(getUrlParameter("calupdate")) * 60 * 1000);
- }
- if (getUrlParameter("roomupdate") != null) {
- room.config.roomupdate = (parseInt(getUrlParameter("roomupdate")) * 1000);
- }
- if (getUrlParameter("daystoshow") != null) {
- room.config.daystoshow = parseInt(getUrlParameter("daystoshow"));
- }
- if (getUrlParameter("scaledaysauto") == "true") {
- room.config.scaledaysauto = true;
- } else if (getUrlParameter("scaledaysauto") == "false") {
- room.config.scaledaysauto = false;
- }
- if (getUrlParameter("vertical") == "true") {
- room.config.vertical = true;
- } else if (getUrlParameter("vertical") == "false") {
- room.config.vertical = false;
- }
- if (getUrlParameter("einkmode") == "true") {
- room.config.einkmode = true;
- } else if (getUrlParameter("einkmode") == "false") {
- room.config.einkmode = false;
- }
+ setRoomConfigFromUrl(room.config, 'mode', PARAM_INT);
+ setRoomConfigFromUrl(room.config, 'calupdate', PARAM_INT, 60 * 1000);
+ setRoomConfigFromUrl(room.config, 'roomupdate', PARAM_INT, 1000);
+ setRoomConfigFromUrl(room.config, 'daystoshow', PARAM_INT);
+ setRoomConfigFromUrl(room.config, 'scaledaysauto', PARAM_BOOL);
+ setRoomConfigFromUrl(room.config, 'vertical', PARAM_BOOL);
+ setRoomConfigFromUrl(room.config, 'eco', PARAM_BOOL);
- if (getUrlParameter("scale") != null) {
- room.config.scale = parseInt(getUrlParameter("scale"));
- }
- if (getUrlParameter("rotation") != null) {
- room.config.rotation = parseInt(getUrlParameter("rotation"));
- }
- if (getUrlParameter("switchtime") != null) {
- room.config.switchtime = (parseInt(getUrlParameter("switchtime")) * 1000);
- }
- if (getUrlParameter("configupdate") != null) {
- room.config.configupdate = (parseInt(getUrlParameter("configupdate")) * 60 * 1000);
- }
+ setRoomConfigFromUrl(room.config, 'scale', PARAM_INT);
+ setRoomConfigFromUrl(room.config, 'rotation', PARAM_INT);
+ setRoomConfigFromUrl(room.config, 'switchtime', PARAM_INT, 1000);
+ setRoomConfigFromUrl(room.config, 'configupdate', PARAM_INT, 60 * 1000);
// parameter validation
- if (room.config.switchtime == null || isNaN(room.config.switchtime) || room.config.switchtime > 120 * 1000
- || room.config.switchtime < 1 * 1000) {
- room.config.switchtime = 5 * 1000;
- }
- if (room.config.scale == null || isNaN(room.config.scale) || room.config.scale > 90 || room.config.scale < 10) {
- room.config.scale = 50;
- }
- if (room.config.vertical == null) {
- room.config.vertical = false;
- }
- if (room.config.daystoshow == null || isNaN(room.config.daystoshow) || room.config.daystoshow > 7
- || room.config.daystoshow < 1) {
- room.config.daystoshow = 7;
- }
-
- if (room.config.roomupdate == null || isNaN(room.config.roomupdate) || room.config.roomupdate < 1000) {
- room.config.roomupdate = 20 * 1000;
- }
- if (room.config.configupdate == null || isNaN(room.config.configupdate) || (room.config.configupdate < 1)) {
- room.config.configupdate = 30 * 60 * 1000;
- }
-
- if (room.config.calupdate == null || isNaN(room.config.calupdate) || room.config.calupdate < 60 * 1000) {
- room.config.calupdate = 30 * 60 * 1000;
- }
- if (room.config.mode == null || isNaN(room.config.mode) || room.config.mode > 4 || room.config.mode < 1) {
- room.config.mode = 1;
- }
- if (room.config.rotation == null || isNaN(room.config.rotation) || room.config.rotation < 0
- || room.config.rotation > 4) {
- room.config.rotation = 0;
- }
+ putInRange(room.config, 'switchtime', 5, 120, 6, 1000);
+ putInRange(room.config, 'scale', 10, 90, 50);
+ putInRange(room.config, 'daystoshow', 1, 7, 7);
+ putInRange(room.config, 'roomupdate', 15, 5*60, 60, 1000);
+ putInRange(room.config, 'configupdate', 5, 60, 30, 60*1000);
+ putInRange(room.config, 'calupdate', 1, 60, 30, 60*1000);
+ putInRange(room.config, 'mode', 1, 4, 1);
+ putInRange(room.config, 'rotation', 0, 3, 0);
if (getUrlParameter("lang") != null && getUrlParameter("lang") in translation) {
room.config.language = getUrlParameter("lang");
@@ -844,7 +840,7 @@ optional:
div.className = "calendar";
if (room.config.vertical && room.config.mode == 1) {
width = 100 + "%";
- div.float = "Top";
+ $(div).css('float', "none");
}
div.style.width = width;
//document.body.appendChild(div);
@@ -1063,7 +1059,7 @@ optional:
// dont show?
return "";
}
- if (room.config.einkmode) {
+ if (room.config.eco) {
return hours + ":" + minutes;
}
return hours + ":" + minutes + ":" + seconds;
@@ -1321,7 +1317,7 @@ optional:
div.className = "roomLayoutDesign";
if ((room.config.vertical && room.config.mode == 1) || (room.config.mode == 3) || (room.config.mode == 4)) {
width = 100 + "%";
- div.float = "Top";
+ $(div).css('float', "none");
}
div.style.width = width;
@@ -1654,7 +1650,7 @@ optional:
}
if (imgobj != null && supportSvg) {
- if (room.config.einkmode) {
+ if (room.config.eco) {
img = img + "_eink";
}
imgobj.src = img + ".svg";
@@ -1709,12 +1705,14 @@ optional:
i;
for (i = 0; i < sURLVariables.length; i++) {
- sParameterName = sURLVariables[i].split('=');
+ sParameterName = sURLVariables[i].split('=', 2);
if (sParameterName[0] === sParam) {
- return sParameterName[1] === undefined ? true : sParameterName[1];
+ if (sParameterName.length === 1) return true;
+ return sParameterName[1];
}
}
+ return false;
};
/**
diff --git a/modules-available/locationinfo/frontend/panel.html b/modules-available/locationinfo/frontend/panel.html
index bd22408e..7b15f640 100644
--- a/modules-available/locationinfo/frontend/panel.html
+++ b/modules-available/locationinfo/frontend/panel.html
@@ -8,114 +8,93 @@
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
background-color: lightgrey;
+ color: black;
}
- .main {
- background-color: lightgrey;
-
+ #main {
+ display: flex;
+ flex-wrap: wrap;
}
- .child {
- background-color: white;
- display: inline-block;
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- padding: 1vmin;
- float: left;
+ .outermost {
+ font-size: 16pt;
}
- .parent {
- background-color: white;
- display: inline-block;
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ .parent, .child {
padding: 5px;
float: left;
-
- }
-
- .childWithBorder {
- display: inline-flex;
- padding: 0.4vmin;
-
- }
-
- .outermost {
-
+ background-color: white;
+ font-size: 90%;
+ min-height: 7em;
+ flex-grow: 1;
+ align-items: stretch;
}
- .row {
- float: left
+ .parent .parent, .parent .child {
+ min-height: 5em;
}
.border {
+ flex-grow: 1;
display: inline-flex;
+ align-items: stretch;
padding: 5px;
}
- .borderout {
- display: inline-flex;
- padding: 0.4vmin;
- }
-
.courseFont {
- padding: 0.5vmin;
- font-size: 2vmin;
+ padding: 2px;
+ font-size: 90%;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: bold;
overflow: hidden;
}
.headerFont {
- font-size: 4vmin;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: bold;
border: 0px;
- border-bottom: 0.2vmin;
- margin-bottom: 1vmin;
+ border-bottom: 1px;
+ margin-bottom: 1px;
border-color: grey;
border-style: solid;
-
}
- .divPcOn, .divPcPcUsed, .divPcPcOff, .divPcPcDefect {
- width: 4vmin;
- height: 4vmin;
+ .pc-idle, .pc-occupied, .pc-off, .pc-broken {
+ padding: 2px 1px;
text-align: center;
- font-size: 3vmin;
+ font-size: 90%;
font-weight: 800;
- border-radius: 0.4vmin;
-
+ overflow: hidden;
+ transition: width 2s;
+ width: 25%;
}
- .divPcOn {
+ .pc-idle {
background-color: green;
- text-align: center;
+ border-radius: 3px 0px 0px 3px;
}
- .divPcPcUsed {
-
+ .pc-occupied {
background-color: red;
}
- .divPcPcOff {
+ .pc-off {
background-color: darkgrey;
}
- .divPcPcDefect {
+ .pc-broken {
background-color: black;
color: white;
+ border-radius: 0px 3px 3px 0px;
}
- .divAroundPcStates {
+ .pc-state-wrapper {
display: flex;
- justify-content: flex-end;
-
}
.paperEffect {
margin: 0 auto;
background-color: #fff;
- -webkit-box-shadow: 0 0 0.2vmin rgba(0, 0, 0, 0.4), inset 0 0 1vmin rgba(0, 0, 0, 0.1);
- -moz-box-shadow: 0 0 0.2vmin rgba(0, 0, 0, 0.4), inset 0 0 1vmin rgba(0, 0, 0, 0.1);
box-shadow: 0 0 0.2vmin rgba(0, 0, 0, 0.4), inset 0 0 1vmin rgba(0, 0, 0, 0.1);
border-radius: 1px;
}
@@ -127,12 +106,6 @@
var rooms = {};
var startdate;
var roomidsString = "";
- var lastPcUpdate;
- var lastTimeTableUpdate;
-
- // Todo change these
- var pcStateUpdateTime = 60; // in seconds
- var TimeTableUpdateTime = 60 * 30; //in seconds
$(document).ready(function () {
@@ -146,105 +119,11 @@
$.getJSON("../../../api.php?do=locationinfo&action=locationtree&id=" + ids, function (result) {
generateLayout(result);
- setInterval(update, 1000);
- arrange();
+ setTimeout(update, 1000);
});
}
- /**
- * Main Fuction for aranging the divs
- */
- function arrange() {
- var height = $(window).height();
- var width = $(window).width();
- var childs = $(".childWithBorder");
- var parents = [];
- for (var i = 0; i < childs.length; i++) {
- var parent = $(childs[i]).parent();
- if ($.inArray(parent[0], parents) == -1) {
- parents.push(parent[0]);
- }
- }
- for (var i = 0; i < parents.length; i++) {
- childs = $(parents[i]).children();
-
- if (checkForLineBreak(parents[i], childs) > 0) {
- makeItFit(parents[i], childs, childs.length / 2);
- }
-
- }
-
- }
- /**
- * rekursive calls itselfs and trys to find the best number off childs
- * which should be side by side.
- * @param parent Parent div
- * @param childs Child divs
- * @param breakAfter number after the divs should go in the next row
- */
- function makeItFit(parent, childs, breakAfter) {
- breakAfter = Math.abs(breakAfter);
- var width = checkIfFit(parent, childs, breakAfter)
- if (width > 0) {
- $(parent).width(width + 20);
- } else {
- makeItFit(parent, childs, breakAfter - 1);
- }
- }
-
- /**
- * checks if a given number off divs(side by side) would fit on the screen
- * @param parent Parent div
- * @param childs Child divs
- * @param breakAfter number after the divs should go in the next row
- * @returns -1 if it wouldn't fit else the width the div should have
- */
- function checkIfFit(parent, childs, breakAfter) {
- var parentWidth = $(parent).width();
- var maxWidth = 0;
- var curWidth = 0;
- var t = 0;
- for (var i = 0; i < childs.length; i++) {
- var childWidth = $(childs[i]).width();
- if ((curWidth + childWidth > parentWidth && breakAfter > 1)) {
- return -1;
- }
- curWidth += childWidth;
- t++;
- if (t == breakAfter) {
- maxWidth = Math.max(curWidth, maxWidth);
- curWidth = 0;
- t = 0;
- }
-
- }
- return maxWidth
- }
-
- /**
- * return the number of Linebreaks the divs would make
- * @param parent Parent div
- * @param childs Child divs
- * @returns the number of Linebreaks the divs would make
- */
- function checkForLineBreak(parent, childs) {
- var linebreaks = 0;
- var curWidth = 0;
- var parentWidth = $(parent).width();
- for (var i = 0; i < childs.length; i++) {
- var childWidth = $(childs[i]).width();
- if (curWidth + childWidth < parentWidth) {
- curWidth += childWidth;
- } else {
- linebreaks++;
-
- curWidth = childWidth;
- }
- }
- return linebreaks;
- }
-
function SetUpDate(d) {
startdate = d.getTime() - new Date().getTime();
}
@@ -254,18 +133,10 @@
}
function generateLayout(json) {
- var ids = getUrlParameter("id");
- ids = ids.split(',');
- for (var t = 0; t < ids.length; t++) {
-
- for (var i = 0; i < json.length; i++) {
- if (ids[t] == json[i].locationid) {
- var el = generateObject(json[i], ($("#main")), true);
- }
-
- }
+ for (var i = 0; i < json.length; i++) {
+ console.log('Outermost for ' + json[i].locationid);
+ var el = generateObject(json[i], ($("#main")), true);
}
-
}
/**
@@ -282,7 +153,7 @@
} else {
obj = generateParent(myParent, json.locationid, json.locationname, outermost);
for (var i = 0; i < json.children.length; i++) {
- generateObject(json.children[i], $("#parent_" + json.locationid));
+ generateObject(json.children[i], $("#parent_" + json.locationid), false);
}
}
return obj;
@@ -304,37 +175,39 @@
}
- var timeSteps = 10;
- function update() {
+ const ROOMUPDATE_MS = 2*60*1000;
+ const CALUPDATE_MS = 20*60*1000;
- if (timeSteps > 9) {
- timeSteps = 0;
- var calendarUpdateIds = "";
- var rommUpdateIds = "";
- for (var property in rooms) {
- if (rooms[property].lastCalendarUpdate == null || rooms[property].lastCalendarUpdate + rooms[property].config.calupdates < MyDate().getTime()) {
- calendarUpdateIds = addIdToUpdateList(calendarUpdateIds, rooms[property].id);
- rooms[property].lastCalendarUpdate = MyDate().getTime();
- }
- if (rooms[property].lastRoomUpdate == null || rooms[property].lastRoomUpdate + rooms[property].config.roomupdate < MyDate().getTime()) {
- rommUpdateIds = addIdToUpdateList(rommUpdateIds, rooms[property].id);
- rooms[property].lastRoomUpdate = MyDate().getTime();
-
- }
- }
- if (calendarUpdateIds != "") {
- queryCalendars(calendarUpdateIds);
+ function update() {
+ var calendarUpdateIds = "";
+ var rommUpdateIds = "";
+ var count = 0;
+ var nextUpdate = 15000;
+ for (var property in rooms) {
+ if (rooms[property].lastCalendarUpdate === null || rooms[property].lastCalendarUpdate + CALUPDATE_MS < MyDate().getTime()) {
+ calendarUpdateIds = addIdToUpdateList(calendarUpdateIds, rooms[property].id);
+ count++;
+ rooms[property].lastCalendarUpdate = MyDate().getTime();
}
- if (rommUpdateIds != "") {
- queryRooms(rommUpdateIds);
+ if (rooms[property].lastRoomUpdate === null || rooms[property].lastRoomUpdate + ROOMUPDATE_MS < MyDate().getTime()) {
+ rommUpdateIds = addIdToUpdateList(rommUpdateIds, rooms[property].id);
+ count++;
+ rooms[property].lastRoomUpdate = MyDate().getTime();
}
+ if (count > 7) break;
+ }
+ if (calendarUpdateIds !== "") {
+ queryCalendars(calendarUpdateIds);
+ nextUpdate = 1000;
+ }
+ if (rommUpdateIds !== "") {
+ queryRooms(rommUpdateIds);
+ nextUpdate = 1000;
}
- // TODO
for (var property in rooms) {
upDateRoomState(rooms[property]);
}
- timeSteps++;
-
+ setTimeout(update, nextUpdate);
}
@@ -379,14 +252,13 @@
* @param room A room to update
*/
function upDateRoomState(room) {
- if (room === undefined) {
- console.log("error");
+ if (room === undefined || room.lastRoomUpdate === null) {
return;
}
var state = room.getState();
- if (state.state == "ClaendarEvent") {
+ if (state.state == "CalendarEvent") {
updateCourseText(room.id, state.titel);
updateCoursTimer(room.id, GetTimeDiferenceAsString(state.end, MyDate()));
} else if (state.state == "Free") {
@@ -420,7 +292,7 @@
* @param name Name of the room
* @param config Config Json of the room
*/
- function addRoom(id, name, config) {
+ function addRoom(id, name) {
var room = {
id: id,
name: name,
@@ -430,11 +302,10 @@
timeTilFree: null,
state: null,
openingTimes: null,
- config: config,
lastCalendarUpdate: null,
lastRoomUpdate: null,
getState: function () {
- if (this.state == null) {
+ if (!this.state) {
ComputeCurrentState(this);
return this.state;
}
@@ -448,14 +319,6 @@
};
- if (room.config.calupdate === undefined || room.config.calupdate < 1) {
- room.config.calupdate = 1;
- }
- room.config.calupdate = room.config.calupdate * 60 * 1000;
- if (room.config.roomupdate === undefined || room.config.roomupdate < 1) {
- room.config.roomupdate = 1;
- }
- room.config.roomupdate = room.config.roomupdate * 1000;
rooms[id] = room;
@@ -473,6 +336,10 @@
* @param Room Object
*/
function ComputeCurrentState(room) {
+ if (room.lastRoomUpdate === null) {
+ room.state = {state: 'unknown'};
+ return;
+ }
if (!IsOpenNow(room)) {
room.state = {state: "closed", end: GetNextOpening(room), titel: "", next: ""};
@@ -495,7 +362,7 @@
// event is at the moment
if ((closing == null || event.start.getTime() < closing.getTime()) && event.start.getTime() < new MyDate()) {
- room.state = {state: "ClaendarEvent", end: event.end, titel: event.title, next: ""};
+ room.state = {state: "CalendarEvent", end: event.end, titel: event.title, next: ""};
return;
}
@@ -653,16 +520,22 @@
/**
* Updates the Course Text of a child
* @param id of the child
- * @param on PC's on
- * @param used PC's used
+ * @param idle PC's on
+ * @param occupied PC's used
* @param off PC's that are off
- * @param defect PC's that are defect
+ * @param broken PC's that are broken
*/
- function updateRoomUsage(id, on, used, off, defect) {
- $("#div_pc_On_" + id).text(on);
- $("#div_pc_Used_" + id).text(used);
- $("#div_pc_Off_" + id).text(off);
- $("#div_pc_Defect_" + id).text(defect);
+ function updateRoomUsage(id, idle, occupied, off, broken) {
+ if (idle == 0 && occupied == 0 && off == 0) {
+ $('#parent_' + id).parent().hide();
+ return;
+ }
+ $('#parent_' + id).parent().show();
+ var total = parseInt(idle) + parseInt(occupied) + parseInt(off) + parseInt(broken);
+ $("#div_pc_Idle_" + id).text(idle).width((idle / total) * 100 + '%');
+ $("#div_pc_Occupied_" + id).text(occupied).width((occupied / total) * 100 + '%');
+ $("#div_pc_Off_" + id).text(off).width((off / total) * 100 + '%');
+ $("#div_pc_Broken_" + id).text(broken).width((broken / total) * 100 + '%');
}
/**
@@ -682,15 +555,6 @@
function updateCoursTimer(id, time) {
$("#div_Time_" + id).text(time);
}
- /**
- * generates a new Div
- * @param target Div it should be inserted
- * @returns generated div
- */
- function generateRow(target) {
- var text = "<div class='row' ></div>";
- return $(target).append(text);
- }
/**
* generates a Div, used for a child node
@@ -707,20 +571,20 @@
c = "outermost";
}
- var text = "<div class='childWithBorder'>" +
- "<div class='child paperEffect " + c + "'>" +
+ var text = "<div class='border " + c + "'>" +
+ "<div class='child paperEffect' id='parent_" + id + "'>" +
"<div class='headerFont'>" + name + "</div>" +
- "<div class='divAroundPcStates'>" +
- "<div id = 'div_pc_On_" + id + "' class='divPcOn '>" + 0 + "</div>" +
- "<div id = 'div_pc_Used_" + id + "' class='divPcPcUsed'>" + 0 + "</div>" +
- "<div id = 'div_pc_Off_" + id + "' class='divPcPcOff'>" + 0 + "</div>" +
- "<div id = 'div_pc_Defect_" + id + "' class='divPcPcDefect'>" + 0 + "</div>" +
+ "<div class='pc-state-wrapper'>" +
+ "<div id = 'div_pc_Idle_" + id + "' class='pc-idle'>?</div>" +
+ "<div id = 'div_pc_Occupied_" + id + "' class='pc-occupied'>?</div>" +
+ "<div id = 'div_pc_Off_" + id + "' class='pc-off'>?</div>" +
+ "<div id = 'div_pc_Broken_" + id + "' class='pc-broken'>?</div>" +
"</div>" +
"<div class='aroundCourse'>" +
- "<div id = 'div_course" + id + "'class='courseFont'></div>" +
+ "<div id = 'div_course" + id + "'class='courseFont'>?</div>" +
"<div id = 'div_Time_" + id + "'class='courseFont'></div></div></div></div>";
var obj = $(target).append(text);
- getConfig((id));
+ addRoom(id, name);
return obj
}
@@ -742,33 +606,12 @@
var text = "<div class='border " + c + "'>" +
"<div class='parent paperEffect'>" +
"<div class='headerFont'>" + name + "</div>" +
- "<div id='parent_" + id + "'</div>" +
+ "<div id='parent_" + id + "'></div>" +
"</div></div>";
return $(target).append(text);
}
/**
- * Downloads the config of a room
- * @param id ID of the room
- */
- function getConfig(id) {
- $.ajax({
- url: "../../../api.php?do=locationinfo&action=config&id=" + id,
- dataType: 'json',
- cache: false,
- timeout: 30000,
- success: function (result) {
- if (result.room != null) {
- delete result.time;
- room = addRoom(id, result.room, result);
- }
- }, error: function () {
- //Todo Error handling:
- }
- })
- }
-
- /**
* returns parameter value from the url
* @param sParam
* @returns value for given parameter
@@ -851,8 +694,7 @@
}
</script>
</head>
-<body class="">
-<h1>Raum Ãœbersicht</h1>
+<body>
<div id="main"></div>
</body>
</html>
diff --git a/modules-available/locationinfo/install.inc.php b/modules-available/locationinfo/install.inc.php
index be5f56b7..0dc29578 100644
--- a/modules-available/locationinfo/install.inc.php
+++ b/modules-available/locationinfo/install.inc.php
@@ -3,7 +3,7 @@
$res = array();
$t1 = $res[] = tableCreate('locationinfo_locationconfig', '
- `locationid` INT(10) UNSIGNED NOT NULL,
+ `locationid` INT(11) NOT NULL,
`serverid` INT(10) UNSIGNED,
`serverlocationid` VARCHAR(150),
`hidden` BOOLEAN NOT NULL DEFAULT 0,
diff --git a/modules-available/locationinfo/lang/de/module.json b/modules-available/locationinfo/lang/de/module.json
index 2fd14353..c344581c 100644
--- a/modules-available/locationinfo/lang/de/module.json
+++ b/modules-available/locationinfo/lang/de/module.json
@@ -1,3 +1,3 @@
{
"module_name": "Infoscreen"
-}
+} \ No newline at end of file
diff --git a/modules-available/locationinfo/lang/de/template-tags.json b/modules-available/locationinfo/lang/de/template-tags.json
index ed92d240..253ae674 100644
--- a/modules-available/locationinfo/lang/de/template-tags.json
+++ b/modules-available/locationinfo/lang/de/template-tags.json
@@ -1,31 +1,31 @@
{
"lang_addServer": "Server",
"lang_autoScale": "Auto Tage",
- "lang_autoscaleTooltip": "Berechnet sich die optimale anzahl an Tagen, anhand der Bildschirmbreite, die der Kalender anzeigt.",
+ "lang_autoscaleTooltip": "Berechnet anhand der Bildschirmbreite die optimale Anzahl an Tagen, die der Kalender anzeigt",
"lang_buildingTable": "Geb\u00e4ude \/ Raum Liste",
"lang_calendar": "Kalender",
- "lang_calupdateTooltip": "Zeit nachdem der Kalender geupdated wird (in minuten)",
+ "lang_calupdateTooltip": "Zeit nachdem der Kalender aktualisiert wird (in Minuten)",
"lang_checkConnection": "Verbindung pr\u00fcfen",
"lang_closingTime": "Schlie\u00dfungszeit",
"lang_config": "Einstellungen",
- "lang_configupdateTooltip": "Zeit nachder die Einstellungen geupdated werden (in minuten)",
+ "lang_configupdateTooltip": "Zeit nach der die Einstellungen aktualisiert werden (in Minuten)",
"lang_credentials": "Anmeldung",
- "lang_customUrl": "Benutzerdefinierter URL",
- "lang_customUrlTooltip": "Dieser URL \u00fcberscheibt die Einstellungen von dem Raum.",
+ "lang_customUrl": "Benutzerdefinierte URL",
+ "lang_customUrlTooltip": "Diese URL \u00fcberschreibt die Einstellungen des Raumes",
"lang_day": "Tag",
"lang_daysToShow": "Tage",
- "lang_daysToShowTooltip": "Legt die gew\u00fcnschte Anzahl an Tagen im Kalender fest.",
- "lang_deleteConfirmation": "Bist du sicher?",
+ "lang_daysToShowTooltip": "Legt die Anzahl an Tagen im Kalender fest, die angezeigt werden",
+ "lang_deleteConfirmation": "Sind Sie sicher?",
"lang_display": "Anzeige",
- "lang_ecoMode": "E-Ink modus",
- "lang_ecoTooltip": "Anstelle der Farb-basierten PC-Status Bilder, werden Symbol-basierte PC Bilder verwendet.",
+ "lang_ecoMode": "E-Ink Modus",
+ "lang_ecoTooltip": "Anstelle der Farb-basierten PC-Status Bilder, werden Symbol-basierte PC Bilder verwendet",
"lang_entryName": "Name",
- "lang_expertMode": "Experten Modus",
+ "lang_expertMode": "Expertenmodus",
"lang_general": "Allgemein",
"lang_language": "Sprache",
- "lang_languageTooltip": "Die Sprache, welche vom Frontend benutzt wird.",
+ "lang_languageTooltip": "Legt die Sprache der angezeigten Oberfl\u00e4che fest",
"lang_locationIsHidden": "Versteckt",
- "lang_locationIsHidden_title": "Wenn aktiv, dann liefert die API keine Informationen \u00fcber diesen Raum.",
+ "lang_locationIsHidden_title": "Wenn aktiv, dann liefert die API keine Informationen \u00fcber diesen Raum",
"lang_locationName": "Name",
"lang_locationSettings": "Einstellungen",
"lang_mainHeader": "Infoscreen",
@@ -34,28 +34,29 @@
"lang_mode2": "Kalender",
"lang_mode3": "Raum",
"lang_mode4": "Wechselnd",
- "lang_modeTooltip": "Die Anzeigemodi, welche das frontend unterst\u00fctzt.",
+ "lang_modeTooltip": "Die Anzeigemodi, welche das Frontend unterst\u00fctzt",
"lang_monTilFr": "Montag - Freitag",
- "lang_nameTooltip": "Legt den Namen des Servers fest.",
+ "lang_nameTooltip": "Legt den Namen des Servers fest",
"lang_noServer": "<Kein Server>",
"lang_openingTime": "\u00d6ffnungszeiten",
+ "lang_pleaseSelect": "Bitte w\u00e4hlen...",
"lang_room": "Raum",
"lang_roomId": "Raum ID",
- "lang_roomIdTooltip": "Die ID vom Raum, welche der Server braucht, um die Kalender Daten abzurufen.",
- "lang_roomupdateTooltip": "Zeit nachder die Pcs geupdated werden (in sekunden)",
+ "lang_roomIdTooltip": "Die Raum ID, die der Server ben\u00f6tigt, um Kalenderdaten abzurufen",
+ "lang_roomupdateTooltip": "Zeit nach der die PCs aktualisiert werden (in Sekunden)",
"lang_rotation": "Rotation",
"lang_rotation0": "0\u00b0",
"lang_rotation1": "90\u00b0 \u27f2",
"lang_rotation2": "180\u00b0",
"lang_rotation3": "90\u00b0 \u27f3",
- "lang_rotationTooltip": "Rotiert den Raum.",
+ "lang_rotationTooltip": "Rotiert den angezeigten Raum",
"lang_saturday": "Samstag",
- "lang_scale": "Kalender breite",
- "lang_scaleTooltip": "[10-90] Legt die Kalenderbreite fest. (In Prozent)",
- "lang_sec": "sec",
+ "lang_scale": "Kalenderbreite",
+ "lang_scaleTooltip": "[10-90] Legt die Kalenderbreite fest (in Prozent)",
+ "lang_sec": "sek",
"lang_server": "Server",
"lang_serverTable": "Server Liste",
- "lang_serverTooltip": "Legt fest, von welchem Server die Kalender Daten bezogen werden.",
+ "lang_serverTooltip": "Legt fest, von welchem Server die Kalenderdaten bezogen werden",
"lang_serverType": "Typ",
"lang_shortFriday": "Fr",
"lang_shortMonday": "Mo",
@@ -66,9 +67,9 @@
"lang_shortWednesday": "Mi",
"lang_sunday": "Sonntag",
"lang_switchTime": "Wechselintervall",
- "lang_switchTimeTooltip": "[1-120] Legt die Zeit fest, die vergeht bis ein wechsel erfolgt (in sekunden)",
- "lang_typeTooltip": "Legt fest um welchen Typ von Server es sich handelt.",
- "lang_updateRates": "Anfragraten",
+ "lang_switchTimeTooltip": "[1-120] Legt die Zeit fest, die vergeht bis ein Wechsel erfolgt (in Sekunden)",
+ "lang_typeTooltip": "Legt fest um welchen Server-Typ es sich handelt",
+ "lang_updateRates": "Aktualisierungsintervall",
"lang_vertical": "Vertikaler Modus",
- "lang_verticalTooltip": "Legt fest, ob der Kalender und der Raum \u00fcbereinander angezeigt werden soll."
+ "lang_verticalTooltip": "Legt fest, ob Kalender und Raum \u00fcbereinander angezeigt werden sollen"
} \ No newline at end of file
diff --git a/modules-available/locationinfo/lang/en/template-tags.json b/modules-available/locationinfo/lang/en/template-tags.json
index c43f7608..60e5c9b5 100644
--- a/modules-available/locationinfo/lang/en/template-tags.json
+++ b/modules-available/locationinfo/lang/en/template-tags.json
@@ -1,7 +1,7 @@
{
"lang_addServer": "Server",
"lang_autoScale": "Auto Days",
- "lang_autoscaleTooltip": "Calculates the optimum amount of days to show from the display width.",
+ "lang_autoscaleTooltip": "Calculates the optimum amount of days to show from the display width",
"lang_buildingTable": "Building \/ Room List",
"lang_calendar": "Calendar",
"lang_calupdateTooltip": "Time the calender querys for updates (in minutes)",
@@ -11,21 +11,21 @@
"lang_configupdateTooltip": "Time interval the config gets updated (in minutes)",
"lang_credentials": "Login",
"lang_customUrl": "Custom URL",
- "lang_customUrlTooltip": "This URL will override the config settings from the room.",
+ "lang_customUrlTooltip": "This URL will override the config settings from the room",
"lang_day": "Day",
"lang_daysToShow": "Days",
"lang_daysToShowTooltip": "Defines the amount of days to show in the calendar",
"lang_deleteConfirmation": "Are you sure?",
"lang_display": "Display",
"lang_ecoMode": "E-Ink mode",
- "lang_ecoTooltip": "Symbolic based pc state pictures are used instead of the colour base ones.",
+ "lang_ecoTooltip": "Symbolic based pc state pictures are used instead of the colour based ones",
"lang_entryName": "Name",
"lang_expertMode": "Expert mode",
"lang_general": "General",
"lang_language": "Language",
- "lang_languageTooltip": "The language the frontend uses.",
+ "lang_languageTooltip": "The language the frontend uses",
"lang_locationIsHidden": "Hidden",
- "lang_locationIsHidden_title": "If checked the API doesn't return information about the room.",
+ "lang_locationIsHidden_title": "If checked the API doesn't return information about the room",
"lang_locationName": "Name",
"lang_locationSettings": "Settings",
"lang_mainHeader": "Infoscreen",
@@ -34,28 +34,29 @@
"lang_mode2": "Calendar",
"lang_mode3": "Room",
"lang_mode4": "Switching",
- "lang_modeTooltip": "The display modes the frontend supports.",
+ "lang_modeTooltip": "The display modes the frontend supports",
"lang_monTilFr": "Monday - Friday",
- "lang_nameTooltip": "Defines the name of the server.",
+ "lang_nameTooltip": "Defines the name of the server",
"lang_noServer": "<no server>",
"lang_openingTime": "Opening times",
+ "lang_pleaseSelect": "Please select...",
"lang_room": "Room",
"lang_roomId": "Room ID",
- "lang_roomIdTooltip": "The ID of the room the server needs, for querying the calendar data.",
+ "lang_roomIdTooltip": "The ID of the room the server needs, for querying the calendar data",
"lang_roomupdateTooltip": "Time the PCs in the room gets updated (in seconds)",
"lang_rotation": "Rotation",
"lang_rotation0": "0\u00b0",
"lang_rotation1": "90\u00b0 \u27f2",
"lang_rotation2": "180\u00b0",
"lang_rotation3": "90\u00b0 \u27f3",
- "lang_rotationTooltip": "Rotates the room.",
+ "lang_rotationTooltip": "Rotates the room",
"lang_saturday": "Saturday",
"lang_scale": "Calendar width",
- "lang_scaleTooltip": "[10-90] Defines the calendar width. (in percent)",
+ "lang_scaleTooltip": "[10-90] Defines the calendar width (in percent)",
"lang_sec": "sec",
"lang_server": "Server",
"lang_serverTable": "Server List",
- "lang_serverTooltip": "Defines from which server the room queries the calendar data.",
+ "lang_serverTooltip": "Defines from which server the room queries the calendar data",
"lang_serverType": "Type",
"lang_shortFriday": "Fri",
"lang_shortMonday": "Mon",
@@ -67,8 +68,8 @@
"lang_sunday": "Sunday",
"lang_switchTime": "Switchtime",
"lang_switchTimeTooltip": "[1-120] Sets the time between switching (in seconds)",
- "lang_typeTooltip": "Defines on which type of server you want to connect to.",
+ "lang_typeTooltip": "Defines on which type of server you want to connect to",
"lang_updateRates": "Update rates",
"lang_vertical": "Vertical mode",
- "lang_verticalTooltip": "Defines whether the room and calendar are shown above each other."
+ "lang_verticalTooltip": "Defines whether the room and calendar are shown above each other"
} \ No newline at end of file
diff --git a/modules-available/locationinfo/page.inc.php b/modules-available/locationinfo/page.inc.php
index bda6549b..52964b10 100644
--- a/modules-available/locationinfo/page.inc.php
+++ b/modules-available/locationinfo/page.inc.php
@@ -72,8 +72,7 @@ class Page_LocationInfo extends Page
}
$serverid = Request::post('serverid', 0, 'int');
if ($serverid === 0) {
- Message::addError('main.value-invalid', 'serverid', 0);
- Util::redirect('?do=locationinfo');
+ $serverid = null;
}
$result['language'] = Request::post('language', 'en', 'string');
$result['mode'] = Request::post('mode', 1, 'int');
@@ -481,7 +480,8 @@ class Page_LocationInfo extends Page
echo Render::parse('server-settings', array('id' => $id,
'name' => $oldConfig['servername'],
'currentbackend' => $oldConfig['servertype'],
- 'backendList' => $serverBackends));
+ 'backendList' => $serverBackends,
+ 'defaultBlank' => $oldConfig === false));
}
/**
@@ -495,19 +495,20 @@ class Page_LocationInfo extends Page
if ($row !== false) {
$openingtimes = json_decode($row['openingtime'], true);
}
- if (!is_array($openingtimes)) {
+ if (!isset($openingtimes) || !is_array($openingtimes)) {
$openingtimes = array();
}
if ($this->isEasyMode($openingtimes)) {
- echo Render::parse('timetable', array('id' => $id,
- 'openingtime0' => $openingtimes[0]['openingtime'],
- 'closingtime0' => $openingtimes[0]['closingtime'],
- 'openingtime1' => $openingtimes[1]['openingtime'],
- 'closingtime1' => $openingtimes[1]['closingtime'],
- 'openingtime2' => $openingtimes[2]['openingtime'],
- 'closingtime2' => $openingtimes[2]['closingtime'],
+ $data = array('id' => $id,
'easyMode' => true,
- 'expertMode' => false));
+ 'expertMode' => false
+ );
+ foreach ($openingtimes as $idx => $ot) {
+ foreach ($ot as $k => $v) {
+ $data[$k . $idx] = $v;
+ }
+ }
+ echo Render::parse('timetable', $data);
} else {
$index = 0;
diff --git a/modules-available/locationinfo/templates/server-settings.html b/modules-available/locationinfo/templates/server-settings.html
index c9b713e6..940bc55a 100644
--- a/modules-available/locationinfo/templates/server-settings.html
+++ b/modules-available/locationinfo/templates/server-settings.html
@@ -25,6 +25,9 @@
</div>
<div class="col-md-7">
<select class="form-control" onchange="servertype_changed(this.value)">
+ {{#defaultBlank}}
+ <option value="" selected>{{lang_pleaseSelect}}</option>
+ {{/defaultBlank}}
{{#backendList}}
<option value="{{backendtype}}" {{#active}}selected{{/active}}>{{display}}</option>
{{/backendList}}
@@ -48,6 +51,8 @@
<input type="hidden" name="action" value="updateServerSettings">
<input type="hidden" name="id" value="{{id}}">
<input type="hidden" name="type" value="{{backendtype}}">
+ <input type="text" name="prevent_autofill" id="prevent_autofill" value="" style="position:absolute;top:-2000px" tabindex="-1">
+ <input type="password" name="password_fake" id="password_fake" value="" style="position:absolute;top:-2000px" tabindex="-1">
<div class="panel panel-default">
@@ -75,12 +80,15 @@
if (value === currentBackend)
return;
var newBackend = value;
- console.log('From ' + currentBackend + ' to ' + value);
- $('#formwrapper-' + currentBackend).fadeOut('fast', function() {
- console.log('Fading in ' + newBackend);
+ var fadeIn = function() {
$('#formwrapper-' + newBackend).fadeIn('fast');
$('#myModalSubmitButton, #name-input').attr('form', 'form-' + newBackend);
- });
+ };
+ if (currentBackend) {
+ $('#formwrapper-' + currentBackend).fadeOut('fast', fadeIn);
+ } else {
+ fadeIn();
+ }
currentBackend = value;
}
diff --git a/modules-available/locations/inc/location.inc.php b/modules-available/locations/inc/location.inc.php
index 8f3447da..b2b6da4a 100644
--- a/modules-available/locations/inc/location.inc.php
+++ b/modules-available/locations/inc/location.inc.php
@@ -125,7 +125,7 @@ class Location
return array_values($rows);
}
- private static function buildTree($elements, $parentId = 0)
+ public static function buildTree($elements, $parentId = 0)
{
$branch = array();
$sort = array();
diff --git a/modules-available/main/category-icons.json b/modules-available/main/category-icons.json
index 08cb2a64..f790089e 100644
--- a/modules-available/main/category-icons.json
+++ b/modules-available/main/category-icons.json
@@ -4,5 +4,6 @@
"settings-client":"cog",
"settings-server":"cog",
"status":"tasks",
- "users":"user"
+ "users":"user",
+ "beta":"flash"
}
diff --git a/modules-available/main/lang/de/categories.json b/modules-available/main/lang/de/categories.json
index 8fd292ec..71f149ec 100644
--- a/modules-available/main/lang/de/categories.json
+++ b/modules-available/main/lang/de/categories.json
@@ -1,4 +1,5 @@
{
+ "beta": "Beta",
"content": "Inhalt",
"settings-client": "Einstellungen (Client)",
"settings-server": "Einstellungen (Server)",
diff --git a/modules-available/main/lang/en/categories.json b/modules-available/main/lang/en/categories.json
index defbd652..9dfa0404 100644
--- a/modules-available/main/lang/en/categories.json
+++ b/modules-available/main/lang/en/categories.json
@@ -1,4 +1,5 @@
{
+ "beta": "Beta",
"content": "Content",
"settings-client": "Settings (Client)",
"settings-server": "Settings (Server)",
diff --git a/modules-available/main/templates/main-menu.html b/modules-available/main/templates/main-menu.html
index 2ede4f87..55b19833 100644
--- a/modules-available/main/templates/main-menu.html
+++ b/modules-available/main/templates/main-menu.html
@@ -20,6 +20,7 @@
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="?do=Main">OpenSLX</a>
+ <div id="navbar-sub" class="gray small"></div>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-sidebar-navbar-collapse-1">
diff --git a/modules-available/news/lang/de/template-tags.json b/modules-available/news/lang/de/template-tags.json
index f13a5733..d8ad974f 100644
--- a/modules-available/news/lang/de/template-tags.json
+++ b/modules-available/news/lang/de/template-tags.json
@@ -9,5 +9,5 @@
"lang_oldHelp": "Alte Hilfetexte",
"lang_show": "Ansehen",
"lang_title": "Titel",
- "lang_vmChooser_title": "VMChooser-Einstellungen"
+ "lang_vmChooser_title": "vmChooser-Einstellungen"
} \ No newline at end of file
diff --git a/modules-available/news/lang/en/module.json b/modules-available/news/lang/en/module.json
index b13eca27..f44a64e5 100644
--- a/modules-available/news/lang/en/module.json
+++ b/modules-available/news/lang/en/module.json
@@ -1,3 +1,3 @@
{
- "module_name": "News"
+ "module_name": "vmChooser News"
} \ No newline at end of file
diff --git a/modules-available/news/lang/en/template-tags.json b/modules-available/news/lang/en/template-tags.json
index 58005e5b..270fed44 100644
--- a/modules-available/news/lang/en/template-tags.json
+++ b/modules-available/news/lang/en/template-tags.json
@@ -9,5 +9,5 @@
"lang_oldHelp": "Old Help Texts",
"lang_show": "Show",
"lang_title": "Title",
- "lang_vmChooser_title": "VMChooser-Settings"
+ "lang_vmChooser_title": "vmChooser-Settings"
} \ No newline at end of file
diff --git a/modules-available/rebootcontrol/api.inc.php b/modules-available/rebootcontrol/api.inc.php
index 77687f8e..dad25375 100644
--- a/modules-available/rebootcontrol/api.inc.php
+++ b/modules-available/rebootcontrol/api.inc.php
@@ -1,4 +1,13 @@
<?php
+
+if (Request::any('action') === 'rebuild' && isLocalExecution()) {
+ if (Module::isAvailable('sysconfig')) {
+ SSHKey::getPublicKey();
+ ConfigTgz::rebuildAllConfigs();
+ echo "OK";
+ }
+ exit(0);
+}
/*
Needed POST-Parameters:
'token' -- for authentification
@@ -15,7 +24,8 @@ foreach ($ips as $client) {
$clients[] = array("ip" => $client);
}
-if (Request::post('token') == Property::get("rebootcontrol_APIPOSTKEY")) {
+$apikey = Property::get("rebootcontrol_APIPOSTKEY", 'not-set');
+if (!empty($apikey) && Request::post('token') === $apikey) {
if (Request::isPost()) {
if (Request::post('action') == 'shutdown') {
$shutdown = true;
diff --git a/modules-available/rebootcontrol/config.json b/modules-available/rebootcontrol/config.json
index 2cc05822..d8ab5868 100644
--- a/modules-available/rebootcontrol/config.json
+++ b/modules-available/rebootcontrol/config.json
@@ -1,4 +1,4 @@
{
- "category":"main.content",
+ "category":"main.beta",
"dependencies": [ "locations", "js_stupidtable" ]
}
diff --git a/modules-available/rebootcontrol/inc/rebootqueries.inc.php b/modules-available/rebootcontrol/inc/rebootqueries.inc.php
index 62092748..8f65b756 100644
--- a/modules-available/rebootcontrol/inc/rebootqueries.inc.php
+++ b/modules-available/rebootcontrol/inc/rebootqueries.inc.php
@@ -5,10 +5,12 @@ class RebootQueries
// Get Client+IP+CurrentVM+CurrentUser+Location to fill the table
public static function getMachineTable($locationId) {
+ $queryArgs = array('cutoff' => strtotime('-30 days'));
if ($locationId === 0) {
$where = 'machine.locationid IS NULL';
} else {
$where = 'machine.locationid = :locationid';
+ $queryArgs['locationid'] = $locationId;
}
$leftJoin = '';
$sessionField = 'machine.currentsession';
@@ -19,12 +21,25 @@ class RebootQueries
}
$res = Database::simpleQuery("
SELECT machine.machineuuid, machine.hostname, machine.clientip,
- IF(machine.lastboot = 0 OR UNIX_TIMESTAMP() - machine.lastseen >= 600, 0, 1) AS status,
+ machine.lastboot, machine.lastseen, machine.logintime,
$sessionField, machine.currentuser, machine.locationid
FROM machine
$leftJoin
- WHERE " . $where, array('locationid' => $locationId));
- return $res->fetchAll(PDO::FETCH_ASSOC);
+ WHERE $where AND machine.lastseen > :cutoff", $queryArgs);
+ $ret = $res->fetchAll(PDO::FETCH_ASSOC);
+ $NOW = time();
+ foreach ($ret as &$row) {
+ if ($row['lastboot'] == 0 || $NOW - $row['lastseen'] > 600) {
+ $row['status'] = 0;
+ } else {
+ $row['status'] = 1;
+ }
+ if ($row['status'] === 0 || $row['logintime'] == 0) {
+ $row['currentuser'] = '';
+ $row['currentsession'] = '';
+ }
+ }
+ return $ret;
}
/**
diff --git a/modules-available/rebootcontrol/lang/de/template-tags.json b/modules-available/rebootcontrol/lang/de/template-tags.json
index 2a04e746..57164f02 100644
--- a/modules-available/rebootcontrol/lang/de/template-tags.json
+++ b/modules-available/rebootcontrol/lang/de/template-tags.json
@@ -1,5 +1,5 @@
{
- "lang_authFail": "Athentifizierung fehlgeschlagen",
+ "lang_authFail": "Authentifizierung fehlgeschlagen",
"lang_client": "Client",
"lang_connecting": "Verbinde...",
"lang_error": "Nicht erreichbar",
@@ -14,7 +14,7 @@
"lang_reboot": "Neustarten",
"lang_rebootAt": "Neustart um:",
"lang_rebootButton": "Neustarten",
- "lang_rebootCheck": "Wollen Sie wirklich die ausgew\u00e4hlten Rechner neustarten?",
+ "lang_rebootCheck": "Wollen Sie die ausgew\u00e4hlten Rechner wirklich neustarten?",
"lang_rebooting": "Neustart...",
"lang_selectall": "Alle ausw\u00e4hlen",
"lang_selected": "Ausgew\u00e4hlt",
@@ -23,7 +23,7 @@
"lang_shutdown": "Herunterfahren",
"lang_shutdownAt": "Herunterfahren um: ",
"lang_shutdownButton": "Herunterfahren",
- "lang_shutdownCheck": "Wollen Sie wirklich die ausgew\u00e4hlten Rechner herunterfahren?",
+ "lang_shutdownCheck": "Wollen Sie die ausgew\u00e4hlten Rechner wirklich herunterfahren?",
"lang_shutdownIn": "Herunterfahren in: ",
"lang_status": "Status",
"lang_unselectall": "Alle abw\u00e4hlen",
diff --git a/modules-available/rebootcontrol/templates/_page.html b/modules-available/rebootcontrol/templates/_page.html
index 690316df..065a9f01 100644
--- a/modules-available/rebootcontrol/templates/_page.html
+++ b/modules-available/rebootcontrol/templates/_page.html
@@ -40,10 +40,10 @@
<td>{{clientip}}</td>
<td class="statusColumn">
{{#status}}
- {{lang_on}}
+ <span class="text-success">{{lang_on}}</span>
{{/status}}
{{^status}}
- {{lang_off}}
+ <span class="text-danger">{{lang_off}}</span>
{{/status}}
</td>
<td>{{#status}}{{currentsession}}{{/status}}</td>
diff --git a/modules-available/statistics/hooks/config-tgz.inc.php b/modules-available/statistics/hooks/config-tgz.inc.php
index 1272a94f..8dffbff6 100644
--- a/modules-available/statistics/hooks/config-tgz.inc.php
+++ b/modules-available/statistics/hooks/config-tgz.inc.php
@@ -7,26 +7,28 @@ $res = Database::simpleQuery('SELECT h.hwname FROM statistic_hw h'
'screen' => DeviceType::SCREEN,
));
-$content = '';
-while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
- $content .= $row['hwname'] . "=beamer\n";
-}
+if ($res !== false) { // CHeck this in case we're running on old DB during update
+ $content = '';
+ while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
+ $content .= $row['hwname'] . "=beamer\n";
+ }
-if (!empty($content)) {
- $tmpfile = '/tmp/bwlp-' . md5($content) . '.tar';
- if (!is_file($tmpfile) || !is_readable($tmpfile) || filemtime($tmpfile) + 86400 < time()) {
- if (file_exists($tmpfile)) {
- unlink($tmpfile);
- }
- try {
- $a = new PharData($tmpfile);
- $a->addFromString("/opt/openslx/beamergui/beamer.conf", $content);
+ if (!empty($content)) {
+ $tmpfile = '/tmp/bwlp-' . md5($content) . '.tar';
+ if (!is_file($tmpfile) || !is_readable($tmpfile) || filemtime($tmpfile) + 86400 < time()) {
+ if (file_exists($tmpfile)) {
+ unlink($tmpfile);
+ }
+ try {
+ $a = new PharData($tmpfile);
+ $a->addFromString("/opt/openslx/beamergui/beamer.conf", $content);
+ $file = $tmpfile;
+ } catch (Exception $e) {
+ EventLog::failure('Could not include beamer.conf in config.tgz', (string)$e);
+ unlink($tmpfile);
+ }
+ } elseif (is_file($tmpfile) && is_readable($tmpfile)) {
$file = $tmpfile;
- } catch (Exception $e) {
- EventLog::failure('Could not include beamer.conf in config.tgz', (string)$e);
- unlink($tmpfile);
}
- } elseif (is_file($tmpfile) && is_readable($tmpfile)) {
- $file = $tmpfile;
}
-}
+} \ No newline at end of file
diff --git a/modules-available/statistics/inc/filter.inc.php b/modules-available/statistics/inc/filter.inc.php
index 6af6eed1..0afce572 100644
--- a/modules-available/statistics/inc/filter.inc.php
+++ b/modules-available/statistics/inc/filter.inc.php
@@ -91,7 +91,6 @@ class Filter
if ($lhs == 'gbram') {
$filters[] = new RamGbFilter($operator, $rhs);
} elseif ($lhs == 'state') {
- error_log('new state filter with ' . $rhs);
$filters[] = new StateFilter($operator, $rhs);
} elseif ($lhs == 'hddgb') {
$filters[] = new Id44Filter($operator, $rhs);
diff --git a/modules-available/statistics/install.inc.php b/modules-available/statistics/install.inc.php
index 79346f99..bfa342c4 100644
--- a/modules-available/statistics/install.inc.php
+++ b/modules-available/statistics/install.inc.php
@@ -27,7 +27,7 @@ $res[] = tableCreate('statistic', "
$res[] = $machineCreate = tableCreate('machine', "
`machineuuid` char(36) CHARACTER SET ascii NOT NULL,
`fixedlocationid` int(11) DEFAULT NULL COMMENT 'Manually set location (e.g. roomplanner)',
- `subnetlocationid` int(11) DEFAULT NULL COMMENT 'Automatically determined location (e.g. from subnet match),
+ `subnetlocationid` int(11) DEFAULT NULL COMMENT 'Automatically determined location (e.g. from subnet match)',
`locationid` int(11) DEFAULT NULL COMMENT 'Will be automatically set to fixedlocationid if not null, subnetlocationid otherwise',
`macaddr` char(17) CHARACTER SET ascii NOT NULL,
`clientip` varchar(45) CHARACTER SET ascii NOT NULL,
diff --git a/modules-available/statistics/lang/de/template-tags.json b/modules-available/statistics/lang/de/template-tags.json
index 7274aef4..e0be0d48 100644
--- a/modules-available/statistics/lang/de/template-tags.json
+++ b/modules-available/statistics/lang/de/template-tags.json
@@ -47,6 +47,7 @@
"lang_modelStats": "PC-Modelle",
"lang_more": "Mehr",
"lang_newMachines": "Neue Ger\u00e4te",
+ "lang_noEdid": "Kein EDID",
"lang_noProjectorsDefined": "Keine Beamer-Overrides definiert",
"lang_notes": "Anmerkungen",
"lang_onlineMachines": "Gestartete Clients",
diff --git a/modules-available/statistics/lang/en/template-tags.json b/modules-available/statistics/lang/en/template-tags.json
index 4e135388..4a31a5ee 100644
--- a/modules-available/statistics/lang/en/template-tags.json
+++ b/modules-available/statistics/lang/en/template-tags.json
@@ -47,6 +47,7 @@
"lang_modelStats": "PC models",
"lang_more": "More",
"lang_newMachines": "New machines",
+ "lang_noEdid": "No EDID",
"lang_noProjectorsDefined": "No projector overrides defined",
"lang_notes": "Notes",
"lang_onlineMachines": "Online clients",
diff --git a/modules-available/statistics/templates/machine-main.html b/modules-available/statistics/templates/machine-main.html
index bdc51167..74df80c4 100644
--- a/modules-available/statistics/templates/machine-main.html
+++ b/modules-available/statistics/templates/machine-main.html
@@ -143,6 +143,7 @@
</form>
{{#screens}}
<div class="small">
+ {{#hwname}}
<div class="pull-right btn-group btn-group-xs">
{{#projector}}
<a href="?do=statistics&amp;show=projectors" class="btn btn-default">{{lang_projector}}</a>
@@ -154,7 +155,8 @@
class="btn btn-success"><span class="glyphicon glyphicon-plus"></span> {{lang_projector}}</button>
{{/projector}}
</div>
- {{connector}}: <b>{{hwname}}</b> {{resolution}}
+ {{/hwname}}
+ {{connector}}: <b>{{hwname}}</b> {{^hwname}}<i>{{lang_noEdid}}</i>{{/hwname}} {{resolution}}
<div class="clearfix"></div>
</div>
{{/screens}}
@@ -187,4 +189,4 @@ document.addEventListener("DOMContentLoaded", function () {
$(this).load('?do=statistics&lookup=' + $(this).text());
});
}, false);
-// --></script> \ No newline at end of file
+// --></script>
diff --git a/modules-available/statistics_reporting/config.json b/modules-available/statistics_reporting/config.json
index f9627cdb..78ca35ba 100644
--- a/modules-available/statistics_reporting/config.json
+++ b/modules-available/statistics_reporting/config.json
@@ -1,4 +1,4 @@
{
- "category": "main.content",
+ "category": "main.status",
"dependencies": [ "statistics", "locations", "js_stupidtable", "js_jqueryui" ]
}
diff --git a/modules-available/statistics_reporting/inc/remotereport.inc.php b/modules-available/statistics_reporting/inc/remotereport.inc.php
index 68a3e95e..e94e9b93 100644
--- a/modules-available/statistics_reporting/inc/remotereport.inc.php
+++ b/modules-available/statistics_reporting/inc/remotereport.inc.php
@@ -13,18 +13,19 @@ class RemoteReport
*/
public static function setReportingEnabled($isEnabled)
{
- $value = ($isEnabled === true || $isEnabled === 'on') ? 'on' : '';
- Property::set(self::ENABLED_ID, $value, 60 * 24 * 14);
+ $value = ($isEnabled === true || $isEnabled === 'on') ? 'on' : 'off';
+ Property::set(self::ENABLED_ID, $value);
}
/**
* Returns whether remote reporting is enabled or not.
+ * Defaults to on.
*
* @return bool true if reporting is on, false if off
*/
public static function isReportingEnabled()
{
- return Property::get(self::ENABLED_ID, false) === 'on';
+ return Property::get(self::ENABLED_ID, 'on') === 'on';
}
/**
@@ -42,9 +43,9 @@ class RemoteReport
// schedule for next time
self::writeNextReportingTimestamp();
$ts = Property::get(self::NEXT_SUBMIT_ID, 0);
- } elseif ($ts < strtotime('last monday')) {
- // Too long ago, move forward to last monday
- $ts = strtotime('last monday');
+ } elseif ($ts < strtotime('last monday - 14 days')) {
+ // Too long ago, move forward
+ $ts = strtotime('last monday - 14 days');
}
return $ts;
}
diff --git a/modules-available/statistics_reporting/lang/de/template-tags.json b/modules-available/statistics_reporting/lang/de/template-tags.json
index 3801f3a6..fb624fad 100644
--- a/modules-available/statistics_reporting/lang/de/template-tags.json
+++ b/modules-available/statistics_reporting/lang/de/template-tags.json
@@ -10,7 +10,8 @@
"lang_location": "Ort",
"lang_longSessions": "Sitzungen \u2265 60s",
"lang_medianSessionLength": "Sitzungsdauer Median",
- "lang_reportingDescription": "Helfen Sie uns bwLehrpool durch das w\u00f6chentliche Verschicken eines anonymisierten Statistikberichts zu verbessern. Wenn Sie den Inhalt eines solchen Reports genauer inspizieren wollen, k\u00f6nnen Sie \u00fcber den untenstehenden Button einen aktuellen Report ihres Servers herunterladen.",
+ "lang_reportMoreInfo": "Weitere Informationen...",
+ "lang_reportingDescription": "Helfen Sie uns bwLehrpool durch das w\u00f6chentliche Verschicken eines anonymisierten Statistikberichts zu verbessern. Wenn Sie den Inhalt eines solchen Reports genauer inspizieren wollen, k\u00f6nnen Sie \u00fcber den untenstehenden Button einen aktuellen Report Ihres Servers herunterladen.",
"lang_reportingLabel": "Anonymisierte Nutzungsstatistiken \u00fcbermitteln",
"lang_sessions": "Sitzungen",
"lang_shortSessions": "Sitzungen < 60s",
diff --git a/modules-available/statistics_reporting/lang/en/template-tags.json b/modules-available/statistics_reporting/lang/en/template-tags.json
index a4865931..4e33ffed 100644
--- a/modules-available/statistics_reporting/lang/en/template-tags.json
+++ b/modules-available/statistics_reporting/lang/en/template-tags.json
@@ -10,6 +10,7 @@
"lang_location": "Location",
"lang_longSessions": "Sessions \u2265 60s",
"lang_medianSessionLength": "Median Session Length",
+ "lang_reportMoreInfo": "More information...",
"lang_reportingDescription": "Help us improve bwLehrpool by automatically sending an anonymized statistics report once a week. If you want to check what data the report contains, you can download such a report for reference below.",
"lang_reportingLabel": "Send anonymized usage statistics",
"lang_sessions": "Sessions",
diff --git a/modules-available/statistics_reporting/templates/columnChooser.html b/modules-available/statistics_reporting/templates/columnChooser.html
index a5ac828b..e4069be9 100644
--- a/modules-available/statistics_reporting/templates/columnChooser.html
+++ b/modules-available/statistics_reporting/templates/columnChooser.html
@@ -76,6 +76,7 @@
</div>
<div>
<p>{{lang_reportingDescription}}</p>
+ <p><a href="https://www.bwlehrpool.de/doku.php/satellite/statistics_reporting" target="_blank">{{lang_reportMoreInfo}}</a></p>
<a class="btn btn-success" href="?do=statistics_reporting&amp;action=getreport">{{lang_downloadReport}}</a>
</div>
</div>
diff --git a/modules-available/sysconfig/addmodule_adauth.inc.php b/modules-available/sysconfig/addmodule_adauth.inc.php
index 82df5bad..5de834d9 100644
--- a/modules-available/sysconfig/addmodule_adauth.inc.php
+++ b/modules-available/sysconfig/addmodule_adauth.inc.php
@@ -410,6 +410,7 @@ class AdAuth_HomeDir extends AddModule_Base
}
}
$data['shareRemapMode_' . $this->edit->getData('shareRemapMode')] = 'selected="selected"';
+ $data['shareDomain'] = $this->edit->getData('shareDomain');
$letter = $this->edit->getData('shareHomeDrive');
} else {
$data['shareDownloads_c'] = $data['shareMedia_c'] = $data['shareDocuments_c'] = $data['shareRemapCreate_c'] = 'checked="checked"';
diff --git a/modules-available/sysconfig/addmodule_ldapauth.inc.php b/modules-available/sysconfig/addmodule_ldapauth.inc.php
index c61c710c..33253d08 100644
--- a/modules-available/sysconfig/addmodule_ldapauth.inc.php
+++ b/modules-available/sysconfig/addmodule_ldapauth.inc.php
@@ -194,6 +194,7 @@ class LdapAuth_HomeDir extends AddModule_Base
}
}
$data['shareRemapMode_' . $this->edit->getData('shareRemapMode')] = 'selected="selected"';
+ $data['shareDomain'] = $this->edit->getData('shareDomain');
$letter = $this->edit->getData('shareHomeDrive');
} else {
$data['shareDownloads_c'] = $data['shareMedia_c'] = $data['shareDocuments_c'] = $data['shareRemapCreate_c'] = 'checked="checked"';
diff --git a/modules-available/sysconfig/api.inc.php b/modules-available/sysconfig/api.inc.php
index 556e99f3..d6cdc0e6 100644
--- a/modules-available/sysconfig/api.inc.php
+++ b/modules-available/sysconfig/api.inc.php
@@ -57,12 +57,7 @@ while ($r = $res->fetch(PDO::FETCH_ASSOC)) {
if ($row === false) {
// TODO Not found in DB
- deliverEmpty("No config.tgz for location $locationId found");
-}
-
-if (!file_exists($row['filepath'])) {
- // TODO Does not exist
- deliverEmpty();
+ deliverEmpty("No config.tgz for location $locationId found (src $ip)");
}
Header('Content-Type: application/gzip');
diff --git a/modules-available/sysconfig/templates/ad_ldap-homedir.html b/modules-available/sysconfig/templates/ad_ldap-homedir.html
index 2ced563d..06fb65c8 100644
--- a/modules-available/sysconfig/templates/ad_ldap-homedir.html
+++ b/modules-available/sysconfig/templates/ad_ldap-homedir.html
@@ -18,7 +18,7 @@
<div class="slx-bold">{{lang_credentialPassing}}</div>
<div class="checkbox">
- <input type="checkbox" class="form-control" id="inputcredentialPassthrough" name="credentialPassthrough">
+ <input type="checkbox" class="form-control" id="inputcredentialPassthrough" name="credentialPassthrough" {{credentialPassthrough_c}}>
<label for="inputcredentialPassthrough">{{lang_credentialPassing}}</label>
</div>
<div><i>{{lang_credPassingNotes}}</i></div>
@@ -42,7 +42,7 @@
<div class="form-group row">
<label for="inputshareDomain" class="control-label col-xs-4">{{lang_shareDomainLabel}}</label>
<div class="col-xs-8">
- <input type="text" class="form-control" id="inputshareDomain" name="shareDomain">
+ <input type="text" class="form-control" id="inputshareDomain" name="shareDomain" value="{{shareDomain}}">
<p><i>{{lang_shareDomainNote}}</i></p>
</div>
</div>
diff --git a/modules-available/systemstatus/lang/de/module.json b/modules-available/systemstatus/lang/de/module.json
index e69c3fb0..dd1a115c 100644
--- a/modules-available/systemstatus/lang/de/module.json
+++ b/modules-available/systemstatus/lang/de/module.json
@@ -1,3 +1,8 @@
{
- "module_name": "System-Status"
+ "module_name": "System-Status",
+ "tab_DmsdLog": "bwLehrpool-Suite Server Log",
+ "tab_LdadpLog": "LDAP\/AD",
+ "tab_LighttpdLog": "lighttpd Log",
+ "tab_Netstat": "netstat -tulpn",
+ "tab_PsList": "ps auxf"
} \ No newline at end of file
diff --git a/modules-available/systemstatus/lang/de/template-tags.json b/modules-available/systemstatus/lang/de/template-tags.json
index 3b929a6b..f014871b 100644
--- a/modules-available/systemstatus/lang/de/template-tags.json
+++ b/modules-available/systemstatus/lang/de/template-tags.json
@@ -1,22 +1,19 @@
{
"lang_addressConfiguration": "Adresskonfiguration",
- "lang_advanced": "Erweitert \/ Debug",
"lang_attention": "Achtung!",
"lang_average": "Durchschnitt",
"lang_capacity": "Kapazit\u00e4t",
"lang_cpuLoad": "CPU-Last",
- "lang_dmsdLog": "dmsd Log",
"lang_foundStore": "Vorgefunden:",
"lang_free": "Frei",
"lang_goToStoreConf": "Zur VM-Store-Konfiguration wechseln",
"lang_iAmSure": "Ja, ich bin sicher",
- "lang_ldadpLog": "AD\/LDAP-Proxy Log",
- "lang_lighttpdLog": "lighttpd-Error Log",
"lang_logicCPUs": "Logische CPUs",
"lang_maintenance": "Maintenance",
"lang_notDetermined": "Konnte nicht ermittelt werden",
"lang_occupied": "Belegt",
"lang_onlyOS": "Nur OS",
+ "lang_overview": "\u00dcbersicht",
"lang_ramUsage": "RAM-Nutzung",
"lang_services": "Dienste",
"lang_space": "Speicherplatz",
diff --git a/modules-available/systemstatus/lang/en/module.json b/modules-available/systemstatus/lang/en/module.json
index bb201773..9f6d937a 100644
--- a/modules-available/systemstatus/lang/en/module.json
+++ b/modules-available/systemstatus/lang/en/module.json
@@ -1,3 +1,8 @@
{
- "module_name": "System Status"
+ "module_name": "System Status",
+ "tab_DmsdLog": "bwLehrpool-Suite log",
+ "tab_LdadpLog": "LDAP\/AD",
+ "tab_LighttpdLog": "lighttpd log",
+ "tab_Netstat": "netstat -tulpn",
+ "tab_PsList": "ps auxf"
} \ No newline at end of file
diff --git a/modules-available/systemstatus/lang/en/template-tags.json b/modules-available/systemstatus/lang/en/template-tags.json
index b8730411..719a1155 100644
--- a/modules-available/systemstatus/lang/en/template-tags.json
+++ b/modules-available/systemstatus/lang/en/template-tags.json
@@ -1,22 +1,19 @@
{
"lang_addressConfiguration": "Address Configuration",
- "lang_advanced": "Advanced \/ Debug",
"lang_attention": "Attention!",
"lang_average": "Average",
"lang_capacity": "Capacity",
"lang_cpuLoad": "CPU Load",
- "lang_dmsdLog": "dmsd log",
"lang_foundStore": "Found:",
"lang_free": "Free",
"lang_goToStoreConf": "Go to VM store configuration",
"lang_iAmSure": "Yes, I am sure",
- "lang_ldadpLog": "AD\/LDAP proxy log",
- "lang_lighttpdLog": "lighttpd-error log",
"lang_logicCPUs": "Logic CPUs",
"lang_maintenance": "Maintenance",
"lang_notDetermined": "Could not be determined",
"lang_occupied": "Occupied",
"lang_onlyOS": "OS Only",
+ "lang_overview": "Overview",
"lang_ramUsage": "RAM Usage",
"lang_services": "Services",
"lang_space": "Space",
diff --git a/modules-available/systemstatus/page.inc.php b/modules-available/systemstatus/page.inc.php
index b9fef0fd..a8deeecb 100644
--- a/modules-available/systemstatus/page.inc.php
+++ b/modules-available/systemstatus/page.inc.php
@@ -29,6 +29,14 @@ class Page_SystemStatus extends Page
if (is_array($this->rebootTask) && isset($this->rebootTask['id'])) {
$data['rebootTask'] = $this->rebootTask['id'];
}
+ $tabs = array('DmsdLog', 'Netstat', 'PsList', 'LdadpLog', 'LighttpdLog');
+ $data['tabs'] = array();
+ foreach ($tabs as $tab) {
+ $data['tabs'][] = array(
+ 'type' => $tab,
+ 'name' => Dictionary::translate('tab_' . $tab)
+ );
+ }
Render::addTemplate('_page', $data);
}
diff --git a/modules-available/systemstatus/templates/_page.html b/modules-available/systemstatus/templates/_page.html
index 0573a20c..48a7e5c4 100644
--- a/modules-available/systemstatus/templates/_page.html
+++ b/modules-available/systemstatus/templates/_page.html
@@ -2,137 +2,126 @@
<div data-tm-id="{{rebootTask}}" data-tm-log="messages">Reboot...</div>
{{/rebootTask}}
-<div class="row">
+<ul class="nav nav-tabs tabs-up">
+ <li class="active">
+ <a href="#id-default_pane" id="id-default" class="active" data-toggle="tab" role="tab">
+ {{lang_overview}}
+ </a>
+ </li>
+ {{#tabs}}
+ <li>
+ <a href="#id-{{type}}_pane" class="ajax-tab" id="id-{{type}}" data-toggle="tab" role="tab">
+ {{name}}
+ </a>
+ </li>
+ {{/tabs}}
+</ul>
- <div class="col-sm-6">
- <div class="panel panel-default">
- <div class="panel-heading">
- {{lang_space}}
- </div>
- <div class="panel-body" id="diskstat">
- <span class="glyphicon glyphicon-refresh slx-rotation"></span>
- </div>
- </div>
- </div>
+<div class="tab-content">
+
+ <div class="tab-pane active" id="id-default_pane">
+ <div class="row">
- <div class="col-sm-6">
- <div class="panel panel-default">
- <div class="panel-heading">
- {{lang_services}}
+ <div class="col-sm-6">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ {{lang_space}}
+ </div>
+ <div class="panel-body" id="diskstat">
+ <span class="glyphicon glyphicon-refresh slx-rotation"></span>
+ </div>
+ </div>
</div>
- <div class="panel-body" id="services">
- <span class="glyphicon glyphicon-refresh slx-rotation"></span>
+
+ <div class="col-sm-6">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ {{lang_services}}
+ </div>
+ <div class="panel-body" id="services">
+ <span class="glyphicon glyphicon-refresh slx-rotation"></span>
+ </div>
+ </div>
</div>
- </div>
- </div>
-</div>
+ </div>
-<div class="row">
+ <div class="row">
- <div class="col-md-6">
- <div class="panel panel-default">
- <div class="panel-heading">
- {{lang_addressConfiguration}}
- </div>
- <div class="panel-body" id="addresses">
- <span class="glyphicon glyphicon-refresh slx-rotation"></span>
+ <div class="col-md-6">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ {{lang_addressConfiguration}}
+ </div>
+ <div class="panel-body" id="addresses">
+ <span class="glyphicon glyphicon-refresh slx-rotation"></span>
+ </div>
+ </div>
</div>
- </div>
- </div>
- <div class="col-md-6">
- <div class="panel panel-default">
- <div class="panel-heading">
- {{lang_system}}
- </div>
- <div class="panel-body" id="systeminfo">
- <span class="glyphicon glyphicon-refresh slx-rotation"></span>
+ <div class="col-md-6">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ {{lang_system}}
+ </div>
+ <div class="panel-body" id="systeminfo">
+ <span class="glyphicon glyphicon-refresh slx-rotation"></span>
+ </div>
+ </div>
</div>
- </div>
- </div>
-</div>
+ </div>
-<div class="row">
+ <div class="row">
- <div class="col-md-6">
- <div class="panel panel-default">
- <div class="panel-heading">
- {{lang_maintenance}}
- </div>
- <div class="panel-body">
- <form class="form-adduser" action="?do=SystemStatus" method="post">
- <input type="hidden" name="token" value="{{token}}">
- <input type="hidden" name="action" value="reboot">
- <div>Server Reboot</div>
- <label><input type="checkbox" name="confirm" value="yep"> {{lang_iAmSure}}</label>
- <button class="btn btn-warning btn-xs" type="submit">Reboot</button>
- </form>
- <div id="dmsd-users"></div>
+ <div class="col-md-6">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ {{lang_maintenance}}
+ </div>
+ <div class="panel-body">
+ <form class="form-adduser" action="?do=SystemStatus" method="post">
+ <input type="hidden" name="token" value="{{token}}">
+ <input type="hidden" name="action" value="reboot">
+ <div>Server Reboot</div>
+ <label><input type="checkbox" name="confirm" value="yep"> {{lang_iAmSure}}</label>
+ <button class="btn btn-warning btn-xs" type="submit">Reboot</button>
+ </form>
+ <div id="dmsd-users"></div>
+ </div>
+ </div>
</div>
+
</div>
</div>
-</div>
-
-<h3>{{lang_advanced}}</h3>
-
-<div class="panel panel-default">
- <div class="panel-heading">
- {{lang_dmsdLog}}
- </div>
- <div class="panel-body" id="dmsd-log">
- <span class="glyphicon glyphicon-refresh slx-rotation"></span>
- </div>
-</div>
-<div class="panel panel-default">
- <div class="panel-heading">
- {{lang_ldadpLog}}
- </div>
- <div class="panel-body" id="ldadp-log">
- <span class="glyphicon glyphicon-refresh slx-rotation"></span>
- </div>
-</div>
-<div class="panel panel-default">
- <div class="panel-heading">
- {{lang_lighttpdLog}}
- </div>
- <div class="panel-body" id="lighttpd-log">
- <span class="glyphicon glyphicon-refresh slx-rotation"></span>
- </div>
-</div>
-<div class="panel panel-default">
- <div class="panel-heading">
- netstat -tulpn
- </div>
- <div class="panel-body" id="netstat">
- <span class="glyphicon glyphicon-refresh slx-rotation"></span>
- </div>
-</div>
-<div class="panel panel-default">
- <div class="panel-heading">
- ps auxf
- </div>
- <div class="panel-body" id="pslist">
+{{#tabs}}
+ <div class="tab-pane" id="id-{{type}}_pane">
<span class="glyphicon glyphicon-refresh slx-rotation"></span>
</div>
+{{/tabs}}
</div>
-<script type="text/javascript">
+<div>&nbsp;</div>
+
+<script type="text/javascript"><!--
document.addEventListener("DOMContentLoaded", function() {
$('#diskstat').load('?do=SystemStatus&action=DiskStat');
$('#addresses').load('?do=SystemStatus&action=AddressList');
$('#systeminfo').load('?do=SystemStatus&action=SystemInfo');
$('#services').load('?do=SystemStatus&action=Services');
$('#dmsd-users').load('?do=SystemStatus&action=DmsdUsers');
- setTimeout(function() {
- $('#dmsd-log').load('?do=SystemStatus&action=DmsdLog');
- $('#netstat').load('?do=SystemStatus&action=Netstat');
- $('#pslist').load('?do=SystemStatus&action=PsList');
- $('#ldadp-log').load('?do=SystemStatus&action=LdadpLog');
- $('#lighttpd-log').load('?do=SystemStatus&action=LighttpdLog');
- }, 300);
+ var slxDone = {};
+ $('.ajax-tab').click(function (e) {
+ e.preventDefault();
+ var $this = $(this);
+ var w = $this.attr('id');
+ if (!slxDone[w]) {
+ slxDone[w] = true;
+ var $pane = $('#' + w + '_pane');
+ $pane.load('?do=SystemStatus&action=' + w.substring(3));
+ }
+ });
}, false);
-</script>
+//--></script>
diff --git a/modules-available/webinterface/lang/de/template-tags.json b/modules-available/webinterface/lang/de/template-tags.json
index ea1074d2..64ba84d0 100644
--- a/modules-available/webinterface/lang/de/template-tags.json
+++ b/modules-available/webinterface/lang/de/template-tags.json
@@ -3,14 +3,18 @@
"lang_caChain": "Optional k\u00f6nnen Sie hier die zum Zertifikat geh\u00f6rende Zertifikatkette (CA-Chain) einf\u00fcgen. Dies wird ben\u00f6tigt, wenn das Zertifikat nicht direkt von einer der in Browsern mitgeliferten CAs signiert wurde. Die Datei enth\u00e4lt ein oder meherere Zertifikatsbl\u00f6cke, im gleichen Format wie das oben gezeigte Zertifikat.",
"lang_certificate": "Bitte f\u00fcgen Sie hier das Zertifikat ein. Das Zertifikat wird im Base64-codierten x509-Format erwartet (manchmal pem genannt). Es sieht in etwa wie folgt aus:",
"lang_customCert": "Eigenes Zertifikat verwenden",
+ "lang_customization": "Designanpassung",
+ "lang_customizationDesc": "Hier k\u00f6nnen Sie kleine optische Anpassungen an der Weboberfl\u00e4che vornehmen. Dies ist hilfreich, wenn Sie z.B. ein Produktiv- und ein Testsystem betreiben und verhindern m\u00f6chten, dass Sie versehentlich in der falschen Weboberfl\u00e4che kritische Einstellungen ver\u00e4ndern.",
"lang_generatedSelected": "Der Server verwendet zur Zeit ein automatisch generiertes, selbst signiertes Zertifikat.",
"lang_hidePasswords": "Passw\u00f6rter maskieren",
"lang_httpsDescription": "Hier k\u00f6nnen Sie festlegen, ob das Web-Interface auch per HTTPS erreichbar sein soll, und welches Zertifikat daf\u00fcr verwendet werden soll.",
"lang_httpsRedirect": "Anfragen per HTTP immer auf HTTPS umleiten (sofern aktiviert)",
"lang_httpsSettings": "HTTPS-Konfiguration",
"lang_installAndRestart": "Zertifikat installieren und Webserver neustarten",
+ "lang_logoBackground": "Hintergrundfarbe des Logos",
"lang_noHttps": "HTTPS wieder deaktivieren, aktuelles Zertifikat l\u00f6schen",
"lang_offSelected": "HTTPS ist derzeit deaktiviert.",
+ "lang_pageTitlePrefix": "Pr\u00e4fix f\u00fcr den Seitentitel",
"lang_passwordFields": "Passwortfelder",
"lang_passwordsDescription": "Legen Sie fest, ob Passwortfelder in der Web-Schnittstelle maskiert werden, oder ob Ihr Inhalt sichtbar sein soll. Wenn Sie die Schnittstelle in einer sicheren Umgebung nutzen (keine neugierigen Augen), kann dies den Komfort erh\u00f6hen. Das Passwortfeld der Anmeldemaske ist von dieser Einstellung ausgenommen.",
"lang_privateKey": "Bitte f\u00fcgen Sie hier den privaten Schl\u00fcssel ein, der zum obigen Zertifikat geh\u00f6rt. Er muss ebenfalls im \"pem\"-Format vorliegen, und sieht wie folgt aus:",
@@ -18,6 +22,7 @@
"lang_showPasswords": "Passw\u00f6rter anzeigen",
"lang_suppliedSelected": "Der Server verwendet zur Zeit ein \u00fcber die Option \"Eigenes Zertifikat\" hochgeladenes Zertifikat.",
"lang_unknownSelected": "Unbekanntes oder ung\u00fcltiges Zertifikat vorhanden. Wahrscheinlich wurde der Server von einer alten Version aktualisiert. Um diese Meldung zu entfernen, die HTTPS-Konfiguration erneut vornehmen.",
+ "lang_useHsts": "HSTS aktivieren (dies erh\u00f6ht die Sicherheit, kann aber in bei sp\u00e4terem Deaktivieren von HTTPS zu Zugriffsproblemen f\u00fchren)",
"lang_youreNotUsingHttps": "Sie besuchen diese Seite nicht per HTTPS (oder die HTTPS-Terminierung wird von einem vorgeschalteten Proxy \u00fcbernommen).",
"lang_youreUsingHttps": "Sie besuchen diese Seite (aus Sicht des Webservers) per HTTPS."
} \ No newline at end of file
diff --git a/modules-available/webinterface/lang/en/template-tags.json b/modules-available/webinterface/lang/en/template-tags.json
index efe649cb..0fb4cc96 100644
--- a/modules-available/webinterface/lang/en/template-tags.json
+++ b/modules-available/webinterface/lang/en/template-tags.json
@@ -3,14 +3,18 @@
"lang_caChain": "Here you can paste an optional certificate chain. It should only be required if you have a certificate that was not directly signed by a certificate authority known by the browsers. It should contain one or more certificate blocks, looking just like the certificate above.",
"lang_certificate": "Please paste your certificate below. It has to be in base64 encoded x509 format (sometimes called pem). It should look something like this:",
"lang_customCert": "Supply own certificate",
+ "lang_customization": "Design customization",
+ "lang_customizationDesc": "Here you can make small changes to the design of the web interface. This might help to prevent accidents if you run multiple satellite servers and have an open tab for all of them at the same time.",
"lang_generatedSelected": "The server is currently using an automatically generated, self-signed certificate.",
"lang_hidePasswords": "Mask passwords",
"lang_httpsDescription": "Here you can set whether the web interface should be accessible via https. You can choose if you want to use a random self signed certificate, or supply your own.",
"lang_httpsRedirect": "Redirect incoming HTTP requests to HTTPS (if enabled).",
"lang_httpsSettings": "HTTPS settings",
"lang_installAndRestart": "Installing certificate and restarting web server",
+ "lang_logoBackground": "Logo background color",
"lang_noHttps": "Disable HTTPS, delete current certificate",
"lang_offSelected": "HTTPS is currently disabled.",
+ "lang_pageTitlePrefix": "Page title prefix",
"lang_passwordFields": "Password fields",
"lang_passwordsDescription": "Set whether password fields should be masked or not. The password field of the login page to the web interface is always masked.",
"lang_privateKey": "Please paste the private key belonging to the certificate here. It has to be in \"pem\" format too, which should look like this:",
@@ -18,6 +22,7 @@
"lang_showPasswords": "Show passwords",
"lang_suppliedSelected": "The server is currently using a certificate supplied using the \"Supply own certificate\" option.",
"lang_unknownSelected": "Unknown or invalid certificate in use. The server war probably updated from an old version while HTTPS was already enabled. Redo the HTTPS configuration steps to get rid of this message.",
+ "lang_useHsts": "Use HSTS (increases security but might lead to problems accessing the site if you disable HTTPS later)",
"lang_youreNotUsingHttps": "You're not using HTTPS to visit this website (or the HTTPS termination is done by a reverse proxy).",
"lang_youreUsingHttps": "You're visiting this server through an HTTPS connection (from the server's point of view)."
} \ No newline at end of file
diff --git a/modules-available/webinterface/page.inc.php b/modules-available/webinterface/page.inc.php
index 93d659f0..e576807e 100644
--- a/modules-available/webinterface/page.inc.php
+++ b/modules-available/webinterface/page.inc.php
@@ -5,6 +5,7 @@ class Page_WebInterface extends Page
const PROP_REDIRECT = 'webinterface.https-redirect';
const PROP_TYPE = 'webinterface.https-type';
+ const PROP_HSTS = 'webinterface.https-hsts';
protected function doPreprocess()
{
@@ -20,17 +21,18 @@ class Page_WebInterface extends Page
case 'password':
$this->actionShowHidePassword();
break;
+ case 'customization':
+ $this->actionCustomization();
+ break;
}
}
private function actionConfigureHttps()
{
- $task = false;
- $off = '';
- switch (Request::post('mode')) {
+ $mode = Request::post('mode');
+ switch ($mode) {
case 'off':
$task = $this->setHttpsOff();
- $off = '&hsts=off';
break;
case 'random':
$task = $this->setHttpsRandomCert();
@@ -42,9 +44,12 @@ class Page_WebInterface extends Page
$task = $this->setRedirectMode();
break;
}
+ if ($mode !== 'off') {
+ Property::set(self::PROP_HSTS, Request::post('usehsts', false, 'string') === 'on' ? 'True' : 'False');
+ }
if (isset($task['id'])) {
Session::set('https-id', $task['id']);
- Util::redirect('?do=WebInterface&show=httpsupdate' . $off);
+ Util::redirect('?do=WebInterface&show=httpsupdate');
}
Util::redirect('?do=WebInterface');
}
@@ -55,6 +60,17 @@ class Page_WebInterface extends Page
Util::redirect('?do=WebInterface');
}
+ private function actionCustomization()
+ {
+ $prefix = Request::post('prefix', '', 'string');
+ if (!empty($prefix) && !preg_match('/[\]\)\}\-_\s\&\$\!\/\+\*\^\>]$/', $prefix)) {
+ $prefix .= ' ';
+ }
+ Property::set('page-title-prefix', $prefix);
+ Property::set('logo-background', Request::post('bgcolor', '', 'string'));
+ Util::redirect('?do=WebInterface');
+ }
+
protected function doRender()
{
//
@@ -65,11 +81,13 @@ class Page_WebInterface extends Page
}
$type = Property::get(self::PROP_TYPE);
$force = Property::get(self::PROP_REDIRECT) === 'True';
+ $hsts = Property::get(self::PROP_HSTS) === 'True';
$https = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off';
$exists = file_exists('/etc/lighttpd/server.pem');
$data = array(
'httpsUsed' => $https,
- 'redirect_checked' => ($force ? 'checked' : '')
+ 'redirect_checked' => ($force ? 'checked' : ''),
+ 'hsts_checked' => ($hsts ? 'checked' : '')
);
// Type should be 'off', 'generated', 'supplied'
if ($type === 'off') {
@@ -114,12 +132,30 @@ class Page_WebInterface extends Page
else
$data['selected_hide'] = 'checked';
Render::addTemplate('passwords', $data);
+ $data = array('prefix' => Property::get('page-title-prefix'));
+ $data['colors'] = array_map(function ($i) { return array('color' => $i ? '#' . $i : '', 'text' => Render::readableColor($i)); },
+ array('', 'f00', '0f0', '00f', 'ff0', 'f0f', '0ff', 'fff', '000', 'f90', '09f', '90f', 'f09', '9f0'));
+ $color = Property::get('logo-background');
+ foreach ($data['colors'] as &$c) {
+ if ($c['color'] === $color) {
+ $c['selected'] = 'selected';
+ $color = false;
+ break;
+ }
+ }
+ unset($c);
+ if ($color) {
+ $data['colors'][] = array('color' => $color, 'selected' => 'selected');
+ }
+ Render::addTemplate('customization', $data);
}
private function setHttpsOff()
{
Property::set(self::PROP_TYPE, 'off');
+ Property::set(self::PROP_HSTS, 'off');
Header('Strict-Transport-Security: max-age=0', true);
+ Session::deleteCookie();
return Taskmanager::submit('LighttpdHttps', array());
}
diff --git a/modules-available/webinterface/templates/customization.html b/modules-available/webinterface/templates/customization.html
new file mode 100644
index 00000000..7949f95b
--- /dev/null
+++ b/modules-available/webinterface/templates/customization.html
@@ -0,0 +1,30 @@
+<form action="?do=WebInterface" method="post">
+ <input type="hidden" name="token" value="{{token}}">
+ <input type="hidden" name="action" value="customization">
+ <div class="panel panel-default">
+ <div class="panel-heading">{{lang_customization}}</div>
+ <div class="panel-body">
+ <p>{{lang_customizationDesc}}</p>
+ <div>
+ <label>
+ {{lang_pageTitlePrefix}}
+ <input type="text" class="form-control" name="prefix" value="{{prefix}}">
+ </label>
+
+ </div>
+ <div>
+ <label>
+ {{lang_logoBackground}}
+ <select class="form-control" name="bgcolor">
+ {{#colors}}
+ <option style="color:{{text}};background:{{color}}" {{selected}}>{{color}}</option>
+ {{/colors}}
+ </select>
+ </label>
+ </div>
+ <div class="pull-right">
+ <button type="submit" class="btn btn-primary">{{lang_save}}</button>
+ </div>
+ </div>
+ </div>
+</form>
diff --git a/modules-available/webinterface/templates/https.html b/modules-available/webinterface/templates/https.html
index 77585ddf..ecfe5f5d 100644
--- a/modules-available/webinterface/templates/https.html
+++ b/modules-available/webinterface/templates/https.html
@@ -78,6 +78,12 @@ MIIFfTCCA...
{{lang_httpsRedirect}}
</span>
</div>
+ <div class="input-group">
+ <span class="input-group-addon"><input id="usehsts" type="checkbox" name="usehsts" value="on" {{hsts_checked}}></span>
+ <span class="form-control" onclick="$('#usehsts').prop('checked', !$('#usehsts').prop('checked'))">
+ {{lang_useHsts}}
+ </span>
+ </div>
<br>
<div class="pull-right">