From 391d831ec434d12e6ec825fe75f7950bd0da1004 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 20 Apr 2017 11:51:47 +0200 Subject: [locationinfo] Rename tables to use module name as prefix; room -> location --- modules-available/rebootcontrol/inc/rebootqueries.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules-available/rebootcontrol') diff --git a/modules-available/rebootcontrol/inc/rebootqueries.inc.php b/modules-available/rebootcontrol/inc/rebootqueries.inc.php index df3c13d8..62092748 100644 --- a/modules-available/rebootcontrol/inc/rebootqueries.inc.php +++ b/modules-available/rebootcontrol/inc/rebootqueries.inc.php @@ -36,8 +36,8 @@ class RebootQueries { if (empty($list)) return array(); - $qs = '?' . str_repeat(',?', count($list) - 1); - $res = Database::simpleQuery("SELECT machineuuid, clientip, locationid FROM machine WHERE machineuuid IN ($qs)", $list); + $res = Database::simpleQuery("SELECT machineuuid, clientip, locationid FROM machine + WHERE machineuuid IN (:list)", compact('list')); return $res->fetchAll(PDO::FETCH_ASSOC); } -- cgit v1.2.3-55-g7522 From 534e8cc91072acb55a847f093d37e3eccbb364cc Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 28 Apr 2017 10:24:36 +0200 Subject: Move rebootcontrol, locationinfo to new beta section, statistics_reporting to status Closes #3122 --- modules-available/locationinfo/config.json | 2 +- modules-available/main/category-icons.json | 3 ++- modules-available/main/lang/de/categories.json | 1 + modules-available/main/lang/en/categories.json | 1 + modules-available/rebootcontrol/config.json | 2 +- modules-available/statistics_reporting/config.json | 2 +- 6 files changed, 7 insertions(+), 4 deletions(-) (limited to 'modules-available/rebootcontrol') 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/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/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/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" ] } -- cgit v1.2.3-55-g7522 From 87af588a5c2e7d33bfea1b6f78d944575c5bb854 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 2 May 2017 15:33:58 +0200 Subject: Update translations --- modules-available/locationinfo/lang/de/module.json | 2 +- .../locationinfo/lang/de/template-tags.json | 50 +++++++++++----------- .../locationinfo/lang/en/template-tags.json | 26 +++++------ .../rebootcontrol/lang/de/template-tags.json | 6 +-- 4 files changed, 42 insertions(+), 42 deletions(-) (limited to 'modules-available/rebootcontrol') 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..8bc5ccd6 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,28 @@ "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": "", "lang_openingTime": "\u00d6ffnungszeiten", "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 +66,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..6b9742a6 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,28 @@ "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": "", "lang_openingTime": "Opening times", "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 +67,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/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", -- cgit v1.2.3-55-g7522 From 717cac27efd48dc41e49cadabf8555480d21db26 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 9 May 2017 12:24:31 +0200 Subject: [rebootcontrol] API call for rebuilding all modules --- modules-available/rebootcontrol/api.inc.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'modules-available/rebootcontrol') 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 @@ $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; -- cgit v1.2.3-55-g7522 From dd497ba5a35285e9b41ee592095d3356480ed9d6 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 9 May 2017 17:31:37 +0200 Subject: [rebootcontrol] Fix current session display, colors for on/off --- .../rebootcontrol/inc/rebootqueries.inc.php | 17 +++++++++++++++-- modules-available/rebootcontrol/templates/_page.html | 4 ++-- 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'modules-available/rebootcontrol') diff --git a/modules-available/rebootcontrol/inc/rebootqueries.inc.php b/modules-available/rebootcontrol/inc/rebootqueries.inc.php index 62092748..3b665e5b 100644 --- a/modules-available/rebootcontrol/inc/rebootqueries.inc.php +++ b/modules-available/rebootcontrol/inc/rebootqueries.inc.php @@ -19,12 +19,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); + $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/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 @@ {{clientip}} {{#status}} - {{lang_on}} + {{lang_on}} {{/status}} {{^status}} - {{lang_off}} + {{lang_off}} {{/status}} {{#status}}{{currentsession}}{{/status}} -- cgit v1.2.3-55-g7522 From 05639c4c66ee783439bf06c261728d6752a63f09 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 11 May 2017 13:43:06 +0200 Subject: [rebootcontrol] Don't show clients that haven't been seen for more than 30 days --- modules-available/rebootcontrol/inc/rebootqueries.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules-available/rebootcontrol') diff --git a/modules-available/rebootcontrol/inc/rebootqueries.inc.php b/modules-available/rebootcontrol/inc/rebootqueries.inc.php index 3b665e5b..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'; @@ -23,7 +25,7 @@ class RebootQueries $sessionField, machine.currentuser, machine.locationid FROM machine $leftJoin - WHERE " . $where, array('locationid' => $locationId)); + WHERE $where AND machine.lastseen > :cutoff", $queryArgs); $ret = $res->fetchAll(PDO::FETCH_ASSOC); $NOW = time(); foreach ($ret as &$row) { -- cgit v1.2.3-55-g7522