-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
diff --git a/modules-available/adduser/templates/user-permissions.html b/modules-available/adduser/templates/user-permissions.html
new file mode 100644
index 00000000..ce51630f
--- /dev/null
+++ b/modules-available/adduser/templates/user-permissions.html
@@ -0,0 +1,24 @@
+
{{lang_assignRoles}}
+
+
\ No newline at end of file
diff --git a/modules-available/permissionmanager/inc/permissiondbupdate.inc.php b/modules-available/permissionmanager/inc/permissiondbupdate.inc.php
index 1f56f4ea..5f528a37 100644
--- a/modules-available/permissionmanager/inc/permissiondbupdate.inc.php
+++ b/modules-available/permissionmanager/inc/permissiondbupdate.inc.php
@@ -7,17 +7,19 @@ class PermissionDbUpdate
* Insert all user/role combinations into the role_x_user table.
*
* @param int[] $users userids
- * @param string[] $roles roleids
+ * @param int[] $roles roleids
*/
public static function addRoleToUser($users, $roles)
{
+ if (empty($users) || empty($roles))
+ return 0;
$arg = array();
foreach ($users AS $userid) {
foreach ($roles AS $roleid) {
$arg[] = compact('userid', 'roleid');
}
}
- Database::exec("INSERT IGNORE INTO role_x_user (userid, roleid) VALUES :arg",
+ return Database::exec("INSERT IGNORE INTO role_x_user (userid, roleid) VALUES :arg",
['arg' => $arg]);
}
@@ -25,12 +27,28 @@ class PermissionDbUpdate
* Remove all user/role combinations from the role_x_user table.
*
* @param int[] $users userids
- * @param string[] $roles roleids
+ * @param int[] $roles roleids
*/
public static function removeRoleFromUser($users, $roles)
{
+ if (empty($users) || empty($roles))
+ return 0;
$query = "DELETE FROM role_x_user WHERE userid IN (:users) AND roleid IN (:roles)";
- Database::exec($query, array("users" => $users, "roles" => $roles));
+ return Database::exec($query, array("users" => $users, "roles" => $roles));
+ }
+
+ /**
+ * Assign the specified roles to given users, removing any roles from the users
+ * that are not in the given set.
+ *
+ * @param int[] $users list of user ids
+ * @param int[] $roles list of role ids
+ */
+ public static function setRolesForUser($users, $roles)
+ {
+ $count = Database::exec("DELETE FROM role_x_user WHERE userid in (:users) AND roleid NOT IN (:roles)",
+ compact('users', 'roles'));
+ return $count + self::addRoleToUser($users, $roles);
}
/**
@@ -40,7 +58,7 @@ class PermissionDbUpdate
*/
public static function deleteRole($roleid)
{
- Database::exec("DELETE FROM role WHERE roleid = :roleid", array("roleid" => $roleid));
+ return Database::exec("DELETE FROM role WHERE roleid = :roleid", array("roleid" => $roleid));
}
/**
diff --git a/modules-available/permissionmanager/inc/permissionutil.inc.php b/modules-available/permissionmanager/inc/permissionutil.inc.php
index 29663ed9..a3a2b610 100644
--- a/modules-available/permissionmanager/inc/permissionutil.inc.php
+++ b/modules-available/permissionmanager/inc/permissionutil.inc.php
@@ -231,6 +231,28 @@ class PermissionUtil
return $permissions;
}
+ /**
+ * Get all existing roles.
+ *
+ * @param int|false $userid Which user to consider, false = none
+ * @param bool $onlyMatching true = filter roles the user doesn't have
+ * @return array list of roles
+ */
+ public static function getRoles($userid = false, $onlyMatching = true)
+ {
+ if ($userid === false) {
+ return Database::queryAll('SELECT roleid, rolename FROM role ORDER BY rolename ASC');
+ }
+ $ret = Database::queryAll('SELECT r.roleid, r.rolename, u.userid AS hasRole FROM role r
+ LEFT JOIN role_x_user u ON (r.roleid = u.roleid AND u.userid = :userid)
+ GROUP BY r.roleid
+ ORDER BY rolename ASC', ['userid' => $userid]);
+ foreach ($ret as &$role) {
+ settype($role['hasRole'], 'bool');
+ }
+ return $ret;
+ }
+
/**
* Place a permission into the given permission tree.
*
@@ -252,4 +274,5 @@ class PermissionUtil
}
$tree = array('description' => $description, 'location-aware' => $locationAware, 'isLeaf' => true);
}
+
}
\ No newline at end of file
--
cgit v1.2.3-55-g7522
From 74dc127c932c8cf1c8d025b1134b21bd97587428 Mon Sep 17 00:00:00 2001
From: Simon Rettberg
Date: Sat, 24 Feb 2018 12:47:20 +0100
Subject: [adduser] Consistent method naming
---
modules-available/adduser/page.inc.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'modules-available/adduser')
diff --git a/modules-available/adduser/page.inc.php b/modules-available/adduser/page.inc.php
index d1615828..60785d6c 100644
--- a/modules-available/adduser/page.inc.php
+++ b/modules-available/adduser/page.inc.php
@@ -169,7 +169,7 @@ class Page_AddUser extends Page
Render::openTag('form', ['class' => 'form-adduser', 'action' => '?do=adduser', 'method' => 'post']);
Render::addTemplate('page-adduser');
if ($hasUsers) {
- $this->showPermissions();
+ $this->showRoles();
}
Render::closeTag('form');
} elseif ($show === 'edituser') {
@@ -187,7 +187,7 @@ class Page_AddUser extends Page
// TODO: LDAP -> disallow pw change, maybe other fields too?
Render::openTag('form', ['class' => 'form-adduser', 'action' => '?do=adduser', 'method' => 'post']);
Render::addTemplate('page-edituser', $user);
- $this->showPermissions($userid);
+ $this->showRoles($userid);
Render::closeTag('form');
}
} elseif ($show === 'list') {
@@ -204,7 +204,7 @@ class Page_AddUser extends Page
}
}
- private function showPermissions($userid = false)
+ private function showRoles($userid = false)
{
if (!Module::isAvailable('permissionmanager'))
return;
--
cgit v1.2.3-55-g7522
From 3945fad76dc623e784cfb4fedee1978e99958a4e Mon Sep 17 00:00:00 2001
From: Simon Rettberg
Date: Tue, 20 Mar 2018 11:31:25 +0100
Subject: [adduser] Fix delete message, add translations
---
modules-available/adduser/lang/de/messages.json | 3 +++
.../adduser/lang/de/template-tags.json | 4 ++++
modules-available/adduser/lang/en/messages.json | 3 +++
.../adduser/lang/en/template-tags.json | 4 ++++
.../adduser/templates/page-userlist.html | 24 ++++++++++++++++------
5 files changed, 32 insertions(+), 6 deletions(-)
(limited to 'modules-available/adduser')
diff --git a/modules-available/adduser/lang/de/messages.json b/modules-available/adduser/lang/de/messages.json
index 0ab4571f..207e8056 100644
--- a/modules-available/adduser/lang/de/messages.json
+++ b/modules-available/adduser/lang/de/messages.json
@@ -1,8 +1,11 @@
{
"adduser-success": "Benutzer erfolgreich hinzugef\u00fcgt",
+ "cannot-delete-1-self": "Sie k\u00f6nnen nicht den Benutzer mit der ID 1 oder sich selbst l\u00f6schen",
"db-error": "Datenbankfehler: {{0}}",
"password-changed": "Passwort ge\u00e4ndert",
"password-mismatch": "Passwort und Passwortbest\u00e4tigung stimmen nicht \u00fcberein",
+ "roles-updated": "Rollen aktualisiert",
+ "user-deleted": "Benutzer {{0}} gel\u00f6scht",
"user-edited": "Benutzerdaten wurden ge\u00e4ndert",
"user-not-found": "Benutzer mit ID {{0}} nicht gefunden"
}
\ No newline at end of file
diff --git a/modules-available/adduser/lang/de/template-tags.json b/modules-available/adduser/lang/de/template-tags.json
index 0b6b2530..31a7871e 100644
--- a/modules-available/adduser/lang/de/template-tags.json
+++ b/modules-available/adduser/lang/de/template-tags.json
@@ -1,8 +1,10 @@
{
"lang_addUser": "Nutzer hinzuf\u00fcgen",
+ "lang_assignRoles": "Rollen zuweisen",
"lang_changeLoginHint": "Sie k\u00f6nnen den Namen, den der Nutzer beim Login angeben muss, \u00e4ndern. Dies ist nur bei lokalen Nutzern m\u00f6glich, die nicht \u00fcber LDAP\/AD authentifiziert werden.",
"lang_changeOwnPasswordHint": "Ihr eigenes Passwort k\u00f6nnen Sie \u00fcber den Button \"Passwort \u00e4ndern\" im Men\u00fc \u00e4ndern.",
"lang_changePassword": "Neues Passwort",
+ "lang_confirmDelete": "L\u00f6schen best\u00e4tigen",
"lang_confirmation": "Wiederholen",
"lang_createUser": "Benutzer anlegen",
"lang_editUser": "Benutzer bearbeiten",
@@ -11,6 +13,8 @@
"lang_login": "Login",
"lang_name": "Name",
"lang_phone": "Telefon",
+ "lang_role": "Rolle",
+ "lang_userDeleteConfirm": "M\u00f6chten Sie diesen Benutzer wirklich l\u00f6schen?",
"lang_userManagement": "Benutzerverwaltung",
"lang_userlist": "Benutzerliste"
}
\ No newline at end of file
diff --git a/modules-available/adduser/lang/en/messages.json b/modules-available/adduser/lang/en/messages.json
index 69af3227..d55e0ec6 100644
--- a/modules-available/adduser/lang/en/messages.json
+++ b/modules-available/adduser/lang/en/messages.json
@@ -1,8 +1,11 @@
{
"adduser-success": "User successfully added",
+ "cannot-delete-1-self": "Cannot delete user with ID 1 or yourself",
"db-error": "Database error: {{0}}",
"password-changed": "Password changed",
"password-mismatch": "Password and password confirmation do not match",
+ "roles-updated": "Roles have been updated",
+ "user-deleted": "Deleted user {{0}}",
"user-edited": "User data has been updated",
"user-not-found": "User with ID {{0}} not found"
}
\ No newline at end of file
diff --git a/modules-available/adduser/lang/en/template-tags.json b/modules-available/adduser/lang/en/template-tags.json
index 2c9b8b53..4fe03711 100644
--- a/modules-available/adduser/lang/en/template-tags.json
+++ b/modules-available/adduser/lang/en/template-tags.json
@@ -1,8 +1,10 @@
{
"lang_addUser": "Add user",
+ "lang_assignRoles": "Assign roles",
"lang_changeLoginHint": "You can change the login identifier used for logging in. This is only enabled for local acounts that are not linked to LDAP\/AD servers.",
"lang_changeOwnPasswordHint": "You can change your own password by clicking the \"change password\" button in the menu.",
"lang_changePassword": "Change password",
+ "lang_confirmDelete": "Confirm delete",
"lang_confirmation": "Confirm Password",
"lang_createUser": "Create User",
"lang_editUser": "Edit user",
@@ -11,6 +13,8 @@
"lang_login": "Login",
"lang_name": "Name",
"lang_phone": "Phone",
+ "lang_role": "Role",
+ "lang_userDeleteConfirm": "Do you want to delete this user?",
"lang_userManagement": "User management",
"lang_userlist": "User list"
}
\ No newline at end of file
diff --git a/modules-available/adduser/templates/page-userlist.html b/modules-available/adduser/templates/page-userlist.html
index 5b14f7e5..8d9c6de0 100644
--- a/modules-available/adduser/templates/page-userlist.html
+++ b/modules-available/adduser/templates/page-userlist.html
@@ -18,7 +18,7 @@
{{#list}}
- {{login}} |
+ {{login}} |
{{fullname}} |
{{phone}} |
{{email}} |
@@ -27,8 +27,8 @@
{{^hide_delete}}
-
{{/roles}}
-
\ No newline at end of file
+
+
+
+
+
+
+
+ {{lang_save}}
+
+
+
\ No newline at end of file
--
cgit v1.2.3-55-g7522
From 0610a9adf881d594447ba7076839310602081f25 Mon Sep 17 00:00:00 2001
From: Simon Rettberg
Date: Tue, 10 Apr 2018 12:58:39 +0200
Subject: [adduser] Fix JS checks on add page
---
modules-available/adduser/templates/js-add-edit.html | 3 +++
1 file changed, 3 insertions(+)
(limited to 'modules-available/adduser')
diff --git a/modules-available/adduser/templates/js-add-edit.html b/modules-available/adduser/templates/js-add-edit.html
index 95454c22..db8d435a 100644
--- a/modules-available/adduser/templates/js-add-edit.html
+++ b/modules-available/adduser/templates/js-add-edit.html
@@ -6,6 +6,9 @@ document.addEventListener('DOMContentLoaded', function() {
var $fullname = $('#fullname');
var $msg = $('#add-msg');
var $btn = $('.save-btn');
+ if (typeof SLX_EDITUSER === 'undefined') {
+ SLX_EDITUSER = false;
+ }
var ev = function() {
var msg = '';
if ($login.val().length < 2) {
--
cgit v1.2.3-55-g7522
From a7198124169059d32da12487a067a05c8507ef3c Mon Sep 17 00:00:00 2001
From: Simon Rettberg
Date: Tue, 10 Apr 2018 13:02:50 +0200
Subject: Update translations
---
modules-available/adduser/lang/de/permissions.json | 4 ++--
modules-available/adduser/lang/en/permissions.json | 4 ++--
.../locationinfo/lang/de/backend-exchange.json | 14 ++++++++++++++
.../locationinfo/lang/en/backend-exchange.json | 14 ++++++++++++++
modules-available/news/lang/de/permissions.json | 9 +++++----
modules-available/news/lang/en/permissions.json | 9 +++++----
.../serversetup-bwlp/lang/de/permissions.json | 1 +
.../serversetup-bwlp/lang/en/permissions.json | 7 ++++---
modules-available/webinterface/lang/de/permissions.json | 7 ++++---
modules-available/webinterface/lang/en/permissions.json | 7 ++++---
10 files changed, 55 insertions(+), 21 deletions(-)
create mode 100644 modules-available/locationinfo/lang/de/backend-exchange.json
create mode 100644 modules-available/locationinfo/lang/en/backend-exchange.json
(limited to 'modules-available/adduser')
diff --git a/modules-available/adduser/lang/de/permissions.json b/modules-available/adduser/lang/de/permissions.json
index 636b73ff..8792ac14 100644
--- a/modules-available/adduser/lang/de/permissions.json
+++ b/modules-available/adduser/lang/de/permissions.json
@@ -1,6 +1,6 @@
{
- "list.view": "Nutzerliste anzeigen",
"user.add": "Neuen Nutzer hinzuf\u00fcgen",
"user.edit": "Nutzer bearbeiten",
- "user.remove": "Nutzer l\u00f6schen"
+ "user.remove": "Nutzer l\u00f6schen",
+ "user.view-list": "Nutzerliste anzeigen"
}
\ No newline at end of file
diff --git a/modules-available/adduser/lang/en/permissions.json b/modules-available/adduser/lang/en/permissions.json
index d12d100e..ed3d8ee3 100644
--- a/modules-available/adduser/lang/en/permissions.json
+++ b/modules-available/adduser/lang/en/permissions.json
@@ -1,6 +1,6 @@
{
- "list.view": "Show userlist",
"user.add": "Add new user",
"user.edit": "Edit user",
- "user.remove": "Remove user"
+ "user.remove": "Remove user",
+ "user.view-list": "Show userlist"
}
\ No newline at end of file
diff --git a/modules-available/locationinfo/lang/de/backend-exchange.json b/modules-available/locationinfo/lang/de/backend-exchange.json
new file mode 100644
index 00000000..51b4ed37
--- /dev/null
+++ b/modules-available/locationinfo/lang/de/backend-exchange.json
@@ -0,0 +1,14 @@
+{
+ "clientVersion": "Version",
+ "clientVersion_helptext": "Eingesetzte Exchange Version",
+ "password": "Passwort",
+ "password_helptext": "Passwort des Nutzers in Exchange",
+ "serverAddress": "Server-IP",
+ "serverAddress_helptext": "IP-Adresse des Exchange Servers",
+ "username": "Benutzername",
+ "username_helptext": "Benutzer muss mind. Reviewer Rechte auf Kalender besitzen",
+ "verifyCert": "Zertifikat pr\u00fcfen",
+ "verifyCert_helptext": "Wenn das Zertifikat abgelaufen ist, oder von keiner bekannten CA ausgestellt wurde, wird die Verbindung abgelehnt.",
+ "verifyHostname": "Hostnamen pr\u00fcfen",
+ "verifyHostname_helptext": "Der im Zertifikat angegebene Hostname muss mit dem Hostnamen aus der URL \u00fcbereinstimmen, sonst wird die Verbindung abgelehnt."
+}
\ No newline at end of file
diff --git a/modules-available/locationinfo/lang/en/backend-exchange.json b/modules-available/locationinfo/lang/en/backend-exchange.json
new file mode 100644
index 00000000..b3025d88
--- /dev/null
+++ b/modules-available/locationinfo/lang/en/backend-exchange.json
@@ -0,0 +1,14 @@
+{
+ "clientVersion": "Version",
+ "clientVersion_helptext": "Used exchange version",
+ "password": "Password",
+ "password_helptext": "User password in exchange",
+ "serverAddress": "Server-IP",
+ "serverAddress_helptext": "IP of the exchange server",
+ "username": "Username",
+ "username_helptext": "User needs at least reviewer rights on calendar",
+ "verifyCert": "Verify certificate",
+ "verifyCert_helptext": "If the certificate expired or was not signed by a known CA, the connection will be aborted",
+ "verifyHostname": "Verify host name",
+ "verifyHostname_helptext": "The certificate's host name must match the host name given in the URL, otherwise the connection will be aborted."
+}
\ No newline at end of file
diff --git a/modules-available/news/lang/de/permissions.json b/modules-available/news/lang/de/permissions.json
index b2c6fb1b..888bb4a7 100644
--- a/modules-available/news/lang/de/permissions.json
+++ b/modules-available/news/lang/de/permissions.json
@@ -1,6 +1,7 @@
{
- "news.save": "Änderungen am News Text speichern.",
- "news.delete": "Alte News Texte löschen.",
- "help.save": "Änderungen am Hilfe Text speichern.",
- "help.delete": "Alte Hilfe Texte löschen."
+ "access-page": "Seite sehen.",
+ "help.delete": "Alte Hilfe Texte l\u00f6schen.",
+ "help.save": "\u00c4nderungen am Hilfe Text speichern.",
+ "news.delete": "Alte News Texte l\u00f6schen.",
+ "news.save": "\u00c4nderungen am News Text speichern."
}
\ No newline at end of file
diff --git a/modules-available/news/lang/en/permissions.json b/modules-available/news/lang/en/permissions.json
index 90d07aef..37fc7a8e 100644
--- a/modules-available/news/lang/en/permissions.json
+++ b/modules-available/news/lang/en/permissions.json
@@ -1,6 +1,7 @@
{
- "news.save": "Save new news.",
- "news.delete": "Delete old news.",
- "help.save": "Save new help texts.",
- "help.delete": "Delete old help texts"
+ "access-page": "View page.",
+ "help.delete": "Delete old help texts.",
+ "help.save": "Save new help texts.",
+ "news.delete": "Delete old news.",
+ "news.save": "Save new news."
}
\ No newline at end of file
diff --git a/modules-available/serversetup-bwlp/lang/de/permissions.json b/modules-available/serversetup-bwlp/lang/de/permissions.json
index 65367c51..98baec3c 100644
--- a/modules-available/serversetup-bwlp/lang/de/permissions.json
+++ b/modules-available/serversetup-bwlp/lang/de/permissions.json
@@ -1,4 +1,5 @@
{
+ "access-page": "Seite sehen.",
"download": "USB-Image herunterladen.",
"edit.address": "Boot-Adresse des Servers ausw\u00e4hlen.",
"edit.menu": "Bootmen\u00fc anpassen."
diff --git a/modules-available/serversetup-bwlp/lang/en/permissions.json b/modules-available/serversetup-bwlp/lang/en/permissions.json
index c04f09f7..44d1c519 100644
--- a/modules-available/serversetup-bwlp/lang/en/permissions.json
+++ b/modules-available/serversetup-bwlp/lang/en/permissions.json
@@ -1,5 +1,6 @@
{
- "edit.address": "Choose boot address of the server.",
- "edit.menu": "Customize boot menu.",
- "download": "Download USB Image."
+ "access-page": "View page.",
+ "download": "Download USB Image.",
+ "edit.address": "Choose boot address of the server.",
+ "edit.menu": "Customize boot menu."
}
\ No newline at end of file
diff --git a/modules-available/webinterface/lang/de/permissions.json b/modules-available/webinterface/lang/de/permissions.json
index ee96810a..213ebd8f 100644
--- a/modules-available/webinterface/lang/de/permissions.json
+++ b/modules-available/webinterface/lang/de/permissions.json
@@ -1,5 +1,6 @@
{
- "edit.https": "HTTPS Einstellungen bearbeiten.",
- "edit.password": "Ändern, ob Passwortfelder in der Web-Schnittstelle maskiert werden sollen.",
- "edit.design": "Seitentitel und Hintergrundfarbe des Logos bearbeiten."
+ "access-page": "Seite sehen.",
+ "edit.design": "Seitentitel und Hintergrundfarbe des Logos bearbeiten.",
+ "edit.https": "HTTPS Einstellungen bearbeiten.",
+ "edit.password": "\u00c4ndern, ob Passwortfelder in der Web-Schnittstelle maskiert werden sollen."
}
\ No newline at end of file
diff --git a/modules-available/webinterface/lang/en/permissions.json b/modules-available/webinterface/lang/en/permissions.json
index caf6d0cb..8ebb2830 100644
--- a/modules-available/webinterface/lang/en/permissions.json
+++ b/modules-available/webinterface/lang/en/permissions.json
@@ -1,5 +1,6 @@
{
- "edit.https": "Edit HTTPS settings.",
- "edit.password": "Change whether password fields should be masked or not.",
- "edit.design": "Edit page title and logo background color."
+ "access-page": "View page.",
+ "edit.design": "Edit page title and logo background color.",
+ "edit.https": "Edit HTTPS settings.",
+ "edit.password": "Change whether password fields should be masked or not."
}
\ No newline at end of file
--
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/adduser')
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 8fd7ce430269d2999dcba3696ab6557fa59a4e94 Mon Sep 17 00:00:00 2001
From: Simon Rettberg
Date: Thu, 19 Apr 2018 16:12:57 +0200
Subject: [adduser] Assign first created user role "Super-Admin"
---
modules-available/adduser/page.inc.php | 2 ++
1 file changed, 2 insertions(+)
(limited to 'modules-available/adduser')
diff --git a/modules-available/adduser/page.inc.php b/modules-available/adduser/page.inc.php
index e95cb78a..a841f251 100644
--- a/modules-available/adduser/page.inc.php
+++ b/modules-available/adduser/page.inc.php
@@ -56,6 +56,8 @@ class Page_AddUser extends Page
if ($ret !== false) {
EventLog::clear();
}
+ // same for permissionmanager
+ Database::exec("INSERT INTO `role_x_user` (userid, roleid) VALUES (:id, 1)", ['id' => $id], true);
EventLog::info('Created first user ' . $login);
} else {
EventLog::info(User::getName() . ' created user ' . $login);
--
cgit v1.2.3-55-g7522
From 27e7c658d12384d15b4c47483a181b6912f21b36 Mon Sep 17 00:00:00 2001
From: Simon Rettberg
Date: Fri, 27 Apr 2018 14:46:20 +0200
Subject: [adduser] Print userid=1 bold in userlist
---
modules-available/adduser/page.inc.php | 4 ++++
modules-available/adduser/templates/page-userlist.html | 14 ++++++++------
2 files changed, 12 insertions(+), 6 deletions(-)
(limited to 'modules-available/adduser')
diff --git a/modules-available/adduser/page.inc.php b/modules-available/adduser/page.inc.php
index a841f251..cffe33f9 100644
--- a/modules-available/adduser/page.inc.php
+++ b/modules-available/adduser/page.inc.php
@@ -202,9 +202,13 @@ class Page_AddUser extends Page
foreach ($data['list'] as &$u) {
// Don't allow deleting user 1 and self
$u['hide_delete'] = $u['userid'] == 1 || $u['userid'] == User::getId();
+ if ($u['userid'] == 1) {
+ $u['userClass'] = 'slx-bold';
+ }
}
unset($u);
Permission::addGlobalTags($data['perms'], null, ['user.add', 'user.edit', 'user.remove']);
+ Module::isAvailable('js_stupidtable');
$page->render('page-userlist', $data);
}
}
diff --git a/modules-available/adduser/templates/page-userlist.html b/modules-available/adduser/templates/page-userlist.html
index 8d9c6de0..262553f6 100644
--- a/modules-available/adduser/templates/page-userlist.html
+++ b/modules-available/adduser/templates/page-userlist.html
@@ -5,20 +5,22 @@