summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-12-11 15:17:06 +0100
committerSimon Rettberg2019-12-11 15:17:06 +0100
commit9d4dd4c1c3964272ae04b193ea70cc44b643e6cd (patch)
tree33aaf01e2d27538edaad18d55ee1ecf1cdaee550
parent[rebootcontrol] Fix: Replace \r\n by \n for exec script (diff)
parent[statistics/roomplanner] Update translations (diff)
downloadslx-admin-9d4dd4c1c3964272ae04b193ea70cc44b643e6cd.tar.gz
slx-admin-9d4dd4c1c3964272ae04b193ea70cc44b643e6cd.tar.xz
slx-admin-9d4dd4c1c3964272ae04b193ea70cc44b643e6cd.zip
Merge branch 'master' into wol
-rwxr-xr-xmodules-available/locationinfo/templates/frontend-default.html26
-rw-r--r--modules-available/minilinux/inc/linuxbootentryhook.inc.php14
-rw-r--r--modules-available/minilinux/inc/minilinux.inc.php1
-rw-r--r--modules-available/minilinux/lang/de/module.json1
-rw-r--r--modules-available/roomplanner/lang/de/messages.json2
-rw-r--r--modules-available/roomplanner/lang/de/template-tags.json7
-rw-r--r--modules-available/serversetup-bwlp-ipxe/inc/bootentryhook.inc.php22
-rw-r--r--modules-available/serversetup-bwlp-ipxe/page.inc.php5
-rw-r--r--modules-available/statistics/lang/de/template-tags.json1
9 files changed, 67 insertions, 12 deletions
diff --git a/modules-available/locationinfo/templates/frontend-default.html b/modules-available/locationinfo/templates/frontend-default.html
index 9bca1ccb..2388af42 100755
--- a/modules-available/locationinfo/templates/frontend-default.html
+++ b/modules-available/locationinfo/templates/frontend-default.html
@@ -747,14 +747,31 @@ optional:
}
/**
+ * Calculate the correct start date based on the number of days shown in the calendar
+ * @param startDay Start week day (0 = current day, 1 = Monday, 7 = Sunday)
+ * @param daysToShow Number of days to show in the calendar
+ * @return {Date} Start date
+ */
+ function getStartDate(startDay, daysToShow) {
+ var now = new Date();
+ var startDate = new Date(now.getTime());
+ if (startDay > 0) {
+ startDate.setDate(startDate.getDate() - startDate.getDay() + (startDay % 7));
+ if (startDate > now) startDate.setDate(startDate.getDate() - 7);
+ var endDayDate = new Date(startDate.getTime());
+ endDayDate.setDate(endDayDate.getDate() + daysToShow);
+ if (endDayDate <= now) startDate.setDate(startDate.getDate() + 7);
+ }
+ return startDate;
+ }
+
+ /**
* inilizes the Calendar for an room
* @param room Room Object
*/
function setUpCalendar(room) {
var daysToShow = room.config.daystoshow;
- var startDay = room.config.startday;
- var startDayDate = new Date();
- if (startDay > 0) startDayDate.setDate((startDayDate.getDate() - (startDayDate.getDay() + 6) % 7) + (startDay - 1));
+ var startDate = getStartDate(room.config.startday, daysToShow);
generateCalendarDiv(room);
room.$.calendar.weekCalendar({
timeslotsPerHour: 1,
@@ -782,7 +799,7 @@ optional:
$event.find(".time").css({"backgroundColor": "#25B002", "border": "1px solid #888"});
}
},
- date: startDayDate,
+ date: startDate,
dateFormat: "j.n",
timeFormat: "G:i",
scrollToHourMillis: 500,
@@ -1043,6 +1060,7 @@ optional:
result = Math.min(Math.max(Math.abs(result), 1), 7);
if (result !== $cal.weekCalendar("option", "daysToShow")) {
$cal.weekCalendar("option", "daysToShow", result);
+ $cal.weekCalendar("gotoDate", getStartDate(room.config.startday, result));
columnWidth = $cal.find(".wc-day-1").width();
}
}
diff --git a/modules-available/minilinux/inc/linuxbootentryhook.inc.php b/modules-available/minilinux/inc/linuxbootentryhook.inc.php
index 56f66502..324ffc7e 100644
--- a/modules-available/minilinux/inc/linuxbootentryhook.inc.php
+++ b/modules-available/minilinux/inc/linuxbootentryhook.inc.php
@@ -20,10 +20,12 @@ class LinuxBootEntryHook extends BootEntryHook
/* For translate module:
* Dictionary::translate('ipxe-kcl-extra');
* Dictionary::translate('ipxe-debug');
+ * Dictionary::translate('ipxe-insecure-cpu');
*/
return [
new HookExtraField('kcl-extra', 'string', ''),
new HookExtraField('debug', 'bool', false),
+ new HookExtraField('insecure-cpu', 'bool', false),
];
}
@@ -123,14 +125,20 @@ class LinuxBootEntryHook extends BootEntryHook
}
}
// KCL hacks
- if (isset($localData['debug']) && $localData['debug']) {
+ if (!empty($localData['debug'])) {
+ // Debug boot enabled
$exec->commandLine = IPxe::modifyCommandLine($exec->commandLine,
isset($remoteData['debugCommandLineModifier'])
? $remoteData['debugCommandLineModifier']
: '-vga -quiet -splash -loglevel loglevel=7'
);
}
- if (isset($localData['kcl-extra'])) {
+ // disable all CPU sidechannel attack mitigations etc.
+ if (!empty($localData['insecure-cpu'])) {
+ $exec->commandLine = IPxe::modifyCommandLine($exec->commandLine,
+ 'noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off mitigations=off');
+ }
+ if (!empty($localData['kcl-extra'])) {
$exec->commandLine = IPxe::modifyCommandLine($exec->commandLine, $localData['kcl-extra']);
}
$exec->commandLine = str_replace('%ID%', $effectiveId, $exec->commandLine);
@@ -146,6 +154,8 @@ class LinuxBootEntryHook extends BootEntryHook
public function isValidId($id)
{
+ if ($id === 'default')
+ return true; // Meta-version that links to whatever the default is set to
$res = Database::queryFirst('SELECT installed FROM minilinux_version WHERE versionid = :id', ['id' => $id]);
return $res !== false && $res['installed'];
}
diff --git a/modules-available/minilinux/inc/minilinux.inc.php b/modules-available/minilinux/inc/minilinux.inc.php
index ca81eafa..005b81fa 100644
--- a/modules-available/minilinux/inc/minilinux.inc.php
+++ b/modules-available/minilinux/inc/minilinux.inc.php
@@ -23,7 +23,6 @@ class MiniLinux
{
$stamp = time();
$last = Property::get(self::PROPERTY_KEY_FETCHTIME);
- error_log('Last: ' . $last);
if ($last !== false && $last + 10 > $stamp)
return 0; // In progress...
Property::set(self::PROPERTY_KEY_FETCHTIME, $stamp, 1);
diff --git a/modules-available/minilinux/lang/de/module.json b/modules-available/minilinux/lang/de/module.json
index 3e5ed495..133e428f 100644
--- a/modules-available/minilinux/lang/de/module.json
+++ b/modules-available/minilinux/lang/de/module.json
@@ -6,6 +6,7 @@
"file-ok": "OK",
"file-size-mismatch": "Dateigr\u00f6\u00dfe stimmt nicht",
"ipxe-debug": "Debug-Ausgaben statt Bootlogo",
+ "ipxe-insecure-cpu": "Alle Mitigations for CPU-Sicherheitsl\u00fccken deaktivieren",
"ipxe-kcl-extra": "Modifikation der Kernel-Command-Line",
"menu-sources": "Update-Quellen",
"menu-versions": "Verf\u00fcgbare Versionen",
diff --git a/modules-available/roomplanner/lang/de/messages.json b/modules-available/roomplanner/lang/de/messages.json
index 3943c2c3..dca2c770 100644
--- a/modules-available/roomplanner/lang/de/messages.json
+++ b/modules-available/roomplanner/lang/de/messages.json
@@ -1,5 +1,7 @@
{
+ "db-error": "Datenbankfehler",
"invalid-tutor-uuid": "Ung\u00fcltige ID f\u00fcr den Tutor festgelegt",
"json-data-invalid": "\u00dcbermittelte Daten sind kein g\u00fcltiges JSON",
+ "leaf-mode-mismatch": "Falscher Raumtyp: Versuche zusammengesetzten Raum als normalen Raum zu speichern, oder umgekehrt!",
"need-locationid": "Keine locationid angegeben"
} \ No newline at end of file
diff --git a/modules-available/roomplanner/lang/de/template-tags.json b/modules-available/roomplanner/lang/de/template-tags.json
index 3d9db40c..967322e6 100644
--- a/modules-available/roomplanner/lang/de/template-tags.json
+++ b/modules-available/roomplanner/lang/de/template-tags.json
@@ -17,16 +17,22 @@
"lang_classroomdeskchair": "Klassenzimmertisch mit Stuhl",
"lang_classroomtable": "Klassenzimmertisch",
"lang_coatrack": "Garderobe",
+ "lang_composedLayout": "Zusammengesetztes Layout",
"lang_conferencetable": "Konferenztisch",
"lang_confirmDiscardChanges": "Wollen Sie alle \u00c4nderungen verwerfen?",
+ "lang_controlRoomDesc": "Dies ist der Raum, dessen PVS-Manager bei logischer Zusammenlegung der Unterr\u00e4ume der kontrollierende PVS-Manager sein wird.",
+ "lang_controllingRoom": "Kontrollierender Raum",
"lang_couch": "Couch",
"lang_dedicatedManager": "Exklusiv",
"lang_descriptionBySearch": "Hier k\u00f6nnen aus der Liste aller bekannter Rechner suchen.",
"lang_descriptionBySubnet": "Hier sehen Sie Computer, die sich in den zum Raum geh\u00f6renden Subnetzen befinden.",
"lang_deskLamp": "Tischlampe",
"lang_door": "T\u00fcr",
+ "lang_editComposedRoom": "Zusammengesetzten Raum bearbeiten",
+ "lang_exposeAsComposedRoom": "Als zusammengesetzten Raum im PVS-Manager anbieten",
"lang_flatscreen": "Flatscreeen",
"lang_greenchair": "Gr\u00fcner Stuhl",
+ "lang_horizontal": "Horizontal",
"lang_labelBySearch": "Alle Rechner",
"lang_labelBySubnet": "Rechner im Subnetz",
"lang_lecturetheaterrow": "Stuhlreihe",
@@ -53,5 +59,6 @@
"lang_titleAddMachine": "Rechner hinzuf\u00fcgen",
"lang_titleBySearch": "Suche",
"lang_titleBySubnet": "Subnetz",
+ "lang_vertical": "Vertikal",
"lang_wastecan": "M\u00fclleimer"
} \ No newline at end of file
diff --git a/modules-available/serversetup-bwlp-ipxe/inc/bootentryhook.inc.php b/modules-available/serversetup-bwlp-ipxe/inc/bootentryhook.inc.php
index cf180006..73611b0a 100644
--- a/modules-available/serversetup-bwlp-ipxe/inc/bootentryhook.inc.php
+++ b/modules-available/serversetup-bwlp-ipxe/inc/bootentryhook.inc.php
@@ -26,6 +26,10 @@ abstract class BootEntryHook
*/
public abstract function extraFields();
+ /**
+ * @param string $id
+ * @return bool
+ */
public abstract function isValidId($id);
/**
@@ -63,16 +67,30 @@ abstract class BootEntryHook
return $this->getBootEntryInternal($data);
}
- public function setSelected($id)
+ /**
+ * @param string $mixed either the plain ID if the entry to be marked as selected, or the JSON string representing
+ * the entire entry, which must have a key called 'id' that will be used as the ID then.
+ */
+ public function setSelected($mixed)
{
- $json = @json_decode($id, true);
+ $json = @json_decode($mixed, true);
if (is_array($json)) {
$id = $json['id'];
$this->data = $json;
+ } else {
+ $id = $mixed;
}
$this->selectedId = $id;
}
+ /**
+ * @return string ID of entry that was marked as selected by setSelected()
+ */
+ public function getSelected()
+ {
+ return $this->selectedId;
+ }
+
public function renderExtraFields()
{
$list = $this->extraFields();
diff --git a/modules-available/serversetup-bwlp-ipxe/page.inc.php b/modules-available/serversetup-bwlp-ipxe/page.inc.php
index cc5fdbe5..a636665e 100644
--- a/modules-available/serversetup-bwlp-ipxe/page.inc.php
+++ b/modules-available/serversetup-bwlp-ipxe/page.inc.php
@@ -527,7 +527,7 @@ class Page_ServerSetup extends Page
if ($he->moduleId === $row['module']) {
$he->setSelected($row['data']);
$he->checked = 'checked';
- if ($he->getBootEntry($row['data']) === null) {
+ if (!$he->isValidId($he->getSelected())) {
Message::addError('invalid-custom-entry-id', $row['module'], $row['data']);
}
break;
@@ -848,8 +848,7 @@ class Page_ServerSetup extends Page
/** @var BootEntryHook $module */
$module = $hook->run();
$id = Request::post('selection-' . $type, false, 'string');
- $entry = $module->isValidId($id);
- if ($entry === null) {
+ if (!$module->isValidId($id)) {
Message::addError('invalid-custom-entry-id', $type, $id);
return;
}
diff --git a/modules-available/statistics/lang/de/template-tags.json b/modules-available/statistics/lang/de/template-tags.json
index 1a2a6513..68056a7a 100644
--- a/modules-available/statistics/lang/de/template-tags.json
+++ b/modules-available/statistics/lang/de/template-tags.json
@@ -82,6 +82,7 @@
"lang_reboot": "Neustart",
"lang_rebootConfirm": "Ausgew\u00e4hlte Rechner wirklich neustarten?",
"lang_rebootKexecCheck": "Schneller Reboot direkt in bwLehrpool (kexec)",
+ "lang_remoteExec": "Befehl Ausf\u00fchren...",
"lang_replace": "Ersetzen",
"lang_replaceInstructions": "Hier k\u00f6nnen Sie Metadaten automatisch \u00fcbertragen, wenn in einem Raum die Rechner ausgetauscht wurden. Dies setzt voraus, dass alle neuen Rechner die gleiche IP Adresse erhalten haben wie der Rechner, der zuvor am entsprechenden Platz stand, und die neuen Rechner alle einmal gestartet wurden. In der Liste unten sehen Sie alle Rechnerpaare, auf die folgendes zutrifft: 1) Die IP-Adressen sind identisch 2) Der letzte Boot des einen Rechners liegt vor dem ersten Boot des anderen Rechners. W\u00e4hlen Sie alle Rechnerpaare aus, f\u00fcr die eine Ersetzung stattfinden soll. Bei der Ersetzung werden alle Logeintr\u00e4ge, Sitzungslogs, Position im Raumplan und evtl. spezielle Betriebsmodi vom alten Rechner auf den neuen \u00dcbertragen.",
"lang_replaceMachinesHeading": "Rechner ersetzen",