From ce10ff7a848985f44e6c3c371f6075f67a8b7aeb Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 8 Feb 2018 15:05:58 +0100 Subject: [exams/roomplanner] Hybrid PVS managers become dedicated in exam mode Hopefully fixes #3066 --- modules-available/exams/baseconfig/getconfig.inc.php | 1 - 1 file changed, 1 deletion(-) (limited to 'modules-available/exams') diff --git a/modules-available/exams/baseconfig/getconfig.inc.php b/modules-available/exams/baseconfig/getconfig.inc.php index 37a2caf4..e5dd01c9 100644 --- a/modules-available/exams/baseconfig/getconfig.inc.php +++ b/modules-available/exams/baseconfig/getconfig.inc.php @@ -15,5 +15,4 @@ if (Exams::isInExamMode($locationIds, $lectureId, $autoLogin)) { ConfigHolder::add('SLX_AUTOLOGIN', $autoLogin, 10000); } ConfigHolder::add('SLX_SYSTEMD_TARGET', 'exam-mode', 10000); - ConfigHolder::add("SLX_PVS_HYBRID", false, 10000); } -- cgit v1.2.3-55-g7522 From 75df771501f5143b13fdc0b588338838c653c03c Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 8 Feb 2018 15:09:49 +0100 Subject: [exams] Fix table design --- modules-available/exams/templates/page-exams.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules-available/exams') diff --git a/modules-available/exams/templates/page-exams.html b/modules-available/exams/templates/page-exams.html index bb6cbd0a..201a5733 100644 --- a/modules-available/exams/templates/page-exams.html +++ b/modules-available/exams/templates/page-exams.html @@ -5,7 +5,7 @@
- +
-- cgit v1.2.3-55-g7522 From a8b0095b335780ae0bb950bc44021215d43a6b2d Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 12 Feb 2018 14:17:07 +0100 Subject: [permissionmanager] Introduce "location-aware" flag for permissions This flag tells wether the permission can be restricted to certain locations in a meaningful way. This flag has to be set in the permissions.json of the according module. For example, the permission to reboot the server cannot be limited to certain locations in a meaningful way, while the view of the client log can be filtered to only show log entries for clients in specific locations. --- .../backup/permissions/permissions.json | 12 +++-- .../permissions/permissions.json | 24 +++++++--- .../dozmod/permissions/permissions.json | 52 ++++++++++++++++------ .../eventlog/permissions/permissions.json | 8 ++-- .../exams/permissions/permissions.json | 13 +++--- .../internetaccess/permissions/permissions.json | 8 ++-- .../locations/permissions/permissions.json | 32 +++++++++---- .../minilinux/permissions/permissions.json | 12 +++-- .../news/permissions/permissions.json | 20 ++++++--- .../permissionmanager/inc/permissionutil.inc.php | 9 ++-- modules-available/permissionmanager/page.inc.php | 21 +++++---- modules-available/permissionmanager/style.css | 28 ++++++------ .../permissionmanager/templates/roleeditor.html | 42 +++++++---------- .../permissionmanager/templates/treenode.html | 23 +++++----- .../permissionmanager/templates/treepanel.html | 2 +- .../rebootcontrol/permissions/permissions.json | 16 ++++--- .../serversetup-bwlp/permissions/permissions.json | 16 ++++--- .../statistics/permissions/permissions.json | 16 ++++--- .../permissions/permissions.json | 36 ++++++++++----- .../syslog/permissions/permissions.json | 8 ++-- .../systemstatus/permissions/permissions.json | 48 ++++++++++++++------ .../vmstore/permissions/permissions.json | 16 ++++--- .../webinterface/permissions/permissions.json | 16 ++++--- 23 files changed, 309 insertions(+), 169 deletions(-) (limited to 'modules-available/exams') diff --git a/modules-available/backup/permissions/permissions.json b/modules-available/backup/permissions/permissions.json index feeffe33..1f778ab6 100644 --- a/modules-available/backup/permissions/permissions.json +++ b/modules-available/backup/permissions/permissions.json @@ -1,4 +1,8 @@ -[ - "create", - "restore" -] \ No newline at end of file +{ + "create": { + "location-aware": false + }, + "restore": { + "location-aware": false + } +} \ No newline at end of file diff --git a/modules-available/baseconfig_partitions_cdn/permissions/permissions.json b/modules-available/baseconfig_partitions_cdn/permissions/permissions.json index 286a975b..3acd5230 100644 --- a/modules-available/baseconfig_partitions_cdn/permissions/permissions.json +++ b/modules-available/baseconfig_partitions_cdn/permissions/permissions.json @@ -1,7 +1,17 @@ -[ - "show", - "partitions.add", - "partitions.delete", - "partitions.edit", - "partitions.reset" -] \ No newline at end of file +{ + "partitions.add": { + "location-aware": false + }, + "partitions.delete": { + "location-aware": false + }, + "partitions.edit": { + "location-aware": false + }, + "partitions.reset": { + "location-aware": false + }, + "show": { + "location-aware": false + } +} \ No newline at end of file diff --git a/modules-available/dozmod/permissions/permissions.json b/modules-available/dozmod/permissions/permissions.json index e8dfb558..b4ff034b 100644 --- a/modules-available/dozmod/permissions/permissions.json +++ b/modules-available/dozmod/permissions/permissions.json @@ -1,14 +1,38 @@ -[ - "images.delete", - "mail.save", - "mail.testmail", - "runtimeconfig.save", - "templates.save", - "templates.reset", - "users.setmail", - "users.setlogin", - "users.setsu", - "users.orglogin", - "log.showuser", - "log.showtarget" -] \ No newline at end of file +{ + "images.delete": { + "location-aware": false + }, + "log.showtarget": { + "location-aware": false + }, + "log.showuser": { + "location-aware": false + }, + "mail.save": { + "location-aware": false + }, + "mail.testmail": { + "location-aware": false + }, + "runtimeconfig.save": { + "location-aware": false + }, + "templates.reset": { + "location-aware": false + }, + "templates.save": { + "location-aware": false + }, + "users.orglogin": { + "location-aware": false + }, + "users.setlogin": { + "location-aware": false + }, + "users.setmail": { + "location-aware": false + }, + "users.setsu": { + "location-aware": false + } +} \ No newline at end of file diff --git a/modules-available/eventlog/permissions/permissions.json b/modules-available/eventlog/permissions/permissions.json index f04ea714..a1748957 100644 --- a/modules-available/eventlog/permissions/permissions.json +++ b/modules-available/eventlog/permissions/permissions.json @@ -1,3 +1,5 @@ -[ - "view" -] \ No newline at end of file +{ + "view": { + "location-aware": false + } +} \ No newline at end of file diff --git a/modules-available/exams/permissions/permissions.json b/modules-available/exams/permissions/permissions.json index 215b3399..e44974b6 100644 --- a/modules-available/exams/permissions/permissions.json +++ b/modules-available/exams/permissions/permissions.json @@ -1,5 +1,8 @@ -[ - "exams.add", - "exams.delete", - "exams.edit" -] \ No newline at end of file +{ + "exams.edit": { + "location-aware": true + }, + "exams.view": { + "location-aware": true + } +} \ No newline at end of file diff --git a/modules-available/internetaccess/permissions/permissions.json b/modules-available/internetaccess/permissions/permissions.json index 67998da7..09652e51 100644 --- a/modules-available/internetaccess/permissions/permissions.json +++ b/modules-available/internetaccess/permissions/permissions.json @@ -1,3 +1,5 @@ -[ - "configuration.safe" -] \ No newline at end of file +{ + "configuration.safe": { + "location-aware": false + } +} \ No newline at end of file diff --git a/modules-available/locations/permissions/permissions.json b/modules-available/locations/permissions/permissions.json index 609a673a..06b01d2c 100644 --- a/modules-available/locations/permissions/permissions.json +++ b/modules-available/locations/permissions/permissions.json @@ -1,9 +1,23 @@ -[ - "location.view", - "location.edit", - "location.add", - "location.delete", - "subnet.edit", - "subnet.add", - "subnet.delete" -] \ No newline at end of file +{ + "location.add": { + "location-aware": false + }, + "location.delete": { + "location-aware": false + }, + "location.edit": { + "location-aware": false + }, + "location.view": { + "location-aware": false + }, + "subnet.add": { + "location-aware": false + }, + "subnet.delete": { + "location-aware": false + }, + "subnet.edit": { + "location-aware": false + } +} \ No newline at end of file diff --git a/modules-available/minilinux/permissions/permissions.json b/modules-available/minilinux/permissions/permissions.json index 457d9810..650f7e71 100644 --- a/modules-available/minilinux/permissions/permissions.json +++ b/modules-available/minilinux/permissions/permissions.json @@ -1,4 +1,8 @@ -[ - "show", - "update" -] \ No newline at end of file +{ + "show": { + "location-aware": false + }, + "update": { + "location-aware": false + } +} \ No newline at end of file diff --git a/modules-available/news/permissions/permissions.json b/modules-available/news/permissions/permissions.json index 321e73ea..0d9435d7 100644 --- a/modules-available/news/permissions/permissions.json +++ b/modules-available/news/permissions/permissions.json @@ -1,6 +1,14 @@ -[ - "news.save", - "news.delete", - "help.save", - "help.delete" -] \ No newline at end of file +{ + "help.delete": { + "location-aware": false + }, + "help.save": { + "location-aware": false + }, + "news.delete": { + "location-aware": false + }, + "news.save": { + "location-aware": false + } +} \ No newline at end of file diff --git a/modules-available/permissionmanager/inc/permissionutil.inc.php b/modules-available/permissionmanager/inc/permissionutil.inc.php index 5ff41046..3daf422e 100644 --- a/modules-available/permissionmanager/inc/permissionutil.inc.php +++ b/modules-available/permissionmanager/inc/permissionutil.inc.php @@ -100,9 +100,9 @@ class PermissionUtil if (!is_array($data)) continue; preg_match('#^modules/([^/]+)/#', $file, $out); - foreach( $data as $p ) { + foreach( $data as $p => $data) { $description = Dictionary::translateFileModule($out[1], "permissions", $p); - self::putInPermissionTree($out[1].".".$p, $description, $permissions); + self::putInPermissionTree($out[1].".".$p, $data['location-aware'], $description, $permissions); } } ksort($permissions); @@ -120,10 +120,11 @@ class PermissionUtil * Place a permission into the given permission tree. * * @param string $permission the permission to place in the tree + * @param bool $locationAware whether this permissions can be restricted to specific locations only * @param string $description the description of the permission * @param array $tree the permission tree to modify */ - private static function putInPermissionTree($permission, $description, &$tree) + private static function putInPermissionTree($permission, $locationAware, $description, &$tree) { $subPermissions = explode('.', $permission); foreach ($subPermissions as $subPermission) { @@ -134,6 +135,6 @@ class PermissionUtil $tree =& $tree[$subPermission]; } } - $tree = $description; + $tree = array('description' => $description, 'location-aware' => $locationAware, 'isLeaf' => true); } } \ No newline at end of file diff --git a/modules-available/permissionmanager/page.inc.php b/modules-available/permissionmanager/page.inc.php index 13d81c6a..bb8482af 100644 --- a/modules-available/permissionmanager/page.inc.php +++ b/modules-available/permissionmanager/page.inc.php @@ -100,18 +100,21 @@ class Page_PermissionManager extends Page $toplevel = $permString == ""; if ($toplevel && in_array("*", $selectedPermissions)) $selectAll = true; foreach ($permissions as $k => $v) { - $leaf = !is_array($v); + $leaf = isset($v['isLeaf']) && $v['isLeaf']; $nextPermString = $permString ? $permString.".".$k : $k; $id = $leaf ? $nextPermString : $nextPermString.".*"; $selected = $selectAll || in_array($id, $selectedPermissions); - $res .= Render::parse("treenode", - array("id" => $id, - "name" => $toplevel ? Module::get($k)->getDisplayName() : $k, - "toplevel" => $toplevel, - "checkboxname" => "permissions", - "selected" => $selected, - "HTML" => $leaf ? "" : self::generatePermissionHTML($v, $selectedPermissions, $selected, $nextPermString), - "description" => $leaf ? $v : "")); + $data = array("id" => $id, + "name" => $toplevel ? Module::get($k)->getDisplayName() : $k, + "toplevel" => $toplevel, + "checkboxname" => "permissions", + "selected" => $selected, + "HTML" => $leaf ? "" : self::generatePermissionHTML($v, $selectedPermissions, $selected, $nextPermString), + ); + if ($leaf) { + $data += $v; + } + $res .= Render::parse("treenode", $data); } if ($toplevel) { $res = Render::parse("treepanel", diff --git a/modules-available/permissionmanager/style.css b/modules-available/permissionmanager/style.css index 49d631a8..9c39af64 100644 --- a/modules-available/permissionmanager/style.css +++ b/modules-available/permissionmanager/style.css @@ -55,28 +55,28 @@ background-color: rgba(0, 182, 41, 0.23); } -.tree-container { - -moz-column-gap: 20px; - -webkit-column-gap: 20px; - column-gap: 20px; -} - - .tree-container > ul { display: inline-block; width: 100%; padding: 0; } -@media (max-width: 767px) { - .tree-container { - -moz-column-count: 1; - -webkit-column-count: 1; - column-count: 1; - } +.tree-container > ul > li > div > label { + font-weight: bold; +} + +.tree-container { + -moz-column-gap: 20px; + -webkit-column-gap: 20px; + column-gap: 20px; + -moz-column-count: 1; + -webkit-column-count: 1; + column-count: 1; + padding-left: 20px; + padding-right: 20px; } -@media (min-width: 768px) and (max-width: 991px) { +@media (min-width: 768px) { .tree-container { -moz-column-count: 2; -webkit-column-count: 2; diff --git a/modules-available/permissionmanager/templates/roleeditor.html b/modules-available/permissionmanager/templates/roleeditor.html index 871fd0cc..eadce027 100644 --- a/modules-available/permissionmanager/templates/roleeditor.html +++ b/modules-available/permissionmanager/templates/roleeditor.html @@ -4,32 +4,24 @@ -
-
- + +
+
+ {{{permissionHTML}}}
-
-
-
-
-
- {{{permissionHTML}}} -
-
- {{{locationHTML}}} -
-
+
+ {{{locationHTML}}}
diff --git a/modules-available/permissionmanager/templates/treenode.html b/modules-available/permissionmanager/templates/treenode.html index ced973ca..43509237 100644 --- a/modules-available/permissionmanager/templates/treenode.html +++ b/modules-available/permissionmanager/templates/treenode.html @@ -1,11 +1,14 @@ {{#toplevel}}
    {{/toplevel}} -
  • -
    - - -
    -
      - {{{HTML}}} -
    -
  • -{{#toplevel}}
{{/toplevel}} +
  • +
    + + +
    +
      + {{{HTML}}} +
    +
  • +{{#toplevel}}{{/toplevel}} \ No newline at end of file diff --git a/modules-available/permissionmanager/templates/treepanel.html b/modules-available/permissionmanager/templates/treepanel.html index 6f358825..8b510407 100644 --- a/modules-available/permissionmanager/templates/treepanel.html +++ b/modules-available/permissionmanager/templates/treepanel.html @@ -6,7 +6,7 @@
    -
    +
    {{{HTML}}}
    diff --git a/modules-available/rebootcontrol/permissions/permissions.json b/modules-available/rebootcontrol/permissions/permissions.json index 5230c9bd..5de9b633 100644 --- a/modules-available/rebootcontrol/permissions/permissions.json +++ b/modules-available/rebootcontrol/permissions/permissions.json @@ -1,5 +1,11 @@ -[ - "shutdown", - "reboot", - "newkeypair" -] \ No newline at end of file +{ + "newkeypair": { + "location-aware": false + }, + "reboot": { + "location-aware": true + }, + "shutdown": { + "location-aware": true + } +} \ No newline at end of file diff --git a/modules-available/serversetup-bwlp/permissions/permissions.json b/modules-available/serversetup-bwlp/permissions/permissions.json index 2166cf8e..6bae5422 100644 --- a/modules-available/serversetup-bwlp/permissions/permissions.json +++ b/modules-available/serversetup-bwlp/permissions/permissions.json @@ -1,5 +1,11 @@ -[ - "edit.address", - "edit.menu", - "download" -] \ No newline at end of file +{ + "download": { + "location-aware": false + }, + "edit.address": { + "location-aware": false + }, + "edit.menu": { + "location-aware": false + } +} \ No newline at end of file diff --git a/modules-available/statistics/permissions/permissions.json b/modules-available/statistics/permissions/permissions.json index 97a49036..c9dca9f3 100644 --- a/modules-available/statistics/permissions/permissions.json +++ b/modules-available/statistics/permissions/permissions.json @@ -1,5 +1,11 @@ -[ - "view", - "note", - "delete" -] \ No newline at end of file +{ + "machine.delete": { + "location-aware": true + }, + "machine.note": { + "location-aware": true + }, + "machine.view": { + "location-aware": true + } +} \ No newline at end of file diff --git a/modules-available/statistics_reporting/permissions/permissions.json b/modules-available/statistics_reporting/permissions/permissions.json index d967b75d..1244027e 100644 --- a/modules-available/statistics_reporting/permissions/permissions.json +++ b/modules-available/statistics_reporting/permissions/permissions.json @@ -1,10 +1,26 @@ -[ - "table.view.total", - "table.view.location", - "table.view.client", - "table.view.user", - "table.view.vm", - "table.export", - "reporting.download", - "reporting.change" -] \ No newline at end of file +{ + "reporting.change": { + "location-aware": false + }, + "reporting.download": { + "location-aware": false + }, + "table.export": { + "location-aware": false + }, + "table.view.client": { + "location-aware": true + }, + "table.view.location": { + "location-aware": true + }, + "table.view.total": { + "location-aware": false + }, + "table.view.user": { + "location-aware": false + }, + "table.view.vm": { + "location-aware": false + } +} \ No newline at end of file diff --git a/modules-available/syslog/permissions/permissions.json b/modules-available/syslog/permissions/permissions.json index f04ea714..fcf530c5 100644 --- a/modules-available/syslog/permissions/permissions.json +++ b/modules-available/syslog/permissions/permissions.json @@ -1,3 +1,5 @@ -[ - "view" -] \ No newline at end of file +{ + "view": { + "location-aware": true + } +} \ No newline at end of file diff --git a/modules-available/systemstatus/permissions/permissions.json b/modules-available/systemstatus/permissions/permissions.json index 0333564b..8324f708 100644 --- a/modules-available/systemstatus/permissions/permissions.json +++ b/modules-available/systemstatus/permissions/permissions.json @@ -1,13 +1,35 @@ -[ - "show.overview.diskstat", - "show.overview.services", - "show.overview.adresses", - "show.overview.systeminfo", - "show.overview.dmsdusers", - "show.logs.bwlpserver", - "show.logs.netstat", - "show.logs.pslist", - "show.logs.ldapad", - "show.logs.lighttpd", - "serverreboot" -] \ No newline at end of file +{ + "serverreboot": { + "location-aware": false + }, + "show.logs.bwlpserver": { + "location-aware": false + }, + "show.logs.ldapad": { + "location-aware": false + }, + "show.logs.lighttpd": { + "location-aware": false + }, + "show.logs.netstat": { + "location-aware": false + }, + "show.logs.pslist": { + "location-aware": false + }, + "show.overview.adresses": { + "location-aware": false + }, + "show.overview.diskstat": { + "location-aware": false + }, + "show.overview.dmsdusers": { + "location-aware": false + }, + "show.overview.services": { + "location-aware": false + }, + "show.overview.systeminfo": { + "location-aware": false + } +} \ No newline at end of file diff --git a/modules-available/vmstore/permissions/permissions.json b/modules-available/vmstore/permissions/permissions.json index f2c22c72..29ee6a51 100644 --- a/modules-available/vmstore/permissions/permissions.json +++ b/modules-available/vmstore/permissions/permissions.json @@ -1,5 +1,11 @@ -[ - "choose.internal", - "choose.nfs", - "choose.cifs" -] \ No newline at end of file +{ + "choose.cifs": { + "location-aware": false + }, + "choose.internal": { + "location-aware": false + }, + "choose.nfs": { + "location-aware": false + } +} \ No newline at end of file diff --git a/modules-available/webinterface/permissions/permissions.json b/modules-available/webinterface/permissions/permissions.json index 45b5395d..fa6f493f 100644 --- a/modules-available/webinterface/permissions/permissions.json +++ b/modules-available/webinterface/permissions/permissions.json @@ -1,5 +1,11 @@ -[ - "edit.https", - "edit.password", - "edit.design" -] \ No newline at end of file +{ + "edit.design": { + "location-aware": false + }, + "edit.https": { + "location-aware": false + }, + "edit.password": { + "location-aware": false + } +} \ No newline at end of file -- cgit v1.2.3-55-g7522 From 87e6bcd37681eb175ca4926774550e199bd487a0 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 12 Feb 2018 18:10:02 +0100 Subject: [exams] Simplify permissions, add some error messages --- modules-available/exams/lang/de/permissions.json | 7 +- modules-available/exams/lang/en/permissions.json | 7 +- modules-available/exams/page.inc.php | 297 ++++++++++------------ modules-available/exams/templates/page-exams.html | 6 +- 4 files changed, 145 insertions(+), 172 deletions(-) (limited to 'modules-available/exams') diff --git a/modules-available/exams/lang/de/permissions.json b/modules-available/exams/lang/de/permissions.json index 3ead6249..b61be9a0 100644 --- a/modules-available/exams/lang/de/permissions.json +++ b/modules-available/exams/lang/de/permissions.json @@ -1,5 +1,4 @@ { - "exams.add": "Neues Examen hinzufügen.", - "exams.delete": "Examen löschen.", - "exams.edit": "Examen bearbeiten." -} \ No newline at end of file + "exams.view": "Geplante Prüfungen sehen.", + "exams.edit": "Prüfungen anlegen/editieren/löschen." +} diff --git a/modules-available/exams/lang/en/permissions.json b/modules-available/exams/lang/en/permissions.json index 3e14a761..70326fa9 100644 --- a/modules-available/exams/lang/en/permissions.json +++ b/modules-available/exams/lang/en/permissions.json @@ -1,5 +1,4 @@ { - "exams.add": "Add new exam.", - "exams.delete": "Delete exam.", - "exams.edit": "Edit exam." -} \ No newline at end of file + "exams.view": "View scheduled exams.", + "exams.edit": "Add/delete/edit exams." +} diff --git a/modules-available/exams/page.inc.php b/modules-available/exams/page.inc.php index b32f758c..51975052 100644 --- a/modules-available/exams/page.inc.php +++ b/modules-available/exams/page.inc.php @@ -10,9 +10,7 @@ class Page_Exams extends Page private $rangeMin; private $rangeMax; private $userEditLocations = []; - private $userDeleteLocations = []; - private $userAddLocations = []; - private $allowedLocations = []; + private $userViewLocations = []; /** if examid is set, also add a column 'selected' **/ @@ -43,29 +41,37 @@ class Page_Exams extends Page . "ORDER BY examid ASC"); while ($exam = $tmp->fetch(PDO::FETCH_ASSOC)) { - // check if allowed to edit this exam - if ($this->allowedToEdit($exam['examid'])) { - $exam['allowedEdit'] = True; + $view = $edit = false; + // User has permission for all locations + if (in_array(0, $this->userViewLocations)) { + $view = true; } - // check if allowed to delete this exam - if ($this->allowedToDelete($exam['examid'])) { - $exam['allowedDelete'] = True; + if (in_array(0, $this->userEditLocations)) { + $edit = true; } - - - $locationids = explode(',', $exam['locationids']); - // if global permission, add all exams to the list, no filter required - if ($locationids[0] == 0) { + if ($view && $edit) { $this->exams[] = $exam; + continue; + } + // Fine grained check by locations + if ($exam['locationids'] === null) { + $locationids = [0]; } else { - foreach($locationids as $locid) { - // only add the exam if permisson for atleast one of the exam locations - if (in_array($locid, $this->allowedLocations)) { - $this->exams[] = $exam; - break; - } - } + $locationids = explode(',', $exam['locationids']); + } + if (!$view && empty(array_intersect($locationids, $this->userViewLocations))) { + // Not a single location in common, skip + continue; + } + if (!$edit && $this->userCanEditLocation($locationids)) { + // Only allow edit if user can edit all the locations the exam is assigned to + $edit = true; + } + // Set disabled string + if (!$edit) { + $exam['edit']['disabled'] = 'disabled'; } + $this->exams[] = $exam; } } @@ -86,65 +92,34 @@ class Page_Exams extends Page } } - // Returns the list of locations of the exam - protected function getExamLocations($examid) { - $res = Database::simpleQuery("SELECT locationid FROM exams_x_location WHERE examid= :examid", array('examid' => $examid)); - return $res; - } - // Initialise the user-permission-based lists - protected function setUserLocations() { - + protected function setUserLocations() + { // all locations the user has permission to edit $this->userEditLocations = User::getAllowedLocations("exams.edit"); - // all locations the user has permission to delete - $this->userDeleteLocations = User::getAllowedLocations("exams.delete"); - // all locations the user has permission to add - $this->userAddLocations = User::getAllowedLocations("exams.add"); - // all locations the user has at least one of the 3 permissions - $this->allowedLocations = array_unique(array_merge($this->userAddLocations, $this->userEditLocations, $this->userDeleteLocations)); - } - - // returns true if user is allowed to delete the exam - protected function allowedToDelete($examid) { - - $res = $this->getExamLocations($examid); - $locations = []; - while ($locId = $res->fetch(PDO::FETCH_ASSOC)) { - $locations[] = $locId['locationid']; - } - - return empty(array_diff($locations, $this->userDeleteLocations)); - - } - - // returns true if user is allowed to add an exam - protected function allowedToAdd() { - return User::hasPermission("exams.add"); + $view = User::getAllowedLocations("exams.view"); + // all locations the user can view or edit + $this->userViewLocations = array_unique(array_merge($this->userEditLocations, $view)); } // returns true if user is allowed to edit the exam - protected function allowedToEdit($examid) { - - $res = $this->getExamLocations($examid); - $locations = []; + protected function userCanEditExam($examid = NULL) + { + if ($examid === null) + return User::hasPermission('exams.edit'); + // Check locations of existing exam + $res = Database::simpleQuery("SELECT locationid FROM exams_x_location WHERE examid= :examid", array('examid' => $examid)); while ($locId = $res->fetch(PDO::FETCH_ASSOC)) { - $locations[] = $locId['locationid']; + if (!in_array($locId['locationid'], $this->userEditLocations)) + return false; } - - return empty(array_diff($locations, $this->userEditLocations)); - + return true; } // checks if user is allowed to save an exam with all the locations // needs information if it's add (second para = true) or edit (second para = false) - protected function allowedToSave($locationids, $isAdd) { - - if ($isAdd) { - return empty(array_diff($locationids, $this->userAddLocations)); - } else { - return empty(array_diff($locationids, $this->userEditLocations)); - } + protected function userCanEditLocation($locationids) { + return empty(array_diff($locationids, $this->userEditLocations)); } protected function makeItemsForVis() @@ -225,7 +200,7 @@ class Page_Exams extends Page $out = []; foreach ($this->locations as $l) { - if (in_array($l["locationid"], $this->allowedLocations)) { + if (in_array($l["locationid"], $this->userViewLocations)) { $out[] = [ 'id' => $l['locationid'], 'content' => $l['locationpad'] . ' ' . $l['locationname'], @@ -315,6 +290,11 @@ class Page_Exams extends Page $locationids[] = 0; } + if (!$this->userCanEditLocation($locationids)) { + Message::addError('main.no-permission'); + Util::redirect('?do=exams'); + } + $examid = Request::post('examid', 0, 'int'); $starttime = strtotime(Request::post('starttime_date') . " " . Request::post('starttime_time')); $endtime = strtotime(Request::post('endtime_date') . " " . Request::post('endtime_time')); @@ -336,45 +316,41 @@ class Page_Exams extends Page if ($examid === 0) { // No examid given, is add - if ($this->allowedToSave($locationids, True)) { - $res = Database::exec("INSERT INTO exams(lectureid, starttime, endtime, autologin, description) VALUES(:lectureid, :starttime, :endtime, :autologin, :description);", - compact('lectureid', 'starttime', 'endtime', 'autologin', 'description')) !== false; + $res = Database::exec("INSERT INTO exams(lectureid, starttime, endtime, autologin, description) VALUES(:lectureid, :starttime, :endtime, :autologin, :description);", + compact('lectureid', 'starttime', 'endtime', 'autologin', 'description')) !== false; - $exam_id = Database::lastInsertId(); - foreach ($locationids as $lid) { - $res = $res && Database::exec("INSERT INTO exams_x_location(examid, locationid) VALUES(:exam_id, :lid)", compact('exam_id', 'lid')) !== false; - } - if ($res === false) { - Message::addError('exam-not-added'); - } else { - Message::addInfo('exam-added-success'); - } + $exam_id = Database::lastInsertId(); + foreach ($locationids as $lid) { + $res = $res && Database::exec("INSERT INTO exams_x_location(examid, locationid) VALUES(:exam_id, :lid)", compact('exam_id', 'lid')) !== false; + } + if ($res === false) { + Message::addError('exam-not-added'); + } else { + Message::addInfo('exam-added-success'); } Util::redirect('?do=exams'); } // Edit - if ($this->allowedToSave($locationids, False)) { - $this->currentExam = Database::queryFirst("SELECT * FROM exams WHERE examid = :examid", array('examid' => $examid)); - if ($this->currentExam === false) { - Message::addError('invalid-exam-id', $examid); - Util::redirect('?do=exams'); - } + $this->currentExam = Database::queryFirst("SELECT * FROM exams WHERE examid = :examid", array('examid' => $examid)); + if ($this->currentExam === false) { + Message::addError('invalid-exam-id', $examid); + Util::redirect('?do=exams'); + } - /* update fields */ - $res = Database::exec("UPDATE exams SET lectureid = :lectureid, starttime = :starttime, endtime = :endtime, autologin = :autologin, description = :description WHERE examid = :examid", - compact('lectureid', 'starttime', 'endtime', 'description', 'examid', 'autologin')) !== false; - /* drop all connections and reconnect to rooms */ - $res = $res && Database::exec("DELETE FROM exams_x_location WHERE examid = :examid", compact('examid')) !== false; - /* reconnect */ - foreach ($locationids as $lid) { - $res = $res && Database::exec("INSERT INTO exams_x_location(examid, locationid) VALUES(:examid, :lid)", compact('examid', 'lid')) !== false; - } - if ($res !== false) { - Message::addInfo("changes-successfully-saved"); - } else { - Message::addError("error-while-saving-changes"); - } + /* update fields */ + $res = Database::exec("UPDATE exams SET lectureid = :lectureid, starttime = :starttime, endtime = :endtime, autologin = :autologin, description = :description WHERE examid = :examid", + compact('lectureid', 'starttime', 'endtime', 'description', 'examid', 'autologin')) !== false; + /* drop all connections and reconnect to rooms */ + $res = $res && Database::exec("DELETE FROM exams_x_location WHERE examid = :examid", compact('examid')) !== false; + /* reconnect */ + foreach ($locationids as $lid) { + $res = $res && Database::exec("INSERT INTO exams_x_location(examid, locationid) VALUES(:examid, :lid)", compact('examid', 'lid')) !== false; + } + if ($res !== false) { + Message::addInfo("changes-successfully-saved"); + } else { + Message::addError("error-while-saving-changes"); } Util::redirect('?do=exams'); } @@ -408,28 +384,29 @@ class Page_Exams extends Page $this->setUserLocations(); if ($this->action === 'show') { + $this->readExams(); $this->readLocations(); $this->readLectures(); } elseif ($this->action === 'add') { - if($this->allowedToAdd()) { - $this->readLectures(); - } + User::assertPermission('exams.edit'); + $this->readLectures(); } elseif ($this->action === 'edit') { - if($this->allowedToEdit($examid)) { - $this->currentExam = Database::queryFirst("SELECT * FROM exams WHERE examid = :examid", array('examid' => $examid)); - if ($this->currentExam === false) { - Message::addError('invalid-exam-id', $examid); - Util::redirect('?do=exams'); - } - $this->readLocations($examid); - $this->readLectures(); - + if (!$this->userCanEditExam($examid)) { + Message::addError('main.no-permission'); + Util::redirect('?do=exams'); + } + $this->currentExam = Database::queryFirst("SELECT * FROM exams WHERE examid = :examid", array('examid' => $examid)); + if ($this->currentExam === false) { + Message::addError('invalid-exam-id', $examid); + Util::redirect('?do=exams'); } + $this->readLocations($examid); + $this->readLectures(); } elseif ($this->action === 'save') { @@ -441,7 +418,9 @@ class Page_Exams extends Page die('delete only works with a post request'); } - if ($this->allowedToDelete($examid)) { + if (!$this->userCanEditExam($examid)) { + Message::addError('main.no-permission'); + } else { $res1 = Database::exec("DELETE FROM exams WHERE examid = :examid;", compact('examid')); $res2 = Database::exec("DELETE FROM exams_x_location WHERE examid = :examid;", compact('examid')); if ($res1 === false || $res2 === false) { @@ -475,10 +454,9 @@ class Page_Exams extends Page // General title and description Render::addTemplate('page-main-heading'); // List of defined exam periods - Render::addTemplate('page-exams', [ - 'exams' => $this->makeExamsForTemplate(), - 'allowedToAdd' => $this->allowedToAdd() - ]); + $params = ['exams' => $this->makeExamsForTemplate()]; + Permission::addGlobalTags($params['perms'], NULL, ['exams.edit']); + Render::addTemplate('page-exams', $params); // List of upcoming lectures marked as exam $upcoming = $this->makeLectureExamList(); if (empty($upcoming)) { @@ -486,7 +464,7 @@ class Page_Exams extends Page } else { Render::addTemplate('page-upcoming-lectures', [ 'pending_lectures' => $upcoming, - 'allowedToAdd' => $this->allowedToAdd(), + 'allowedToEdit' => $this->userCanEditExam(), 'decollapse' => array_key_exists('class', end($upcoming)) ]); } @@ -504,62 +482,59 @@ class Page_Exams extends Page } elseif ($this->action === "add") { - if($this->allowedToAdd()) { - Render::setTitle(Dictionary::translate('title_add-exam')); - $data = []; - $baseLecture = Request::any('lectureid', false, 'string'); - $locations = null; - if ($baseLecture !== false) { - foreach ($this->lectures as &$lecture) { - if ($lecture['lectureid'] === $baseLecture) { - $data['exam'] = $this->makeEditFromArray($lecture); - $locations = explode(',', $lecture['lids']); - $lecture['selected'] = 'selected'; - break; - } + Render::setTitle(Dictionary::translate('title_add-exam')); + $data = []; + $baseLecture = Request::any('lectureid', false, 'string'); + $locations = null; + if ($baseLecture !== false) { + foreach ($this->lectures as &$lecture) { + if ($lecture['lectureid'] === $baseLecture) { + $data['exam'] = $this->makeEditFromArray($lecture); + $locations = explode(',', $lecture['lids']); + $lecture['selected'] = 'selected'; + break; } - unset($lecture); } + unset($lecture); + } - $this->readLocations($locations); - $data['lectures'] = $this->lectures; - $data['locations'] = $this->locations; + $this->readLocations($locations); + $data['lectures'] = $this->lectures; + $data['locations'] = $this->locations; - // if user has no permission to add for this location, disable the location in the select - foreach ($data['locations'] as &$loc) { - if (!in_array($loc["locationid"], $this->userAddLocations)) { - $loc["disabled"] = "disabled"; - } + // if user has no permission to add for this location, disable the location in the select + foreach ($data['locations'] as &$loc) { + if (!in_array($loc["locationid"], $this->userEditLocations)) { + $loc["disabled"] = "disabled"; } - - Render::addTemplate('page-add-edit-exam', $data); } + Render::addTemplate('page-add-edit-exam', $data); + } elseif ($this->action === 'edit') { - if ($this->allowedToEdit($examid)) { - Render::setTitle(Dictionary::translate('title_edit-exam')); - $exam = $this->makeEditFromArray($this->currentExam); - foreach ($this->lectures as &$lecture) { - if ($lecture['lectureid'] === $this->currentExam['lectureid']) { - $lecture['selected'] = 'selected'; - } + Render::setTitle(Dictionary::translate('title_edit-exam')); + $exam = $this->makeEditFromArray($this->currentExam); + foreach ($this->lectures as &$lecture) { + if ($lecture['lectureid'] === $this->currentExam['lectureid']) { + $lecture['selected'] = 'selected'; } + } - $data = []; - $data['exam'] = $exam; - $data['locations'] = $this->locations; - $data['lectures'] = $this->lectures; + $data = []; + $data['exam'] = $exam; + $data['locations'] = $this->locations; + $data['lectures'] = $this->lectures; - // if user has no permission to edit for this location, disable the location in the select - foreach ($data['locations'] as &$loc) { - if (!in_array($loc["locationid"], $this->userEditLocations)) { - $loc["disabled"] = "disabled"; - } + // if user has no permission to edit for this location, disable the location in the select + foreach ($data['locations'] as &$loc) { + if (!in_array($loc["locationid"], $this->userEditLocations)) { + $loc["disabled"] = "disabled"; } - - Render::addTemplate('page-add-edit-exam', $data); } + + Render::addTemplate('page-add-edit-exam', $data); + } } diff --git a/modules-available/exams/templates/page-exams.html b/modules-available/exams/templates/page-exams.html index 201a5733..df6a7dc9 100644 --- a/modules-available/exams/templates/page-exams.html +++ b/modules-available/exams/templates/page-exams.html @@ -43,9 +43,9 @@ {{^liesInPast}} {{/liesInPast}} - + - +
    @@ -55,7 +55,7 @@ -- cgit v1.2.3-55-g7522 From 24815e16087b4b1b64e9f380d45d411af32daf42 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 9 Apr 2018 16:56:04 +0200 Subject: Permissions: Consistency: Make all pages require at least one permission to be accessible Closes #3340 --- modules-available/backup/page.inc.php | 1 + modules-available/exams/page.inc.php | 9 +-------- modules-available/locations/page.inc.php | 19 +++++++++++++++---- modules-available/news/page.inc.php | 10 ++-------- modules-available/news/permissions/permissions.json | 3 +++ modules-available/rebootcontrol/page.inc.php | 9 ++++++--- modules-available/serversetup-bwlp/page.inc.php | 6 ++++++ .../serversetup-bwlp/permissions/permissions.json | 3 +++ modules-available/statistics_reporting/page.inc.php | 1 + modules-available/sysconfig/page.inc.php | 2 +- modules-available/syslog/page.inc.php | 1 + modules-available/systemstatus/page.inc.php | 1 + modules-available/webinterface/page.inc.php | 4 ++++ .../webinterface/permissions/permissions.json | 3 +++ 14 files changed, 48 insertions(+), 24 deletions(-) (limited to 'modules-available/exams') diff --git a/modules-available/backup/page.inc.php b/modules-available/backup/page.inc.php index 14522734..985f39ee 100644 --- a/modules-available/backup/page.inc.php +++ b/modules-available/backup/page.inc.php @@ -23,6 +23,7 @@ class Page_Backup extends Page User::assertPermission("restore"); $this->restore(); } + User::assertPermission('*'); } protected function doRender() diff --git a/modules-available/exams/page.inc.php b/modules-available/exams/page.inc.php index 51975052..15640a73 100644 --- a/modules-available/exams/page.inc.php +++ b/modules-available/exams/page.inc.php @@ -441,16 +441,9 @@ class Page_Exams extends Page protected function doRender() { - if (Request::isPost()) { - $examid = Request::post('examid', 0, 'int'); - } else if (Request::isGet()) { - $examid = Request::get('examid', 0, 'int'); - } else { - die('Neither Post nor Get Request send.'); - } - if ($this->action === "show") { + User::assertPermission('exams.view'); // General title and description Render::addTemplate('page-main-heading'); // List of defined exam periods diff --git a/modules-available/locations/page.inc.php b/modules-available/locations/page.inc.php index 80a8076b..4d5c6628 100644 --- a/modules-available/locations/page.inc.php +++ b/modules-available/locations/page.inc.php @@ -24,6 +24,9 @@ class Page_Locations extends Page } elseif ($this->action === 'updatesubnets') { $this->updateSubnets(); } + if (Request::isPost()) { + Util::redirect('?do=locations'); + } } private function updateSubnets() @@ -306,10 +309,16 @@ class Page_Locations extends Page protected function doRender() { - $getAction = Request::get('action'); - if (empty($getAction)) { - // Until we have a main landing page? - Util::redirect('?do=Locations&action=showlocations'); + $getAction = Request::get('action', false, 'string'); + if ($getAction === false) { + if (User::hasPermission('location.view')) { + Util::redirect('?do=locations&action=showlocations'); + } elseif (User::hasPermission('subnets.edit')) { + Util::redirect('?do=locations&action=showsubnets'); + } else { + // Trigger permission denied by asserting non-existent permission + User::assertPermission('location.view'); + } } if ($getAction === 'showsubnets') { User::assertPermission('subnets.edit', NULL, '?do=locations'); @@ -324,6 +333,8 @@ class Page_Locations extends Page Render::addTemplate('subnets', array('list' => $rows)); } elseif ($getAction === 'showlocations') { $this->showLocationList(); + } else { + Util::redirect('?do=locations'); } } diff --git a/modules-available/news/page.inc.php b/modules-available/news/page.inc.php index e7b70c0f..1e2e3eef 100644 --- a/modules-available/news/page.inc.php +++ b/modules-available/news/page.inc.php @@ -46,14 +46,8 @@ class Page_News extends Page // check which action we need to do $action = Request::any('action', 'show'); - if ($action === 'clear') { - // clear news input fields - // TODO: is this the right way? - $this->newsId = false; - $this->newsTitle = false; - $this->newsContent = false; - $this->newsDate = false; - } elseif ($action === 'show') { + if ($action === 'show') { + User::assertPermission('access-page'); /* load latest things */ $this->loadLatest('help'); $this->loadLatest('news'); diff --git a/modules-available/news/permissions/permissions.json b/modules-available/news/permissions/permissions.json index 0d9435d7..953599df 100644 --- a/modules-available/news/permissions/permissions.json +++ b/modules-available/news/permissions/permissions.json @@ -1,4 +1,7 @@ { + "access-page": { + "location-aware": false + }, "help.delete": { "location-aware": false }, diff --git a/modules-available/rebootcontrol/page.inc.php b/modules-available/rebootcontrol/page.inc.php index abbdb2c3..041ae74f 100644 --- a/modules-available/rebootcontrol/page.inc.php +++ b/modules-available/rebootcontrol/page.inc.php @@ -79,11 +79,14 @@ class Page_RebootControl extends Page //location you want to see, default are "not assigned" clients $requestedLocation = Request::get('location', false, 'int'); $allowedLocs = User::getAllowedLocations("action.*"); + if (empty($allowedLocs)) { + User::assertPermission('action.*'); + } if ($requestedLocation === false) { if (in_array(0, $allowedLocs)) { $requestedLocation = 0; - } elseif (!empty($allowedLocs)) { + } else { $requestedLocation = reset($allowedLocs); } } @@ -105,8 +108,8 @@ class Page_RebootControl extends Page Render::addTemplate('header', $data); // only fill table if user has at least one permission for the location - if ($requestedLocation === false) { - Message::addError('main.no-permission'); + if (!in_array($requestedLocation, $allowedLocs)) { + Message::addError('locations.no-permission-location', $requestedLocation); } else { $data['data'] = RebootQueries::getMachineTable($requestedLocation); Render::addTemplate('_page', $data); diff --git a/modules-available/serversetup-bwlp/page.inc.php b/modules-available/serversetup-bwlp/page.inc.php index ae709da7..78096d7b 100644 --- a/modules-available/serversetup-bwlp/page.inc.php +++ b/modules-available/serversetup-bwlp/page.inc.php @@ -43,6 +43,12 @@ class Page_ServerSetup extends Page // iPXE stuff changes $this->updatePxeMenu(); } + + if (Request::isPost()) { + Util::redirect('?do=serversetup'); + } + + User::assertPermission('access-page'); } protected function doRender() diff --git a/modules-available/serversetup-bwlp/permissions/permissions.json b/modules-available/serversetup-bwlp/permissions/permissions.json index 6bae5422..44927506 100644 --- a/modules-available/serversetup-bwlp/permissions/permissions.json +++ b/modules-available/serversetup-bwlp/permissions/permissions.json @@ -1,4 +1,7 @@ { + "access-page": { + "location-aware": false + }, "download": { "location-aware": false }, diff --git a/modules-available/statistics_reporting/page.inc.php b/modules-available/statistics_reporting/page.inc.php index af4b2b12..cc03e4d8 100644 --- a/modules-available/statistics_reporting/page.inc.php +++ b/modules-available/statistics_reporting/page.inc.php @@ -84,6 +84,7 @@ class Page_Statistics_Reporting extends Page die(json_encode($report)); } } + User::assertPermission('*'); } /** diff --git a/modules-available/sysconfig/page.inc.php b/modules-available/sysconfig/page.inc.php index 7bb3e599..8d1799af 100644 --- a/modules-available/sysconfig/page.inc.php +++ b/modules-available/sysconfig/page.inc.php @@ -160,7 +160,7 @@ class Page_SysConfig extends Page $pMods = User::hasPermission('module.view-list'); $pConfs = User::hasPermission('config.view-list'); if (!($pMods || $pConfs)) { - Message::addError('main.no-permission'); + User::assertPermission('config.view-list'); } Render::openTag('div', array('class' => 'row')); if ($pConfs) { diff --git a/modules-available/syslog/page.inc.php b/modules-available/syslog/page.inc.php index 3a7513b5..00c55a3f 100644 --- a/modules-available/syslog/page.inc.php +++ b/modules-available/syslog/page.inc.php @@ -25,6 +25,7 @@ class Page_SysLog extends Page } Util::redirect('?do=syslog'); } + User::assertPermission('*'); } protected function doRender() diff --git a/modules-available/systemstatus/page.inc.php b/modules-available/systemstatus/page.inc.php index 816caa05..66b30bcf 100644 --- a/modules-available/systemstatus/page.inc.php +++ b/modules-available/systemstatus/page.inc.php @@ -18,6 +18,7 @@ class Page_SystemStatus extends Page User::assertPermission("serverreboot"); $this->rebootTask = Taskmanager::submit('Reboot'); } + User::assertPermission('*'); } protected function doRender() diff --git a/modules-available/webinterface/page.inc.php b/modules-available/webinterface/page.inc.php index 806ffd59..ca52c2ab 100644 --- a/modules-available/webinterface/page.inc.php +++ b/modules-available/webinterface/page.inc.php @@ -28,6 +28,10 @@ class Page_WebInterface extends Page $this->actionCustomization(); break; } + if (Request::isPost()) { + Util::redirect('?do=webinterface'); + } + User::assertPermission('access-page'); } private function actionConfigureHttps() diff --git a/modules-available/webinterface/permissions/permissions.json b/modules-available/webinterface/permissions/permissions.json index fa6f493f..ed81602a 100644 --- a/modules-available/webinterface/permissions/permissions.json +++ b/modules-available/webinterface/permissions/permissions.json @@ -1,4 +1,7 @@ { + "access-page": { + "location-aware": false + }, "edit.design": { "location-aware": false }, -- cgit v1.2.3-55-g7522 From 956eaf10e0d6ac36ac7a25340834346955b1122b Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 10 Apr 2018 15:40:15 +0200 Subject: [exams] Fix always-disabled "add" button for existing lectures --- modules-available/exams/page.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules-available/exams') diff --git a/modules-available/exams/page.inc.php b/modules-available/exams/page.inc.php index 15640a73..600089fc 100644 --- a/modules-available/exams/page.inc.php +++ b/modules-available/exams/page.inc.php @@ -457,7 +457,7 @@ class Page_Exams extends Page } else { Render::addTemplate('page-upcoming-lectures', [ 'pending_lectures' => $upcoming, - 'allowedToEdit' => $this->userCanEditExam(), + 'allowedToAdd' => $this->userCanEditExam(), 'decollapse' => array_key_exists('class', end($upcoming)) ]); } -- cgit v1.2.3-55-g7522 From 5370b98936418b2b548c023813039b8bf2074a55 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 13 Apr 2018 17:31:56 +0200 Subject: [inc/Module] Overhaul dependency loading and handling of js/css This is supposed to prevent unneeded js/css from being pulled in --- inc/module.inc.php | 63 ++++++++++++++-------- inc/render.inc.php | 4 +- index.php | 2 +- modules-available/adduser/config.json | 4 +- modules-available/backup/config.json | 4 +- modules-available/baseconfig/config.json | 7 ++- modules-available/baseconfig_bwidm/config.json | 6 ++- modules-available/baseconfig_bwlp/config.json | 6 ++- .../baseconfig_partitions_cdn/config.json | 8 +-- modules-available/bootstrap_datepicker/config.json | 17 +++--- modules-available/bootstrap_dialog/config.json | 17 +++--- .../bootstrap_multiselect/config.json | 17 +++--- modules-available/bootstrap_switch/config.json | 13 ++--- modules-available/bootstrap_timepicker/config.json | 17 +++--- modules-available/citymanagement/config.json | 6 +-- modules-available/dnbd3/config.json | 9 ++-- modules-available/dozmod/config.json | 4 +- modules-available/eventlog/config.json | 4 +- modules-available/exams/config.json | 13 +++-- modules-available/imgmanagement/config.json | 6 +-- modules-available/internetaccess/config.json | 4 +- modules-available/js_chart/config.json | 13 ++--- modules-available/js_circles/config.json | 13 ++--- modules-available/js_jqueryui/config.json | 17 +++--- modules-available/js_moment/config.json | 17 +++--- modules-available/js_selectize/config.json | 17 +++--- modules-available/js_stupidtable/config.json | 13 ++--- modules-available/js_vis/config.json | 19 ++++--- modules-available/locationinfo/config.json | 11 ++-- modules-available/locations/config.json | 4 +- modules-available/main/config.json | 3 +- modules-available/minilinux/config.json | 4 +- modules-available/news/config.json | 8 +-- modules-available/permissionmanager/config.json | 10 ++-- modules-available/rebootcontrol/config.json | 9 ++-- modules-available/roomplanner/config.json | 11 +++- modules-available/runmode/config.json | 9 ++-- modules-available/serversetup-bwlp/config.json | 4 +- modules-available/session/config.json | 3 +- modules-available/statistics/config.json | 12 +++-- modules-available/statistics_reporting/config.json | 9 +++- modules-available/summernote/config.json | 17 +++--- modules-available/support/config.json | 4 +- modules-available/sysconfig/config.json | 4 +- modules-available/sysconfignew/config.json | 4 +- modules-available/syslog/config.json | 8 +-- modules-available/systemstatus/config.json | 8 +-- modules-available/translation/config.json | 4 +- modules-available/usermanagement/config.json | 6 +-- modules-available/vmstore/config.json | 4 +- modules-available/webinterface/config.json | 4 +- 51 files changed, 293 insertions(+), 207 deletions(-) (limited to 'modules-available/exams') diff --git a/inc/module.inc.php b/inc/module.inc.php index 7610c720..fa2c4b98 100644 --- a/inc/module.inc.php +++ b/inc/module.inc.php @@ -35,7 +35,7 @@ class Module if ($module === false) return false; if ($activate) { - $module->activate(); + $module->activate(1, true); } return !$module->hasMissingDependencies(); } @@ -139,9 +139,11 @@ class Module */ private $category = false; + private $clientPlugin = false; private $depsMissing = false; private $depsChecked = false; private $activated = false; + private $directActivation = false; private $dependencies = array(); private $name; /** @@ -165,6 +167,9 @@ class Module if (isset($json['category']) && is_string($json['category'])) { $this->category = $json['category']; } + if (isset($json['client-plugin'])) { + $this->clientPlugin = (bool)$json['client-plugin']; + } $this->name = $name; } @@ -184,21 +189,33 @@ class Module return new $class(); } - public function activate($depth = 1) + public function activate($depth, $direct) { - if ($this->activated !== false || $this->depsMissing) - return $this->activated !== false; + if ($this->depsMissing) + return false; + if ($this->activated !== false && ($this->directActivation || !$direct)) + return true; + if ($depth === null && $direct === null) { + // This is the current page, always load its scripts + $this->clientPlugin = true; + $direct = true; + } + if ($this->activated === false) { + spl_autoload_register(function ($class) { + $file = 'modules/' . $this->name . '/inc/' . preg_replace('/[^a-z0-9]/', '', strtolower($class)) . '.inc.php'; + if (!file_exists($file)) + return; + require_once $file; + }); + } $this->activated = $depth; - spl_autoload_register(function($class) { - $file = 'modules/' . $this->name . '/inc/' . preg_replace('/[^a-z0-9]/', '', strtolower($class)) . '.inc.php'; - if (!file_exists($file)) - return; - require_once $file; - }); + if ($direct) { + $this->directActivation = true; + } foreach ($this->dependencies as $dep) { $get = self::get($dep); if ($get !== false) { - $get->activate($depth + 1); + $get->activate($depth + 1, $direct && $this->clientPlugin); } } return true; @@ -263,26 +280,26 @@ class Module return 'modules/' . $this->name; } - public function getScripts($externalOnly) + public function getScripts() { - if (!$externalOnly) { - if (!isset($this->scripts['clientscript.js']) && file_exists($this->getDir() . '/clientscript.js')) { - $this->scripts['clientscript.js'] = false; + if ($this->directActivation && $this->clientPlugin) { + if (!in_array('clientscript.js', $this->scripts)) { + $this->scripts[] = 'clientscript.js'; } - return array_keys($this->scripts); + return $this->scripts; } - return array_keys(array_filter($this->scripts)); + return []; } - public function getCss($externalOnly) + public function getCss() { - if (!$externalOnly) { - if (!isset($this->css['style.css']) && file_exists($this->getDir() . '/style.css')) { - $this->css['style.css'] = false; + if ($this->directActivation && $this->clientPlugin) { + if (!in_array('style.css', $this->css)) { + $this->css[] = 'style.css'; } - return array_keys($this->css); + return $this->css; } - return array_keys(array_filter($this->css)); + return []; } } diff --git a/inc/render.inc.php b/inc/render.inc.php index 0ce39dbe..4b1d3643 100644 --- a/inc/render.inc.php +++ b/inc/render.inc.php @@ -84,7 +84,7 @@ class Render '; // Include any module specific styles foreach ($modules as $module) { - $files = $module->getCss($module !== $pageModule); + $files = $module->getCss(); foreach ($files as $file) { echo ''; } @@ -113,7 +113,7 @@ class Render '; foreach ($modules as $module) { - $files = $module->getScripts($module !== $pageModule); + $files = $module->getScripts(); foreach ($files as $file) { echo ''; } diff --git a/index.php b/index.php index 4816ef42..1ecd2109 100644 --- a/index.php +++ b/index.php @@ -79,7 +79,7 @@ abstract class Page if (self::$module === false) { Util::traceError('Invalid Module: ' . $name); } - self::$module->activate(); + self::$module->activate(null, null); self::$instance = self::$module->newPage(); } diff --git a/modules-available/adduser/config.json b/modules-available/adduser/config.json index 706412d0..110f8b67 100644 --- a/modules-available/adduser/config.json +++ b/modules-available/adduser/config.json @@ -1,3 +1,3 @@ { - "category":"main.content" -} + "category": "main.content" +} \ No newline at end of file diff --git a/modules-available/backup/config.json b/modules-available/backup/config.json index 706412d0..110f8b67 100644 --- a/modules-available/backup/config.json +++ b/modules-available/backup/config.json @@ -1,3 +1,3 @@ { - "category":"main.content" -} + "category": "main.content" +} \ No newline at end of file diff --git a/modules-available/baseconfig/config.json b/modules-available/baseconfig/config.json index e4d906e1..357a117e 100644 --- a/modules-available/baseconfig/config.json +++ b/modules-available/baseconfig/config.json @@ -1,4 +1,7 @@ { "category": "main.settings-client", - "dependencies" : ["js_selectize", "bootstrap_multiselect"] -} + "dependencies": [ + "js_selectize", + "bootstrap_multiselect" + ] +} \ No newline at end of file diff --git a/modules-available/baseconfig_bwidm/config.json b/modules-available/baseconfig_bwidm/config.json index af67a188..7e6cf06a 100644 --- a/modules-available/baseconfig_bwidm/config.json +++ b/modules-available/baseconfig_bwidm/config.json @@ -1,3 +1,5 @@ { - "dependencies": ["baseconfig"] -} + "dependencies": [ + "baseconfig" + ] +} \ No newline at end of file diff --git a/modules-available/baseconfig_bwlp/config.json b/modules-available/baseconfig_bwlp/config.json index af67a188..7e6cf06a 100644 --- a/modules-available/baseconfig_bwlp/config.json +++ b/modules-available/baseconfig_bwlp/config.json @@ -1,3 +1,5 @@ { - "dependencies": ["baseconfig"] -} + "dependencies": [ + "baseconfig" + ] +} \ No newline at end of file diff --git a/modules-available/baseconfig_partitions_cdn/config.json b/modules-available/baseconfig_partitions_cdn/config.json index a355eef3..fd4c6f4b 100644 --- a/modules-available/baseconfig_partitions_cdn/config.json +++ b/modules-available/baseconfig_partitions_cdn/config.json @@ -1,4 +1,6 @@ { - "category": "main.settings-client", - "dependencies": [ "baseconfig" ] -} + "category": "main.settings-client", + "dependencies": [ + "baseconfig" + ] +} \ No newline at end of file diff --git a/modules-available/bootstrap_datepicker/config.json b/modules-available/bootstrap_datepicker/config.json index 5a0c7960..69bb0aa9 100644 --- a/modules-available/bootstrap_datepicker/config.json +++ b/modules-available/bootstrap_datepicker/config.json @@ -1,9 +1,10 @@ { - "dependencies" : [], - "css": { - "style.css": true - }, - "scripts": { - "clientscript.js": true - } -} + "dependencies": [], + "css": [ + "style.css" + ], + "scripts": [ + "clientscript.js" + ], + "client-plugin": true +} \ No newline at end of file diff --git a/modules-available/bootstrap_dialog/config.json b/modules-available/bootstrap_dialog/config.json index 5a0c7960..69bb0aa9 100644 --- a/modules-available/bootstrap_dialog/config.json +++ b/modules-available/bootstrap_dialog/config.json @@ -1,9 +1,10 @@ { - "dependencies" : [], - "css": { - "style.css": true - }, - "scripts": { - "clientscript.js": true - } -} + "dependencies": [], + "css": [ + "style.css" + ], + "scripts": [ + "clientscript.js" + ], + "client-plugin": true +} \ No newline at end of file diff --git a/modules-available/bootstrap_multiselect/config.json b/modules-available/bootstrap_multiselect/config.json index 5a0c7960..69bb0aa9 100644 --- a/modules-available/bootstrap_multiselect/config.json +++ b/modules-available/bootstrap_multiselect/config.json @@ -1,9 +1,10 @@ { - "dependencies" : [], - "css": { - "style.css": true - }, - "scripts": { - "clientscript.js": true - } -} + "dependencies": [], + "css": [ + "style.css" + ], + "scripts": [ + "clientscript.js" + ], + "client-plugin": true +} \ No newline at end of file diff --git a/modules-available/bootstrap_switch/config.json b/modules-available/bootstrap_switch/config.json index de4d37b4..3cf0d162 100644 --- a/modules-available/bootstrap_switch/config.json +++ b/modules-available/bootstrap_switch/config.json @@ -1,8 +1,9 @@ { - "css": { - "style.css": true - }, - "scripts": { - "clientscript.js": true - } + "css": [ + "style.css" + ], + "scripts": [ + "clientscript.js" + ], + "client-plugin": true } \ No newline at end of file diff --git a/modules-available/bootstrap_timepicker/config.json b/modules-available/bootstrap_timepicker/config.json index 5a0c7960..69bb0aa9 100644 --- a/modules-available/bootstrap_timepicker/config.json +++ b/modules-available/bootstrap_timepicker/config.json @@ -1,9 +1,10 @@ { - "dependencies" : [], - "css": { - "style.css": true - }, - "scripts": { - "clientscript.js": true - } -} + "dependencies": [], + "css": [ + "style.css" + ], + "scripts": [ + "clientscript.js" + ], + "client-plugin": true +} \ No newline at end of file diff --git a/modules-available/citymanagement/config.json b/modules-available/citymanagement/config.json index e87cbf7d..b356dfc6 100644 --- a/modules-available/citymanagement/config.json +++ b/modules-available/citymanagement/config.json @@ -1,4 +1,4 @@ { - "category":"citymanagement.cities", - "permission":"0" -} + "category": "citymanagement.cities", + "permission": "0" +} \ No newline at end of file diff --git a/modules-available/dnbd3/config.json b/modules-available/dnbd3/config.json index f84a4170..9670ded9 100644 --- a/modules-available/dnbd3/config.json +++ b/modules-available/dnbd3/config.json @@ -1,4 +1,7 @@ { - "category":"main.settings-server", - "dependencies":["locations","runmode"] -} + "category": "main.settings-server", + "dependencies": [ + "locations", + "runmode" + ] +} \ No newline at end of file diff --git a/modules-available/dozmod/config.json b/modules-available/dozmod/config.json index 706412d0..110f8b67 100644 --- a/modules-available/dozmod/config.json +++ b/modules-available/dozmod/config.json @@ -1,3 +1,3 @@ { - "category":"main.content" -} + "category": "main.content" +} \ No newline at end of file diff --git a/modules-available/eventlog/config.json b/modules-available/eventlog/config.json index 6778348d..aa23adb5 100644 --- a/modules-available/eventlog/config.json +++ b/modules-available/eventlog/config.json @@ -1,3 +1,3 @@ { - "category":"main.status" -} + "category": "main.status" +} \ No newline at end of file diff --git a/modules-available/exams/config.json b/modules-available/exams/config.json index 0780ebef..a99d1c1a 100644 --- a/modules-available/exams/config.json +++ b/modules-available/exams/config.json @@ -1,5 +1,12 @@ { - "category":"main.content", - "dependencies": [ "locations", "js_vis", "js_stupidtable", "bootstrap_datepicker", "bootstrap_timepicker", "bootstrap_multiselect"], + "category": "main.content", + "dependencies": [ + "locations", + "js_vis", + "js_stupidtable", + "bootstrap_datepicker", + "bootstrap_timepicker", + "bootstrap_multiselect" + ], "permission": "0" -} +} \ No newline at end of file diff --git a/modules-available/imgmanagement/config.json b/modules-available/imgmanagement/config.json index 6454d96f..2fbb822f 100644 --- a/modules-available/imgmanagement/config.json +++ b/modules-available/imgmanagement/config.json @@ -1,4 +1,4 @@ { - "category":"main.content", - "permission":"1" -} + "category": "main.content", + "permission": "1" +} \ No newline at end of file diff --git a/modules-available/internetaccess/config.json b/modules-available/internetaccess/config.json index 706412d0..110f8b67 100644 --- a/modules-available/internetaccess/config.json +++ b/modules-available/internetaccess/config.json @@ -1,3 +1,3 @@ { - "category":"main.content" -} + "category": "main.content" +} \ No newline at end of file diff --git a/modules-available/js_chart/config.json b/modules-available/js_chart/config.json index de4d37b4..3cf0d162 100644 --- a/modules-available/js_chart/config.json +++ b/modules-available/js_chart/config.json @@ -1,8 +1,9 @@ { - "css": { - "style.css": true - }, - "scripts": { - "clientscript.js": true - } + "css": [ + "style.css" + ], + "scripts": [ + "clientscript.js" + ], + "client-plugin": true } \ No newline at end of file diff --git a/modules-available/js_circles/config.json b/modules-available/js_circles/config.json index de4d37b4..3cf0d162 100644 --- a/modules-available/js_circles/config.json +++ b/modules-available/js_circles/config.json @@ -1,8 +1,9 @@ { - "css": { - "style.css": true - }, - "scripts": { - "clientscript.js": true - } + "css": [ + "style.css" + ], + "scripts": [ + "clientscript.js" + ], + "client-plugin": true } \ No newline at end of file diff --git a/modules-available/js_jqueryui/config.json b/modules-available/js_jqueryui/config.json index 5a0c7960..69bb0aa9 100644 --- a/modules-available/js_jqueryui/config.json +++ b/modules-available/js_jqueryui/config.json @@ -1,9 +1,10 @@ { - "dependencies" : [], - "css": { - "style.css": true - }, - "scripts": { - "clientscript.js": true - } -} + "dependencies": [], + "css": [ + "style.css" + ], + "scripts": [ + "clientscript.js" + ], + "client-plugin": true +} \ No newline at end of file diff --git a/modules-available/js_moment/config.json b/modules-available/js_moment/config.json index 5a0c7960..69bb0aa9 100644 --- a/modules-available/js_moment/config.json +++ b/modules-available/js_moment/config.json @@ -1,9 +1,10 @@ { - "dependencies" : [], - "css": { - "style.css": true - }, - "scripts": { - "clientscript.js": true - } -} + "dependencies": [], + "css": [ + "style.css" + ], + "scripts": [ + "clientscript.js" + ], + "client-plugin": true +} \ No newline at end of file diff --git a/modules-available/js_selectize/config.json b/modules-available/js_selectize/config.json index 5a0c7960..69bb0aa9 100644 --- a/modules-available/js_selectize/config.json +++ b/modules-available/js_selectize/config.json @@ -1,9 +1,10 @@ { - "dependencies" : [], - "css": { - "style.css": true - }, - "scripts": { - "clientscript.js": true - } -} + "dependencies": [], + "css": [ + "style.css" + ], + "scripts": [ + "clientscript.js" + ], + "client-plugin": true +} \ No newline at end of file diff --git a/modules-available/js_stupidtable/config.json b/modules-available/js_stupidtable/config.json index cf932d7e..3cf0d162 100644 --- a/modules-available/js_stupidtable/config.json +++ b/modules-available/js_stupidtable/config.json @@ -1,8 +1,9 @@ { - "css": { - "style.css": true - }, - "scripts": { - "clientscript.js": true - } + "css": [ + "style.css" + ], + "scripts": [ + "clientscript.js" + ], + "client-plugin": true } \ No newline at end of file diff --git a/modules-available/js_vis/config.json b/modules-available/js_vis/config.json index 3b027d31..4c870a22 100644 --- a/modules-available/js_vis/config.json +++ b/modules-available/js_vis/config.json @@ -1,9 +1,12 @@ { - "dependencies" : ["js_moment"], - "css": { - "style.css": true - }, - "scripts": { - "clientscript.js": true - } -} + "dependencies": [ + "js_moment" + ], + "css": [ + "style.css" + ], + "scripts": [ + "clientscript.js" + ], + "client-plugin": true +} \ No newline at end of file diff --git a/modules-available/locationinfo/config.json b/modules-available/locationinfo/config.json index 87825809..837acfcf 100644 --- a/modules-available/locationinfo/config.json +++ b/modules-available/locationinfo/config.json @@ -1,4 +1,9 @@ { - "category":"main.beta", - "dependencies": ["js_jqueryui", "bootstrap_timepicker", "locations", "bootstrap_switch"] -} + "category": "main.beta", + "dependencies": [ + "js_jqueryui", + "bootstrap_timepicker", + "locations", + "bootstrap_switch" + ] +} \ No newline at end of file diff --git a/modules-available/locations/config.json b/modules-available/locations/config.json index 706412d0..110f8b67 100644 --- a/modules-available/locations/config.json +++ b/modules-available/locations/config.json @@ -1,3 +1,3 @@ { - "category":"main.content" -} + "category": "main.content" +} \ No newline at end of file diff --git a/modules-available/main/config.json b/modules-available/main/config.json index 2c63c085..0637a088 100644 --- a/modules-available/main/config.json +++ b/modules-available/main/config.json @@ -1,2 +1 @@ -{ -} +[] \ No newline at end of file diff --git a/modules-available/minilinux/config.json b/modules-available/minilinux/config.json index 28d71577..6c7b7146 100644 --- a/modules-available/minilinux/config.json +++ b/modules-available/minilinux/config.json @@ -1,3 +1,3 @@ { - "category":"main.settings-client" -} + "category": "main.settings-client" +} \ No newline at end of file diff --git a/modules-available/news/config.json b/modules-available/news/config.json index e076ea5c..23cd1443 100644 --- a/modules-available/news/config.json +++ b/modules-available/news/config.json @@ -1,4 +1,6 @@ { - "category":"main.content", - "dependencies": [ "js_stupidtable" ] -} + "category": "main.content", + "dependencies": [ + "js_stupidtable" + ] +} \ No newline at end of file diff --git a/modules-available/permissionmanager/config.json b/modules-available/permissionmanager/config.json index d2071984..25b61de3 100644 --- a/modules-available/permissionmanager/config.json +++ b/modules-available/permissionmanager/config.json @@ -1,4 +1,8 @@ { - "category":"main.content", - "dependencies": [ "locations", "js_stupidtable", "js_selectize" ] -} + "category": "main.content", + "dependencies": [ + "locations", + "js_stupidtable", + "js_selectize" + ] +} \ No newline at end of file diff --git a/modules-available/rebootcontrol/config.json b/modules-available/rebootcontrol/config.json index d8ab5868..43d2c28f 100644 --- a/modules-available/rebootcontrol/config.json +++ b/modules-available/rebootcontrol/config.json @@ -1,4 +1,7 @@ { - "category":"main.beta", - "dependencies": [ "locations", "js_stupidtable" ] -} + "category": "main.beta", + "dependencies": [ + "locations", + "js_stupidtable" + ] +} \ No newline at end of file diff --git a/modules-available/roomplanner/config.json b/modules-available/roomplanner/config.json index 537714c3..62f38773 100644 --- a/modules-available/roomplanner/config.json +++ b/modules-available/roomplanner/config.json @@ -1,3 +1,10 @@ { - "dependencies": ["js_jqueryui", "js_selectize", "bootstrap_dialog", "statistics", "locations", "runmode"] -} + "dependencies": [ + "js_jqueryui", + "js_selectize", + "bootstrap_dialog", + "statistics", + "locations", + "runmode" + ] +} \ No newline at end of file diff --git a/modules-available/runmode/config.json b/modules-available/runmode/config.json index e3c07d48..84e044ce 100644 --- a/modules-available/runmode/config.json +++ b/modules-available/runmode/config.json @@ -1,4 +1,7 @@ { - "dependencies": [ "statistics", "js_selectize" ], - "permission":"0" -} + "dependencies": [ + "statistics", + "js_selectize" + ], + "permission": "0" +} \ No newline at end of file diff --git a/modules-available/serversetup-bwlp/config.json b/modules-available/serversetup-bwlp/config.json index 7205d70a..36268c6a 100644 --- a/modules-available/serversetup-bwlp/config.json +++ b/modules-available/serversetup-bwlp/config.json @@ -1,3 +1,3 @@ { - "category":"main.settings-server" -} + "category": "main.settings-server" +} \ No newline at end of file diff --git a/modules-available/session/config.json b/modules-available/session/config.json index 2c63c085..0637a088 100644 --- a/modules-available/session/config.json +++ b/modules-available/session/config.json @@ -1,2 +1 @@ -{ -} +[] \ No newline at end of file diff --git a/modules-available/statistics/config.json b/modules-available/statistics/config.json index 333f881a..412dc3cb 100644 --- a/modules-available/statistics/config.json +++ b/modules-available/statistics/config.json @@ -1,5 +1,9 @@ { - "category":"main.status", - "dependencies": [ "js_chart", "js_selectize", "bootstrap_datepicker"], - "permission":"0" -} + "category": "main.status", + "dependencies": [ + "js_chart", + "js_selectize", + "bootstrap_datepicker" + ], + "permission": "0" +} \ No newline at end of file diff --git a/modules-available/statistics_reporting/config.json b/modules-available/statistics_reporting/config.json index 78ca35ba..c439efa8 100644 --- a/modules-available/statistics_reporting/config.json +++ b/modules-available/statistics_reporting/config.json @@ -1,4 +1,9 @@ { "category": "main.status", - "dependencies": [ "statistics", "locations", "js_stupidtable", "js_jqueryui" ] -} + "dependencies": [ + "statistics", + "locations", + "js_stupidtable", + "js_jqueryui" + ] +} \ No newline at end of file diff --git a/modules-available/summernote/config.json b/modules-available/summernote/config.json index 5a0c7960..69bb0aa9 100644 --- a/modules-available/summernote/config.json +++ b/modules-available/summernote/config.json @@ -1,9 +1,10 @@ { - "dependencies" : [], - "css": { - "style.css": true - }, - "scripts": { - "clientscript.js": true - } -} + "dependencies": [], + "css": [ + "style.css" + ], + "scripts": [ + "clientscript.js" + ], + "client-plugin": true +} \ No newline at end of file diff --git a/modules-available/support/config.json b/modules-available/support/config.json index 706412d0..110f8b67 100644 --- a/modules-available/support/config.json +++ b/modules-available/support/config.json @@ -1,3 +1,3 @@ { - "category":"main.content" -} + "category": "main.content" +} \ No newline at end of file diff --git a/modules-available/sysconfig/config.json b/modules-available/sysconfig/config.json index 28d71577..6c7b7146 100644 --- a/modules-available/sysconfig/config.json +++ b/modules-available/sysconfig/config.json @@ -1,3 +1,3 @@ { - "category":"main.settings-client" -} + "category": "main.settings-client" +} \ No newline at end of file diff --git a/modules-available/sysconfignew/config.json b/modules-available/sysconfignew/config.json index 28d71577..6c7b7146 100644 --- a/modules-available/sysconfignew/config.json +++ b/modules-available/sysconfignew/config.json @@ -1,3 +1,3 @@ { - "category":"main.settings-client" -} + "category": "main.settings-client" +} \ No newline at end of file diff --git a/modules-available/syslog/config.json b/modules-available/syslog/config.json index 2b718a8e..691bd4df 100644 --- a/modules-available/syslog/config.json +++ b/modules-available/syslog/config.json @@ -1,4 +1,6 @@ { - "category":"main.status", - "dependencies":["js_selectize"] -} + "category": "main.status", + "dependencies": [ + "js_selectize" + ] +} \ No newline at end of file diff --git a/modules-available/systemstatus/config.json b/modules-available/systemstatus/config.json index 3c2efce7..cf774d1b 100644 --- a/modules-available/systemstatus/config.json +++ b/modules-available/systemstatus/config.json @@ -1,4 +1,6 @@ { - "category":"main.status", - "dependencies": [ "js_circles" ] -} + "category": "main.status", + "dependencies": [ + "js_circles" + ] +} \ No newline at end of file diff --git a/modules-available/translation/config.json b/modules-available/translation/config.json index 706412d0..110f8b67 100644 --- a/modules-available/translation/config.json +++ b/modules-available/translation/config.json @@ -1,3 +1,3 @@ { - "category":"main.content" -} + "category": "main.content" +} \ No newline at end of file diff --git a/modules-available/usermanagement/config.json b/modules-available/usermanagement/config.json index 9c66d6bf..428315ba 100644 --- a/modules-available/usermanagement/config.json +++ b/modules-available/usermanagement/config.json @@ -1,4 +1,4 @@ { - "category":"main.users", - "permission":"0" -} + "category": "main.users", + "permission": "0" +} \ No newline at end of file diff --git a/modules-available/vmstore/config.json b/modules-available/vmstore/config.json index 7205d70a..36268c6a 100644 --- a/modules-available/vmstore/config.json +++ b/modules-available/vmstore/config.json @@ -1,3 +1,3 @@ { - "category":"main.settings-server" -} + "category": "main.settings-server" +} \ No newline at end of file diff --git a/modules-available/webinterface/config.json b/modules-available/webinterface/config.json index 7205d70a..36268c6a 100644 --- a/modules-available/webinterface/config.json +++ b/modules-available/webinterface/config.json @@ -1,3 +1,3 @@ { - "category":"main.settings-server" -} + "category": "main.settings-server" +} \ No newline at end of file -- cgit v1.2.3-55-g7522 From f2cf42e8ec36ee74bfd7abae0e554c458a03973a Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 20 Apr 2018 15:10:27 +0200 Subject: [exams/runmode] Properly disable exam mode for runmodes --- .../exams/baseconfig/getconfig.inc.php | 38 ++++++++++++++-------- .../runmode/baseconfig/getconfig.inc.php | 13 +++----- 2 files changed, 28 insertions(+), 23 deletions(-) (limited to 'modules-available/exams') diff --git a/modules-available/exams/baseconfig/getconfig.inc.php b/modules-available/exams/baseconfig/getconfig.inc.php index e5dd01c9..10aa1d84 100644 --- a/modules-available/exams/baseconfig/getconfig.inc.php +++ b/modules-available/exams/baseconfig/getconfig.inc.php @@ -1,18 +1,28 @@ 0) { - ConfigHolder::add('SLX_EXAM_START', $lectureId, 10000); +$foofoo = function($machineUuid) { + // Leave clients in any runmode alone + $res = Database::queryFirst('SELECT machineuuid FROM runmode WHERE machineuuid = :uuid', + array('uuid' => $machineUuid), true); + if (is_array($res)) + return; + // Check if exam mode should apply + $locations = ConfigHolder::get('SLX_LOCATIONS'); + if ($locations === false) { + $locationIds = []; + } else { + $locationIds = explode(' ', $locations); } - if (strlen($autoLogin) > 0) { - ConfigHolder::add('SLX_AUTOLOGIN', $autoLogin, 10000); + if (Exams::isInExamMode($locationIds, $lectureId, $autoLogin)) { + ConfigHolder::add('SLX_EXAM', 'yes', 10000); + if (strlen($lectureId) > 0) { + ConfigHolder::add('SLX_EXAM_START', $lectureId, 10000); + } + if (strlen($autoLogin) > 0) { + ConfigHolder::add('SLX_AUTOLOGIN', $autoLogin, 10000); + } + ConfigHolder::add('SLX_SYSTEMD_TARGET', 'exam-mode', 10000); } - ConfigHolder::add('SLX_SYSTEMD_TARGET', 'exam-mode', 10000); -} +}; + +$foofoo($uuid); \ No newline at end of file diff --git a/modules-available/runmode/baseconfig/getconfig.inc.php b/modules-available/runmode/baseconfig/getconfig.inc.php index 2d622fc7..214a974c 100644 --- a/modules-available/runmode/baseconfig/getconfig.inc.php +++ b/modules-available/runmode/baseconfig/getconfig.inc.php @@ -6,21 +6,16 @@ $foofoo = function($machineUuid) { if ($res === false) return; $config = RunMode::getModuleConfig($res['module']); - if ($config === false || $config->configHook === false) + if ($config === false) return; if (!Module::isAvailable($res['module'])) return; // Not really possible because getModuleConfig would have failed but we should make sure - call_user_func($config->configHook, $machineUuid, $res['modeid'], $res['modedata']); + if ($config->configHook !== false) { + call_user_func($config->configHook, $machineUuid, $res['modeid'], $res['modedata']); + } if ($config->systemdDefaultTarget !== false) { ConfigHolder::add('SLX_SYSTEMD_TARGET', $config->systemdDefaultTarget, 10000); } - // Disable exam mode - not sure if this is generally a good idea; for now, all modes we can think of would - // not make sense that way so do this for now - if (ConfigHolder::get('SLX_EXAM') !== false) { - ConfigHolder::add('SLX_EXAM', '', 100001); - ConfigHolder::add('SLX_EXAM_START', '', 100001); - ConfigHolder::add('SLX_AUTOLOGIN', '', 100001); - } }; $foofoo($uuid); \ No newline at end of file -- cgit v1.2.3-55-g7522 From e57eb1a28dff41c54f2c1e0aab6badbbde0bd1df Mon Sep 17 00:00:00 2001 From: Steffen Ritter Date: Wed, 30 May 2018 17:17:03 +0200 Subject: [exams] Fix warning msg when checking timeranges (sec vs ms) --- modules-available/exams/templates/page-add-edit-exam.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules-available/exams') diff --git a/modules-available/exams/templates/page-add-edit-exam.html b/modules-available/exams/templates/page-add-edit-exam.html index 11bffed8..dc29a7f5 100644 --- a/modules-available/exams/templates/page-add-edit-exam.html +++ b/modules-available/exams/templates/page-add-edit-exam.html @@ -221,8 +221,8 @@ document.addEventListener("DOMContentLoaded", function () { var to = e.data('to'); if (!from || !to) return; - from = slxMoment(from); - to = slxMoment(to); + from = slxMoment.unix(from); + to = slxMoment.unix(to); if (from.isBefore(sd) || to.isAfter(ed)) { e.css('color', '#999'); e.data('inrange', false) @@ -239,7 +239,7 @@ document.addEventListener("DOMContentLoaded", function () { if (sel.val() === '' || sel.data('inrange')) { $('#lecture-info').text('-'); } else { - $('#lecture-info').text('{{lang_lectureOutOfRange}} (' + slxMoment(sel.data('from') * 1000).format('YYYY-MM-DD H:mm') + ' - ' + slxMoment(sel.data('to') * 1000).format('YYYY-MM-DD H:mm') + ')'); + $('#lecture-info').text('{{lang_lectureOutOfRange}} (' + slxMoment.unix(sel.data('from')).format('YYYY-MM-DD H:mm') + ' - ' + slxMoment.unix(sel.data('to')).format('YYYY-MM-DD H:mm') + ')'); } }; -- cgit v1.2.3-55-g7522 From cd092274b88599449902f480f35291768be6e99e Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 7 Aug 2018 16:54:01 +0200 Subject: [inc/User] Fix access to Page if class is not loaded --- inc/user.inc.php | 11 ++++- lang/pt/flag.png | Bin 1115 -> 0 bytes lang/pt/name.txt | 1 - modules-available/exams/lang/de/template-tags.json | 2 +- modules-available/exams/lang/en/template-tags.json | 2 +- .../coursebackend/coursebackend_hisinone.inc.php | 48 +++++++++++++-------- .../locationinfo/lang/de/template-tags.json | 2 +- .../locationinfo/lang/en/template-tags.json | 2 +- 8 files changed, 43 insertions(+), 25 deletions(-) delete mode 100644 lang/pt/flag.png delete mode 100644 lang/pt/name.txt (limited to 'modules-available/exams') diff --git a/inc/user.inc.php b/inc/user.inc.php index 2571c61c..20e8cd3d 100644 --- a/inc/user.inc.php +++ b/inc/user.inc.php @@ -34,8 +34,15 @@ class User if ($permission{0} === '.') { $permission = substr($permission, 1); } else { - $module = Page::getModule(); - $permission = $module ? $module->getIdentifier() . "." . $permission : $permission; + if (class_exists('Page')) { + $module = Page::getModule(); + if ($module !== false) { + $module = $module->getIdentifier(); + } + } else { + $module = strtolower(Request::any('do')); + } + $permission = $module ? $module . "." . $permission : $permission; } return PermissionUtil::userHasPermission(self::$user['userid'], $permission, $locationid); } diff --git a/lang/pt/flag.png b/lang/pt/flag.png deleted file mode 100644 index 78c57dea..00000000 Binary files a/lang/pt/flag.png and /dev/null differ diff --git a/lang/pt/name.txt b/lang/pt/name.txt deleted file mode 100644 index 811b10b4..00000000 --- a/lang/pt/name.txt +++ /dev/null @@ -1 +0,0 @@ -Português \ No newline at end of file diff --git a/modules-available/exams/lang/de/template-tags.json b/modules-available/exams/lang/de/template-tags.json index 8bf37143..1dd51374 100644 --- a/modules-available/exams/lang/de/template-tags.json +++ b/modules-available/exams/lang/de/template-tags.json @@ -29,7 +29,7 @@ "lang_headingMain": "bwLehrpool Pr\u00fcfungsmodus", "lang_id": "ID", "lang_lectureName": "Veranstaltungsname", - "lang_lectureOutOfRange": "Achtung: Start- bzw. Endzeitpunkt der Veranstaltung liegen au\u00dferhalb des oben angegebenen Zeitraums", + "lang_lectureOutOfRange": "Achtung: Der oben angegebene Zeitraum ist k\u00fcrzer als die Dauer der Veranstaltung", "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", diff --git a/modules-available/exams/lang/en/template-tags.json b/modules-available/exams/lang/en/template-tags.json index af87bb01..23266154 100644 --- a/modules-available/exams/lang/en/template-tags.json +++ b/modules-available/exams/lang/en/template-tags.json @@ -29,7 +29,7 @@ "lang_headingMain": "bwLehrpool Exam Mode", "lang_id": "ID", "lang_lectureName": "Lecture name", - "lang_lectureOutOfRange": "Hint: Start or end date of given lecture lies outside of exam period given above", + "lang_lectureOutOfRange": "Hint: The exam period given above is shorter than the duration of the given lecture", "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", diff --git a/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php b/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php index 558f5cd0..3b26e625 100644 --- a/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php +++ b/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php @@ -274,8 +274,7 @@ class CourseBackend_HisInOne extends CourseBackend foreach ($eventDetails as $event) { foreach (array('/hisdefaulttext', '/hisshorttext', - '/hisshortcomment', - '/hisplanelements/hisplanelement/hisdefaulttext') as $path) { + '/hisshortcomment') as $path) { $name = $this->getArrayPath($event, $path); if (!empty($name) && !empty($name[0])) break; @@ -284,25 +283,38 @@ class CourseBackend_HisInOne extends CourseBackend if ($name === false) { $name = ['???']; } - $unitPlannedDates = $this->getArrayPath($event, - '/hisplanelements/hisplanelement/hisplannedDates/hisplannedDate/hisindividualDates/hisindividualDate'); - if ($unitPlannedDates === false) { - $this->error = 'Cannot find ./hisplanelements/hisplanelement/hisplannedDates/hisplannedDate/hisindividualDates/hisindividualDate'; - error_log('Cannot find ./hisplanelements/hisplanelement/hisplannedDates/hisplannedDate/hisindividualDates/hisindividualDate'); + $planElements = $this->getArrayPath($event, '/hisplanelements/hisplanelement'); + if ($planElements === false) { + $this->error = 'Cannot find ./hisplanelements/hisplanelement'; + error_log('Cannot find ./hisplanelements/hisplanelement'); error_log(print_r($event, true)); continue; } - foreach ($unitPlannedDates as $plannedDate) { - $eventRoomId = $this->getArrayPath($plannedDate, '/hisroomId')[0]; - $eventDate = $this->getArrayPath($plannedDate, '/hisexecutiondate')[0]; - if (in_array($eventRoomId, $requestedRoomIds) && in_array($eventDate, $currentWeek)) { - $startTime = $this->getArrayPath($plannedDate, '/hisstarttime')[0]; - $endTime = $this->getArrayPath($plannedDate, '/hisendtime')[0]; - $tTables[$eventRoomId][] = array( - 'title' => $name[0], - 'start' => $eventDate . "T" . $startTime, - 'end' => $eventDate . "T" . $endTime - ); + foreach ($planElements as $planElement) { + $unitPlannedDates = $this->getArrayPath($planElement, + '/hisplannedDates/hisplannedDate/hisindividualDates/hisindividualDate'); + if ($unitPlannedDates === false) { + $this->error = 'Cannot find ./hisplannedDates/hisplannedDate/hisindividualDates/hisindividualDate'; + error_log('Cannot find ./hisplannedDates/hisplannedDate/hisindividualDates/hisindividualDate'); + error_log(print_r($planElement, true)); + continue; + } + $localName = $this->getArrayPath($planElement, '/hisdefaulttext'); + if ($localName === false || empty($localName[0])) { + $localName = $name; + } + foreach ($unitPlannedDates as $plannedDate) { + $eventRoomId = $this->getArrayPath($plannedDate, '/hisroomId')[0]; + $eventDate = $this->getArrayPath($plannedDate, '/hisexecutiondate')[0]; + if (in_array($eventRoomId, $requestedRoomIds) && in_array($eventDate, $currentWeek)) { + $startTime = $this->getArrayPath($plannedDate, '/hisstarttime')[0]; + $endTime = $this->getArrayPath($plannedDate, '/hisendtime')[0]; + $tTables[$eventRoomId][] = array( + 'title' => $localName[0], + 'start' => $eventDate . "T" . $startTime, + 'end' => $eventDate . "T" . $endTime + ); + } } } } diff --git a/modules-available/locationinfo/lang/de/template-tags.json b/modules-available/locationinfo/lang/de/template-tags.json index bcdf7148..b51c420b 100644 --- a/modules-available/locationinfo/lang/de/template-tags.json +++ b/modules-available/locationinfo/lang/de/template-tags.json @@ -76,7 +76,7 @@ "lang_remoteSchedule": "Abruf Belegungsplan", "lang_room": "Raum", "lang_roomId": "Raum ID", - "lang_roomIdTooltip": "Die Raum ID, die der Server ben\u00f6tigt, um Kalenderdaten abzurufen", + "lang_roomIdTooltip": "Die Raum ID, die der Server ben\u00f6tigt, um Kalenderdaten abzurufen (bei Exchange die Postfachadresse)", "lang_roomupdateTooltip": "Zeit nach der die PCs aktualisiert werden (in Sekunden)", "lang_rotation": "Rotation", "lang_rotation0": "0\u00b0", diff --git a/modules-available/locationinfo/lang/en/template-tags.json b/modules-available/locationinfo/lang/en/template-tags.json index 558ddff0..f041dc0a 100644 --- a/modules-available/locationinfo/lang/en/template-tags.json +++ b/modules-available/locationinfo/lang/en/template-tags.json @@ -76,7 +76,7 @@ "lang_remoteSchedule": "Time table retrieval", "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 (when using exchange the room mailbox)", "lang_roomupdateTooltip": "Time the PCs in the room gets updated (in seconds)", "lang_rotation": "Rotation", "lang_rotation0": "0\u00b0", -- cgit v1.2.3-55-g7522 From 4a2c2ab41e7c29b1966d02fc40b7c7257b01f8d7 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 18 Feb 2019 15:51:27 +0100 Subject: Update translations --- modules-available/dozmod/lang/de/permissions.json | 12 ++-- .../dozmod/lang/de/template-tags.json | 4 +- modules-available/dozmod/lang/en/messages.json | 2 + modules-available/dozmod/lang/en/module.json | 1 + modules-available/dozmod/lang/en/permissions.json | 10 +-- .../dozmod/lang/en/template-tags.json | 20 ++++++ modules-available/dozmod/page.inc.php | 1 + modules-available/exams/lang/de/template-tags.json | 2 - modules-available/exams/lang/en/template-tags.json | 2 - modules-available/main/lang/de/categories.json | 3 +- modules-available/main/lang/en/categories.json | 3 +- .../serversetup-bwlp-ipxe/lang/de/messages.json | 3 +- .../serversetup-bwlp-ipxe/lang/de/permissions.json | 1 - .../lang/de/template-tags.json | 21 +----- .../serversetup-bwlp-ipxe/lang/en/messages.json | 17 ++++- .../serversetup-bwlp-ipxe/lang/en/module.json | 18 ++++- .../serversetup-bwlp-ipxe/lang/en/permissions.json | 7 +- .../lang/en/template-tags.json | 77 +++++++++++++++------- .../serversetup-bwlp-ipxe/page.inc.php | 2 +- .../sysconfig/lang/de/template-tags.json | 2 + .../sysconfig/lang/en/template-tags.json | 2 + 21 files changed, 142 insertions(+), 68 deletions(-) (limited to 'modules-available/exams') diff --git a/modules-available/dozmod/lang/de/permissions.json b/modules-available/dozmod/lang/de/permissions.json index 6475f7ab..8e743e5c 100644 --- a/modules-available/dozmod/lang/de/permissions.json +++ b/modules-available/dozmod/lang/de/permissions.json @@ -4,12 +4,12 @@ "ldapfilters.save": "LDAP Filter speichern.", "ldapfilters.view": "LDAP Filter einsehen.", "mailconfig.save": "\u00c4nderungen an der SMTP-Konfiguration zum Versenden von Mails speichern.", - "networkrules.save": "Netzwerk-Regeln einsehen.", - "networkrules.view": "\u00c4nderungen an den Netzwerk-Regeln speichern.", - "networkshares.save": "Netzlaufwerke einsehen.", - "networkshares.view": "\u00c4nderungen an den Netzlaufwerken speichern.", - "runscripts.save": "Startkripte erstellen\/bearbeiten", - "runscripts.view": "Startscripte auflisten", + "networkrules.save": "\u00c4nderungen an den Netzwerk-Regeln speichern.", + "networkrules.view": "Netzwerk-Regeln einsehen.", + "networkshares.save": "\u00c4nderungen an den Netzlaufwerken speichern.", + "networkshares.view": "Netzlaufwerke einsehen.", + "runscripts.save": "Startkripte erstellen\/bearbeiten.", + "runscripts.view": "Startscripte auflisten.", "runtimeconfig.save": "\u00c4nderungen an der Laufzeit-Konfiguration speichern.", "templates.reset": "E-Mail Templates zur\u00fccksetzen.", "templates.save": "E-Mail Templates speichern.", diff --git a/modules-available/dozmod/lang/de/template-tags.json b/modules-available/dozmod/lang/de/template-tags.json index 320c7592..3e000676 100644 --- a/modules-available/dozmod/lang/de/template-tags.json +++ b/modules-available/dozmod/lang/de/template-tags.json @@ -70,6 +70,7 @@ "lang_modified": "Modifiziert", "lang_name": "Name", "lang_networkrules": "Netzwerk-Regeln", + "lang_networkrulesIntro": "Hier k\u00f6nnen Sie vordefinierte Regelsets f\u00fcr das Firewalling verwalten. Nutzer der bwLehrpool-Suite k\u00f6nnen auf diese Regelsets zur\u00fcckgreifen, um den Netzwerkzugriff ihrer Veranstaltungen einzuschr\u00e4nken.", "lang_networkshares": "Netzlaufwerke", "lang_networksharesIntro": "Hier k\u00f6nnen Sie vordefinierte Netzlaufwerke anlegen, die den Nutzern der bwLehrpool-Suite zur Auswahl gestellt werden. Es ist den Nutzern der bwLehrpool-Suite weiterhin m\u00f6glich, komplett eigene Netzwerkfreigaben zu definieren. Die Angaben hier sollen lediglich das Hinzuf\u00fcgen h\u00e4ufig genutzter Laufwerke vereinfachen, bzw. das \u00c4ndern eines Netzwerkpfades vereinfachen, da in diesem Fall nur der Zentrale Eintrag hier angepasst werden muss, und nicht mehr wie zuvor jede Veranstaltung einzeln.", "lang_none": "(Keiner)", @@ -86,6 +87,7 @@ "lang_reallyResetTemplates": "Sind Sie sicher, dass Sie alle Texte l\u00f6schen und auf die Standardwerte zur\u00fccksetzen wollen?", "lang_replaceWithOriginal": "Originaltext in Textbox laden", "lang_replyTo": "Reply-To Adresse", + "lang_ruleDeleteConfirm": "Soll dieses Regelset wirklich gel\u00f6scht werden?", "lang_runScriptAdd": "Skript hinzuf\u00fcgen", "lang_runScriptDeleteConfirmation": "Skript wirklich l\u00f6schen?", "lang_runtimeConfig": "Laufzeit-Konfiguration", @@ -129,4 +131,4 @@ "lang_usernameplaceholder": "SMTP-Benutzername", "lang_version": "Version vom", "lang_when": "Wann" -} +} \ No newline at end of file diff --git a/modules-available/dozmod/lang/en/messages.json b/modules-available/dozmod/lang/en/messages.json index 6d8296ec..2d813efc 100644 --- a/modules-available/dozmod/lang/en/messages.json +++ b/modules-available/dozmod/lang/en/messages.json @@ -24,6 +24,8 @@ "networkshare-saved": "Network share saved", "no-expired-images": "No expired VMs", "nothing-submitted": "There was nothing submitted", + "runscript-invalid-id": "Invalid script id: {{0}}", + "runscript-saved": "Script has been saved", "runtimelimits-config-saved": "Configuration saved successfully", "templates-saved": "Templates saved successfully", "timeout": "Timeout", diff --git a/modules-available/dozmod/lang/en/module.json b/modules-available/dozmod/lang/en/module.json index 8967493d..5bcee464 100644 --- a/modules-available/dozmod/lang/en/module.json +++ b/modules-available/dozmod/lang/en/module.json @@ -7,6 +7,7 @@ "submenu_mailconfig": "email configuration", "submenu_networkrules": "Network Rules", "submenu_networkshares": "Network Shares", + "submenu_runscripts": "Startup scripts", "submenu_runtimeconfig": "limits and defaults", "submenu_templates": "templates", "submenu_users": "users and permissions" diff --git a/modules-available/dozmod/lang/en/permissions.json b/modules-available/dozmod/lang/en/permissions.json index dec3171a..b0fbb071 100644 --- a/modules-available/dozmod/lang/en/permissions.json +++ b/modules-available/dozmod/lang/en/permissions.json @@ -4,10 +4,12 @@ "ldapfilters.save": "Save LDAP filter.", "ldapfilters.view": "View LDAP filters. ", "mailconfig.save": "Save SMTP configuration for sending mails.", - "networkrules.save": "View network rules.", - "networkrules.view": "Save network rules.", - "networkshares.save": "View network drives.", - "networkshares.view": "Save network drives.", + "networkrules.save": "Save network rules.", + "networkrules.view": "View network rules.", + "networkshares.save": "Save network drives.", + "networkshares.view": "View network drives.", + "runscripts.save": "Save startup scripts.", + "runscripts.view": "View startup scripts.", "runtimeconfig.save": "Save limits and defaults of a runtime configuration.", "templates.reset": "Reset email templates.", "templates.save": "Save email templates.", diff --git a/modules-available/dozmod/lang/en/template-tags.json b/modules-available/dozmod/lang/en/template-tags.json index 3f2ae1fc..c33d872b 100644 --- a/modules-available/dozmod/lang/en/template-tags.json +++ b/modules-available/dozmod/lang/en/template-tags.json @@ -28,6 +28,7 @@ "lang_dozmodLogHeading": "bwLehrpool-Suite action log", "lang_editNetworkrule": "Edit Network Rule", "lang_editNetworkshare": "Edit Network Share", + "lang_editScript": "Edit start script", "lang_email": "E-Mail", "lang_emailNotifications": "E-Mail notifications enabled", "lang_error": "Error", @@ -37,6 +38,7 @@ "lang_hasNewer": "newer version exists", "lang_hash": "Hash", "lang_heading": "Images Marked for Deletion", + "lang_hidden": "Hidden", "lang_host": "Host", "lang_image": "VM", "lang_lastEditor": "Edited by", @@ -63,13 +65,16 @@ "lang_maxLectureVisibility": "Max time lecture end date may lie in the future (days)", "lang_maxLocationsPerLecture": "Max. explicit locations per lecture", "lang_maxTransfers": "Max concurrent transfers per user", + "lang_minimized": "Minimized", "lang_miscOptions": "Misc options", "lang_modified": "modified", "lang_name": "Name", "lang_networkrules": "Network Rules", + "lang_networkrulesIntro": "This is where you can create predefined rulesets for the lecture-based firewalling. bwLehrpool-Suite users can select those rulesets to limit network access of their lectures.", "lang_networkshares": "Network Shares", "lang_networksharesIntro": "This is the list of predefined network shares. bwLehrpool-Suite users can still add custom network shares to their lectures, however having commonly used network shares as predefined entries should be much more convenient. Another advantage is that changing the path of a network share centrally avoids having to edit a dozen lectures' configuration manually.", "lang_none": "(none)", + "lang_normal": "Normal", "lang_organization": "Organization", "lang_organizationListHeader": "Set access permissions for organizations", "lang_os": "Operating System", @@ -82,8 +87,23 @@ "lang_reallyResetTemplates": "Are you sure you want to reset all texts to their default values?", "lang_replaceWithOriginal": "load original text into text box", "lang_replyTo": "Reply-To address", + "lang_ruleDeleteConfirm": "Do you want to delete this ruleset?", + "lang_runScriptAdd": "Add run-script", + "lang_runScriptDeleteConfirmation": "Do you want to delete this run-script?", "lang_runtimeConfig": "Limits and Defaults", "lang_runtimeConfigLimits": "Limitations", + "lang_scriptContent": "Script content", + "lang_scriptExtension": "Script extension", + "lang_scriptExtensionHead": "Extension", + "lang_scriptIsGlobal": "Global script, will execute in every lecture environment", + "lang_scriptIsGlobalHead": "Global", + "lang_scriptIsPredefined": "Predefined script, selectable by bwLehrpool-Suite users for individual lectures", + "lang_scriptPassCredentials": "Pass username and password to this script", + "lang_scriptPassCredentialsHead": "User\/Pass", + "lang_scriptVisibility": "Display mode", + "lang_scriptVisibilityHead": "Display", + "lang_scriptsHead": "Run-scripts for lecture environments", + "lang_scriptsIntro": "Here you can define scripts that will either forcefully run at startup of a lecture, or are selectable by bwLehrpool-Suite users.", "lang_senderAddress": "Sender address", "lang_senderName": "Sender's display name", "lang_shareDeleteConfirm": "Do you really want to delete this network share?", diff --git a/modules-available/dozmod/page.inc.php b/modules-available/dozmod/page.inc.php index b772890f..67b791d1 100644 --- a/modules-available/dozmod/page.inc.php +++ b/modules-available/dozmod/page.inc.php @@ -63,6 +63,7 @@ class Page_DozMod extends Page Dictionary::translate('submenu_networkshares', true); Dictionary::translate('submenu_ldapfilters', true); Dictionary::translate('submenu_runscripts', true); + Dictionary::translate('submenu_networkrules', true); */ /* add sub-menus */ diff --git a/modules-available/exams/lang/de/template-tags.json b/modules-available/exams/lang/de/template-tags.json index 1dd51374..0fbaf0a1 100644 --- a/modules-available/exams/lang/de/template-tags.json +++ b/modules-available/exams/lang/de/template-tags.json @@ -1,5 +1,4 @@ { - "lang_actions": "Aktionen", "lang_addExam": "Zeitraum hinzuf\u00fcgen", "lang_addingBasedOnLecture": "F\u00fcge neuen Pr\u00fcfungszeitraum basierend auf vorhandener Veranstaltung an", "lang_allExamPeriods": "Alle Pr\u00fcfungszeitr\u00e4ume", @@ -16,7 +15,6 @@ "lang_deleteConfirmation": "Wirklich l\u00f6schen?", "lang_description": "Beschreibung", "lang_duration": "Dauer", - "lang_editExam": "Zeitraum bearbeiten", "lang_end": "Ende", "lang_end_date": "Ende Datum", "lang_end_time": "Uhrzeit", diff --git a/modules-available/exams/lang/en/template-tags.json b/modules-available/exams/lang/en/template-tags.json index 23266154..52173740 100644 --- a/modules-available/exams/lang/en/template-tags.json +++ b/modules-available/exams/lang/en/template-tags.json @@ -1,5 +1,4 @@ { - "lang_actions": "Actions", "lang_addExam": "Add exam period", "lang_addingBasedOnLecture": "Adding exam period based on lecture", "lang_allExamPeriods": "All Exam Periods", @@ -16,7 +15,6 @@ "lang_deleteConfirmation": "Are you sure?", "lang_description": "Description", "lang_duration": "Duration", - "lang_editExam": "Edit exam period", "lang_end": "End", "lang_end_date": "End Date", "lang_end_time": "Time", diff --git a/modules-available/main/lang/de/categories.json b/modules-available/main/lang/de/categories.json index 71f149ec..587200ed 100644 --- a/modules-available/main/lang/de/categories.json +++ b/modules-available/main/lang/de/categories.json @@ -3,6 +3,5 @@ "content": "Inhalt", "settings-client": "Einstellungen (Client)", "settings-server": "Einstellungen (Server)", - "status": "Status", - "users": "Benutzer" + "status": "Status" } \ No newline at end of file diff --git a/modules-available/main/lang/en/categories.json b/modules-available/main/lang/en/categories.json index 9dfa0404..f73f0a15 100644 --- a/modules-available/main/lang/en/categories.json +++ b/modules-available/main/lang/en/categories.json @@ -3,6 +3,5 @@ "content": "Content", "settings-client": "Settings (Client)", "settings-server": "Settings (Server)", - "status": "Status", - "users": "Users" + "status": "Status" } \ No newline at end of file diff --git a/modules-available/serversetup-bwlp-ipxe/lang/de/messages.json b/modules-available/serversetup-bwlp-ipxe/lang/de/messages.json index 0772a7e4..8c5aab54 100644 --- a/modules-available/serversetup-bwlp-ipxe/lang/de/messages.json +++ b/modules-available/serversetup-bwlp-ipxe/lang/de/messages.json @@ -16,6 +16,5 @@ "menu-set-default": "Standardmen\u00fc wurde gesetzt", "missing-bootentry-data": "Fehlende Daten f\u00fcr den Men\u00fceintrag", "no-ip-addr-set": "Bitte w\u00e4hlen Sie die prim\u00e4re IP-Adresse des Servers", - "no-such-menu": "Men\u00fc mit ID {{0}} existiert nicht", "unknown-bootentry-type": "Unbekannter Eintrags-Typ: {{0}}" -} +} \ No newline at end of file diff --git a/modules-available/serversetup-bwlp-ipxe/lang/de/permissions.json b/modules-available/serversetup-bwlp-ipxe/lang/de/permissions.json index 5cd02119..9d7e77c6 100644 --- a/modules-available/serversetup-bwlp-ipxe/lang/de/permissions.json +++ b/modules-available/serversetup-bwlp-ipxe/lang/de/permissions.json @@ -2,7 +2,6 @@ "access-page": "Seite sehen.", "download": "USB-Image herunterladen.", "edit.address": "Boot-Adresse des Servers ausw\u00e4hlen.", - "edit.menu": "Bootmen\u00fc anpassen.", "ipxe.bootentry.edit": "Einen Boot-Eintrag bearbeiten.", "ipxe.bootentry.view": "Liste aller Boot-Eintr\u00e4ge sehen.", "ipxe.localboot.edit": "Ausnahmeliste f\u00fcr Localboot-Modus bearbeiten.", diff --git a/modules-available/serversetup-bwlp-ipxe/lang/de/template-tags.json b/modules-available/serversetup-bwlp-ipxe/lang/de/template-tags.json index 198a1517..525b1562 100644 --- a/modules-available/serversetup-bwlp-ipxe/lang/de/template-tags.json +++ b/modules-available/serversetup-bwlp-ipxe/lang/de/template-tags.json @@ -10,12 +10,7 @@ "lang_assignMenuToLocation": "Ort ein Men\u00fc zuweisen", "lang_biosOnly": "Nur BIOS", "lang_bootAddress": "Boot-Adresse des Servers", - "lang_bootBehavior": "Standard-Bootverhalten", "lang_bootEntryData": "Daten des Men\u00fceintrags", - "lang_bootHint": "Das Bootmen\u00fc muss nach einer \u00c4nderung der IP-Adresse neu generiert werden. In der Regel geschieht dies automatisch, der Vorgang kann in der Sektion Bootmen\u00fc allerdings auch manuell ausgel\u00f6st werden.", - "lang_bootInfo": "Hier k\u00f6nnen Anpassungen am Erscheinungsbild des Bootmen\u00fcs vorgenommen werden.", - "lang_bootMenu": "Bootmen\u00fc", - "lang_bootMenuCreate": "Bootmen\u00fc erzeugen", "lang_bootentryDeleteConfirm": "Sind Sie sicher, dass Sie diesen Men\u00fceintrag l\u00f6schen wollen?", "lang_bootentryHead": "Men\u00fceintr\u00e4ge", "lang_bootentryIntro": "Hier k\u00f6nnen Sie Men\u00fceintr\u00e4ge definieren, die sich sp\u00e4ter einem Men\u00fc zuweisen lassen. Ein Men\u00fceintrag besteht entweder aus einem zu ladenen Kernel\/Image plus optional initrd, oder aus einem iPXE-Script.", @@ -23,7 +18,6 @@ "lang_chooseIP": "Bitte w\u00e4hlen Sie die IP-Adresse, \u00fcber die der Server von den Clients zum Booten angesprochen werden soll.", "lang_commandLine": "Command line", "lang_count": "Anzahl", - "lang_customEntry": "Eigener Eintrag", "lang_downloadBootImage": "Boot-Image herunterladen", "lang_downloadRufus": "Rufus herunterladen", "lang_editBuiltinWarn": "Achtung! Sie bearbeiten einen der vorgegebenen Eintr\u00e4ge! Bei einem Update k\u00f6nnten Ihre \u00c4nderungen wieder \u00fcberschrieben werden", @@ -32,13 +26,11 @@ "lang_entryChooserTitle": "Men\u00fceintrag ausw\u00e4hlen", "lang_entryId": "ID", "lang_entryTitle": "Bezeichnung", - "lang_example": "Beispiel", "lang_execAutoUnload": "Nach Ausf\u00fchrung entladen (--autofree)", "lang_execReplace": "Aktuellen iPXE-Stack erstzen (--replace)", "lang_execResetConsole": "Konsole vor Ausf\u00fchrung zur\u00fccksetzen", "lang_forceRecompile": "Jetzt neu compilieren", "lang_generationFailed": "Erzeugen des Bootmen\u00fcs fehlgeschlagen. Der Netzwerkboot von bwLehrpool wird wahrscheinlich nicht funktionieren. Wenn Sie den Fehler nicht selbst beheben k\u00f6nnen, melden Sie bitte die Logausgabe an das bwLehrpool-Projekt.", - "lang_globalMenuWarning": "Dieses Men\u00fc ist keinem Raum zugeordnet", "lang_hotkey": "Hotkey", "lang_idFormatHint": "(Max. 16 Zeichen, nur a-z 0-9 - _)", "lang_imageToLoad": "Zu ladendes Image (z.B. Kernel)", @@ -50,20 +42,11 @@ "lang_localBootExceptions": "Ausnahmen, pro Rechnermodell definierbar", "lang_localBootHead": "Boot von Festplatte", "lang_localBootIntro": "Aus dem iPXE Bootmen\u00fc kann auf verschiedene Arten ein Boot von der prim\u00e4ren Festplatte ausgel\u00f6st werden. In den allermeisten F\u00e4llen ist die Einstellung \"AUTO\" ausreichend, bei bestimmten Rechnermodellen kann es allerdings erforderlich sein, eine der alternativen Methoden zu erzwingen. Falls Sie einem solchen Modell begegnen, k\u00f6nnen Sie im unteren Teil dieser Seite eine solche Ausnahme festlegen. In einigen F\u00e4llen l\u00e4sst sich das Problem auch durch ein BIOS-Update auf den entsprechenden Ger\u00e4ten beheben.", - "lang_localHDD": "Lokale HDD", "lang_locationCount": "Anzahl Orte", - "lang_masterPassword": "Master-Passwort", - "lang_masterPasswordHelp": "Das Master-Passwort wird ben\u00f6tigt, um einen Men\u00fceintrag direkt am Client tempor\u00e4r durch Dr\u00fccken der Tab-Taste zu editieren. Da dies f\u00fcr Manipulation am Client genutzt werden kann, sollte diese Funktion unbedingt mit einem Passwort gesch\u00fctzt werden.", - "lang_menuCustom": "Benutzerdefinierter Men\u00fczusatz", - "lang_menuCustomHint1": "Hier haben Sie die M\u00f6glichkeit, eigenen Men\u00fc-Code zum angezeigten PXE-Men\u00fc hinzuzuf\u00fcgen, um z.B. auf weitere PXE-Server zu verweisen. Das Format entspricht dem syslinux Men\u00fcformat.", - "lang_menuCustomHint2": "Sie k\u00f6nnen ein oder mehrere Eintr\u00e4ge erzeugen. Wenn Sie einen Eintrag erzeugen m\u00f6chten, der automatisch gestartet wird, wenn der Benutzer keine Auswahl t\u00e4tigt, vergeben Sie als", - "lang_menuCustomHint3": "und w\u00e4hlen Sie als Standard-Bootverhalten ebenfalls custom.", "lang_menuDeleteConfirm": "Sind Sie sicher, dass Sie dieses Men\u00fc l\u00f6schen wollen?", - "lang_menuDisplayTime": "Anzeigedauer des Men\u00fcs", "lang_menuEntryOverride": "Standardeintrag \u00fcberschreiben", "lang_menuGeneration": "Erzeugen des Bootmen\u00fcs", "lang_menuListIntro": "Hier sehen Sie eine Liste aller vorhandenen Men\u00fcs, deren Zuordnung zu R\u00e4umen sowie die M\u00f6glichkeit, diese zu editieren oder l\u00f6schen. Um ein Men\u00fc einem bestimmten Raum zuzuweisen, besuchen Sie bitte den Men\u00fcpunkt \"R\u00e4ume\/Orte\".", - "lang_menuLocations": "Zugewiesene Orte", "lang_menuTimeout": "Timeout", "lang_menuTitle": "Men\u00fc", "lang_moduleHeading": "iPXE \/ Boot Menu", @@ -71,7 +54,6 @@ "lang_newMenu": "Neues Men\u00fc", "lang_none": "(keine)", "lang_override": "\u00dcberschreiben", - "lang_pxeBuilt": "PXE-Binary gebaut", "lang_recompileHint": "iPXE-Binaries jetzt neu kompilieren. Normalerweise wird dieser Vorgang bei \u00c4nderungen automatisch ausgef\u00fchrt. Sollten Bootprobleme auftreten, k\u00f6nnen Sie hier den Vorgang manuell ansto\u00dfen.", "lang_refCount": "Referenzen", "lang_referencingMenus": "Verkn\u00fcpfte Men\u00fcs", @@ -83,7 +65,6 @@ "lang_title": "Titel", "lang_typeExecEntry": "Standardeintrag", "lang_typeScriptEntry": "Benutzerdefiniertes Script", - "lang_usbBuilt": "USB-Image gebaut", "lang_usbImage": "USB-Image", "lang_usbImgHelp": "Mit dem USB-Image k\u00f6nnen Sie einen bootbaren USB-Stick erstellen, \u00fcber den sich bwLehrpool an Rechnern starten l\u00e4sst, die keinen Netzwerkboot unterst\u00fctzen, bzw. f\u00fcr die keine entsprechende DHCP-Konfiguration vorhanden ist. Dies erfordert dann lediglich, dass in der BIOS-Konfiguration des Rechners USB-Boot zugelassen ist. Der Stick dient dabei lediglich als Einstiegspunkt; es ist nach wie vor ein bwLehrpool-Satellitenserver f\u00fcr den eigentlichen Bootvorgang von N\u00f6ten.", "lang_usbImgHelpBtn": "Bootbaren USB-Stick erstellen", @@ -91,4 +72,4 @@ "lang_usbImgHelpWindows": "Unter Windows muss zun\u00e4chst ein Programm besorgt werden, mit dem sich Images direkt auf einen USB-Stick schreiben lassen. Es gibt gleich mehrere kostenlose und quelloffene Programme, eines davon ist Rufus. Rufus wurde mit dem bwLehrpool-Image gestetet. Nach dem Starten des Programms ist lediglich das heruntergeladene Image zu \u00f6ffnen, sowie in der Liste der Laufwerke der richtige USB-Stick auszuw\u00e4hlen (damit Sie nicht versehentlich Daten auf dem falschen Laufwerk \u00fcberschreiben!)", "lang_useDefaultMenu": "\u00dcbergeordnetes Men\u00fc verwenden", "lang_useDefaultMenuEntry": "(Vorgabe des Men\u00fcs)" -} +} \ No newline at end of file diff --git a/modules-available/serversetup-bwlp-ipxe/lang/en/messages.json b/modules-available/serversetup-bwlp-ipxe/lang/en/messages.json index d4ba6905..dcdf4be1 100644 --- a/modules-available/serversetup-bwlp-ipxe/lang/en/messages.json +++ b/modules-available/serversetup-bwlp-ipxe/lang/en/messages.json @@ -1,5 +1,20 @@ { + "boot-entry-created": "Created menu item {{0}}", + "boot-entry-updated": "Updated menu item {{0}}", + "bootentry-deleted": "Deleted menu item", + "error-saving-entry": "Error saving item {{0}}: {{1}}", "image-not-found": "USB image not found. Try regenerating the boot menu first.", + "invalid-boot-entry": "Invalid menu item: {{0}}", "invalid-ip": "No interface is configured with the address {{0}}", - "no-ip-addr-set": "Please set the server's primary IP address" + "invalid-menu-id": "Invalid menu id: {{0}}", + "localboot-invalid-method": "Invalid localboot method: {{0}}", + "localboot-saved": "Localboot settings have been saved", + "location-menu-assigned": "Assigned menu to {{0}}", + "location-use-default": "{{0}} is now using the inherited\/default menu", + "menu-deleted": "Menu deleted", + "menu-saved": "Menu saved", + "menu-set-default": "Default menu has been set", + "missing-bootentry-data": "Missing data for menu item", + "no-ip-addr-set": "Please set the server's primary IP address", + "unknown-bootentry-type": "Unknown item type: {{0}}" } \ No newline at end of file diff --git a/modules-available/serversetup-bwlp-ipxe/lang/en/module.json b/modules-available/serversetup-bwlp-ipxe/lang/en/module.json index aeea610c..9e73e865 100644 --- a/modules-available/serversetup-bwlp-ipxe/lang/en/module.json +++ b/modules-available/serversetup-bwlp-ipxe/lang/en/module.json @@ -1,3 +1,19 @@ { - "module_name": "iPXE \/ Boot Menu" + "dl-efi": "UEFI", + "dl-hd": "HDD partition image", + "dl-i386": "32 bit", + "dl-lkrn": "wrapped in kernel header", + "dl-pcbios": "legacy BIOS", + "dl-pcinic": "with PCI(e) NIC drivers", + "dl-snp": "uses SNP\/NII interface", + "dl-usb": "thumb drive image", + "dl-usbnic": "with USB NIC drivers", + "dl-x86_64": "64 bit", + "module_name": "iPXE \/ Boot Menu", + "page_title": "iPXE and boot settings", + "submenu_address": "Server address", + "submenu_bootentry": "Manage menu items", + "submenu_download": "Downloads", + "submenu_localboot": "HDD boot", + "submenu_menu": "Manage menus" } \ No newline at end of file diff --git a/modules-available/serversetup-bwlp-ipxe/lang/en/permissions.json b/modules-available/serversetup-bwlp-ipxe/lang/en/permissions.json index 44d1c519..53ccec3a 100644 --- a/modules-available/serversetup-bwlp-ipxe/lang/en/permissions.json +++ b/modules-available/serversetup-bwlp-ipxe/lang/en/permissions.json @@ -2,5 +2,10 @@ "access-page": "View page.", "download": "Download USB Image.", "edit.address": "Choose boot address of the server.", - "edit.menu": "Customize boot menu." + "ipxe.bootentry.edit": "Edit menu items.", + "ipxe.bootentry.view": "View menu items.", + "ipxe.localboot.edit": "Edit local boot settings.", + "ipxe.menu.assign": "Assign menus to locations.", + "ipxe.menu.edit": "Edit menus.", + "ipxe.menu.view": "View menus." } \ No newline at end of file diff --git a/modules-available/serversetup-bwlp-ipxe/lang/en/template-tags.json b/modules-available/serversetup-bwlp-ipxe/lang/en/template-tags.json index 121ed3e7..ea57c522 100644 --- a/modules-available/serversetup-bwlp-ipxe/lang/en/template-tags.json +++ b/modules-available/serversetup-bwlp-ipxe/lang/en/template-tags.json @@ -1,42 +1,75 @@ { "lang_active": "Active", + "lang_add": "Add", "lang_addBootentry": "Add Bootentry", "lang_addMenu": "Add Menu", + "lang_additionalInfoLink": "Read more", + "lang_archAgnostic": "Architecture-agnostic", + "lang_archBoth": "BIOS and EFI", + "lang_archSelector": "Select architecture", + "lang_assignMenuToLocation": "Assign menu to location", + "lang_biosOnly": "BIOS only", "lang_bootAddress": "Boot Address of the Server", - "lang_bootBehavior": "Default Boot Behavior", - "lang_bootentryTitle": "Bootentry", - "lang_bootHint": "The Boot menu must be recreated after changing the IP address. Usually this is done automatically, but the process can also be triggered manually in the section of the boot menu.", - "lang_bootInfo": "Here adjustments can be made to the appearance of the boot menu.", - "lang_bootMenu": "Boot Menu", - "lang_bootMenuCreate": "Create Boot Menu", + "lang_bootEntryData": "Menu entry data", + "lang_bootentryDeleteConfirm": "Are you sure you want to delete this menu item?", + "lang_bootentryHead": "Menu items", + "lang_bootentryIntro": "This is where you can add, edit and remove menu items, which can be added to menus. A menu entry is either a combination of a kernel\/image to load (and an optional initrd), or a custom iPXE-script.", + "lang_bootentryTitle": "Menu item", "lang_chooseIP": "Please select the IP address that the client server will use to boot.", - "lang_customEntry": "Custom entry", - "lang_bootentryDeleteConfirm": "Are you sure you want to delete this bootentry?", - "lang_menuDeleteConfirm": "Are you sure you want to delete this menu?", - "lang_downloadImage": "Download USB Image", + "lang_commandLine": "Command line", + "lang_count": "Count", + "lang_downloadBootImage": "Download boot-image", "lang_downloadRufus": "Download Rufus", - "lang_example": "Example", + "lang_editBuiltinWarn": "WARNING! You're editing a predefined item. Future updates might reset your changes!", + "lang_editMenuHead": "Edit menu", + "lang_efiOnly": "EFI only", + "lang_entryChooserTitle": "Select menu item", + "lang_entryId": "ID", + "lang_entryTitle": "Title", + "lang_execAutoUnload": "Unload after execution (--autofree)", + "lang_execReplace": "Replace current iPXE stack (--replace)", + "lang_execResetConsole": "Reset console before execution", + "lang_forceRecompile": "Force recompile", "lang_generationFailed": "Could not generate boot menu. The bwLehrpool-System might not work properly. If you can't fix the problem, please report the error log below to the bwLehrpool project.", + "lang_hotkey": "Hotkey", + "lang_idFormatHint": "(16 chars max, a-z 0-9 - _)", + "lang_imageToLoad": "Image to load (e.g. kernel)", + "lang_initRd": "Optional initrd\/initramfs to load", + "lang_ipxeWikiUrl": "at the iPXE wiki", "lang_isDefault": "Default", "lang_listOfMenus": "Menulist", - "lang_localHDD": "Local HDD", + "lang_localBootDefault": "Default method to use for booting from disk", + "lang_localBootExceptions": "Exceptions to the local boot method, defined per system model", + "lang_localBootHead": "Boot from local disk", + "lang_localBootIntro": "There are several methods to trigger a local boot from the iPXE environment. In most cases, the \"AUTO\" setting will work, but with some system models it might be necessary to override the default behavior. In some instances, a BIOS update might resolve the issue as well.", "lang_locationCount": "Number of Locations", - "lang_masterPassword": "Master Password", - "lang_masterPasswordHelp": "The master password is required to edit a boot menu entry. This should be set for security reasons.", - "lang_menuCustom": "Custom Extra Menu", - "lang_menuCustomHint1": "Here you have the opportunity to add your own menu code to the displayed PXE menu, eg to refer to other PXE server. The format corresponds to the syslinux menu format.", - "lang_menuCustomHint2": "You can create one or more entries. If you want to create an entry that starts automatically when the user makes a selection, assign as", - "lang_menuCustomHint3": "and select as the default boot behavior custom as well.", - "lang_menuDisplayTime": "Menu Display Time", + "lang_menuDeleteConfirm": "Are you sure you want to delete this menu?", + "lang_menuEntryOverride": "Override default selection", "lang_menuGeneration": "Generating boot menu...", + "lang_menuListIntro": "This is the list of iPXE menus, with information about assigned locations. You can create, edit and delete additional menus.", + "lang_menuTimeout": "Timeout", "lang_menuTitle": "Menu", "lang_moduleHeading": "iPXE \/ Boot Menu", - "lang_pxeBuilt": "Built PXE binary", + "lang_newBootEntryHead": "New menu item", + "lang_newMenu": "New menu", + "lang_none": "(none)", + "lang_override": "Override", + "lang_recompileHint": "Recompile iPXE binaries now. Usually this happens automatically on changes, but if you suspect problems caused by outdated binaries, you can trigger recompilation here.", + "lang_refCount": "References", + "lang_referencingMenus": "Referencing menus", + "lang_scriptContent": "Script content", "lang_seconds": "Seconds", "lang_set": "Set", - "lang_usbBuilt": "Built USB image", + "lang_spacer": "Spacer", + "lang_systemmodel": "System model", + "lang_title": "Title", + "lang_typeExecEntry": "Standardeintrag", + "lang_typeScriptEntry": "Custom script", "lang_usbImage": "USB image", "lang_usbImgHelp": "The USB image can be used to create a bootable USB stick, which enables you to boot bwLehrpool without changing your DHCP settings or enabling network boot in the clients. The only requirement is that you enable USB boot in the client's BIOS. The USB stick is only used for bootstrapping, the actual bwLehrpool system is still loaded via network from your local bwLehrpool server.", + "lang_usbImgHelpBtn": "Create bootable thumb drive", "lang_usbImgHelpLinux": "On Linux you can simply use dd to write the image to a usb stick. The image already contains a partition table, so make sure you write the image to the device itself and not to an already existing partition (e.g. to \/dev\/sdx not \/dev\/sdx1)", - "lang_usbImgHelpWindows": "On Windows you need to use a 3rd party tool that can directly write to usb sticks. There are several free and open source soltions, one of them being Rufus. Rufus has been tested with the bwLehrpool image and is very simple to use. After launching Rufus, just open the downloaded USB image, select the proper USB stick to write to (be careful not to overwrite the wrong drive!), and you're ready to go." + "lang_usbImgHelpWindows": "On Windows you need to use a 3rd party tool that can directly write to usb sticks. There are several free and open source soltions, one of them being Rufus. Rufus has been tested with the bwLehrpool image and is very simple to use. After launching Rufus, just open the downloaded USB image, select the proper USB stick to write to (be careful not to overwrite the wrong drive!), and you're ready to go.", + "lang_useDefaultMenu": "Inherit from parent location", + "lang_useDefaultMenuEntry": "(Menu default)" } \ No newline at end of file diff --git a/modules-available/serversetup-bwlp-ipxe/page.inc.php b/modules-available/serversetup-bwlp-ipxe/page.inc.php index bb69fecf..6f95d754 100644 --- a/modules-available/serversetup-bwlp-ipxe/page.inc.php +++ b/modules-available/serversetup-bwlp-ipxe/page.inc.php @@ -552,7 +552,7 @@ class Page_ServerSetup extends Page FROM serversetup_menu m WHERE menuid = :id", compact('id')); if ($menu === false) { - Message::addError('no-such-menu', $id); + Message::addError('invalid-menu-id', $id); return; } $insertParams['menuid'] = $id; diff --git a/modules-available/sysconfig/lang/de/template-tags.json b/modules-available/sysconfig/lang/de/template-tags.json index 1a09abbd..2a7a02d6 100644 --- a/modules-available/sysconfig/lang/de/template-tags.json +++ b/modules-available/sysconfig/lang/de/template-tags.json @@ -47,6 +47,8 @@ "lang_fixNumeric": "Numerischen Account-Namen muss ein 's' vorangestellt werden", "lang_fixNumericDescription": "Wenn Sie diese Option aktivieren, m\u00fcssen Benutzer, deren Account-Name nur aus Ziffern besteht, diesem ein 's' voranstellen beim Login. Diese Option ist beim alten Login-Manager (KDM) zwingend erforderlich, da sonst der Loginvorgang fehlschl\u00e4gt. Mit dem neuen lightdm-basierten Login-Screen lassen sich numerische Account-Namen jedoch direkt verwenden. Wenn Sie an Ihrer Einrichtung keine numerischen Account-Namen verwenden, hat diese Option keine Auswirkung.", "lang_folderRedirection": "Folder Redirection", + "lang_genUid": "uid-Nummern generieren", + "lang_genUidDescription": "Wenn aktiviert, generiert der Satellitenserver nummerische IDs f\u00fcr die Benutzer, anstatt diese aus dem LDAP\/AD zu extrahieren.", "lang_generateModule": "Modul erzeugen", "lang_handlingNotes": "Hier k\u00f6nnen Sie festlegen, wie Netzwerk-Shares (inkl. des Home-Verzeichnisses) an Virtuelle Maschinen durchgereicht werden. In \u00e4lteren Versionen von bwLehrpool wurden die VMware Shared Folders genutzt, was mit bestimmten file servern Probleme verursachen konnte. Der neue native Modus funktioniert deutlich besser, ist aber bei Windows-G\u00e4sten darauf angewiesen, dass (1) der file server smb\/cifs spricht (z.B. Windows Server, Samba unter Linux) und (2) die openslx.exe im Autostart eingebunden ist (bei den bwLehrpool Vorlagen bereits der Fall).", "lang_helpHomeAttrHead": "Name des Home-Verzeichnis-Attributs", diff --git a/modules-available/sysconfig/lang/en/template-tags.json b/modules-available/sysconfig/lang/en/template-tags.json index e98038a9..fb02cf42 100644 --- a/modules-available/sysconfig/lang/en/template-tags.json +++ b/modules-available/sysconfig/lang/en/template-tags.json @@ -47,6 +47,8 @@ "lang_fixNumeric": "Numeric account names have to be prefixed by 's'", "lang_fixNumericDescription": "If enabled, users with account names that consist entirely of digits have to prefix their user id by 's' when logging in. This is required with the old login manager (KDM) to prevent crashes. The new lightdm-based login manager will accept numeric account names, so you can leave this option disabled. If your organization doesn't have any numeric account names, this option will have no effect.", "lang_folderRedirection": "Folder Redirection", + "lang_genUid": "Generate uid numbers", + "lang_genUidDescription": "When selected, the satellite server will generate numeric IDs for the users, instead of extracting them from AD\/LDAP.", "lang_generateModule": "Generating module", "lang_handlingNotes": "Here you can configure how network shares (like the user's home directory) are mapped inside the VM. Old Versions of bwLehrpool used the VMware Shared Folder technique, which could cause problems with certain file servers. The new \"native mode\" works much better, but on Windows guests, it requires that you (1) use an smb\/cifs file server (Windows Server, Linux with Samba) and (2) have openslx.exe setup to autorun in the VM (this is already configured for bwLehrpool templates).", "lang_helpHomeAttrHead": "Name of the home directory attribute", -- cgit v1.2.3-55-g7522
    {{lang_id}}