From cf4a22166311ac8b455b9e3bb1a6ba56529132ef Mon Sep 17 00:00:00 2001 From: Udo Walter Date: Tue, 19 Dec 2017 16:32:48 +0100 Subject: [permissionmanager] fixed small bug --- modules-available/permissionmanager/inc/permissionutil.inc.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'modules-available') diff --git a/modules-available/permissionmanager/inc/permissionutil.inc.php b/modules-available/permissionmanager/inc/permissionutil.inc.php index 6fc33ad1..cd7fb09a 100644 --- a/modules-available/permissionmanager/inc/permissionutil.inc.php +++ b/modules-available/permissionmanager/inc/permissionutil.inc.php @@ -75,7 +75,7 @@ class PermissionUtil preg_match('#^modules/([^/]+)/#', $file, $out); foreach( $data as $p ) { $description = Dictionary::translateFileModule($out[1], "permissions", $p); - $permissions = self::putInPermissionTree($out[1].".".$p, $description, $permissions); + self::putInPermissionTree($out[1].".".$p, $description, $permissions); } } ksort($permissions); @@ -89,10 +89,9 @@ class PermissionUtil return $permissions; } - private static function putInPermissionTree($permission, $description, $tree) + private static function putInPermissionTree($permission, $description, &$tree) { $subPermissions = explode('.', $permission); - $original =& $tree; foreach ($subPermissions as $subPermission) { if ($subPermission) { if (!array_key_exists($subPermission, $tree)) { @@ -101,6 +100,6 @@ class PermissionUtil $tree =& $tree[$subPermission]; } } - return $original; + $tree = $description; } } \ No newline at end of file -- cgit v1.2.3-55-g7522 From 8b46da3853636a313543b8d9154d93054ed1193f Mon Sep 17 00:00:00 2001 From: Udo Walter Date: Thu, 21 Dec 2017 19:34:28 +0100 Subject: [permissionmanager] removed openRoleEdior function; changed searchFieldFunction() to use jQuery; fixed checkboxes in roleeditor not selecting on a click on the label; added selected row highlighting; disabled buttons if there are no users/roles selected; made role badges in user/location tables clickable; added phpdoc comments to most php functions; --- .../permissionmanager/clientscript.js | 16 ++--- .../inc/getpermissiondata.inc.php | 40 +++++++---- .../inc/permissiondbupdate.inc.php | 37 +++++++--- .../permissionmanager/inc/permissionutil.inc.php | 34 ++++++++++ .../permissionmanager/lang/de/template-tags.json | 5 +- .../permissionmanager/lang/en/template-tags.json | 5 +- modules-available/permissionmanager/page.inc.php | 50 ++++++++++++-- .../templates/locationstable.html | 2 +- .../permissionmanager/templates/roleeditor.html | 17 ++--- .../permissionmanager/templates/rolestable.html | 34 +++------- .../permissionmanager/templates/treenode.html | 4 +- .../permissionmanager/templates/treepanel.html | 12 ++-- .../permissionmanager/templates/userstable.html | 79 ++++++++++++++++++---- 13 files changed, 233 insertions(+), 102 deletions(-) (limited to 'modules-available') diff --git a/modules-available/permissionmanager/clientscript.js b/modules-available/permissionmanager/clientscript.js index 65065e6e..4770fa6a 100644 --- a/modules-available/permissionmanager/clientscript.js +++ b/modules-available/permissionmanager/clientscript.js @@ -1,5 +1,5 @@ document.addEventListener("DOMContentLoaded", function() { - var selectize = $('#select-role'); + var selectize = $("#select-role"); if (selectize.length) { selectize = selectize.selectize({ allowEmptyOption: false, @@ -13,10 +13,10 @@ document.addEventListener("DOMContentLoaded", function() { // If Site gets refreshed, all data-selectizeCounts will be reset to 0, so delete the filters from the selectize selectize.clear(); - selectize.on('item_add', function (value, $item) { + selectize.on("item_add", function (value, $item) { // When first item gets added the filter isn't empty anymore, so hide all rows if (selectize.items.length === 1) { - $('.dataTable tbody').find('tr').hide(); + $(".dataTable tbody").find("tr").hide(); } // Find all rows which shall be shown and increase their counter by 1 $(".roleid-" + value).closest("tr").each(function () { @@ -25,10 +25,10 @@ document.addEventListener("DOMContentLoaded", function() { }); }); - selectize.on('item_remove', function (value, $item) { + selectize.on("item_remove", function (value, $item) { // When no items in the filter, show all rows again if (selectize.items.length === 0) { - $('.dataTable tbody').find('tr').show(); + $(".dataTable tbody").find("tr").show(); } else { // Find all rows which have the delete role, decrease their counter by 1 $(".roleid-" + value).closest("tr").each(function () { @@ -42,9 +42,9 @@ document.addEventListener("DOMContentLoaded", function() { }); } - $("tr").on('click', function (e) { - if (e.target.type !== "checkbox") { - $(this).find("input:checkbox").trigger("click"); + $("tr").on("click", function(e) { + if (e.target.type !== "checkbox" && e.target.tagName !== "A") { + $(this).find("input[type=checkbox]").trigger("click"); } }); diff --git a/modules-available/permissionmanager/inc/getpermissiondata.inc.php b/modules-available/permissionmanager/inc/getpermissiondata.inc.php index 13c7ca89..982fa0b7 100644 --- a/modules-available/permissionmanager/inc/getpermissiondata.inc.php +++ b/modules-available/permissionmanager/inc/getpermissiondata.inc.php @@ -2,9 +2,17 @@ class GetPermissionData { - // get UserIDs, User Login Names, User Roles + /** + * Get data for all users. + * + * @return array array of users (each with userid, username and roles (each with roleid and rolename)) + */ public static function getUserData() { - $res = self::queryUserData(); + $res = Database::simpleQuery("SELECT user.userid AS userid, user.login AS login, role.rolename AS rolename, role.roleid AS roleid + FROM user + LEFT JOIN user_x_role ON user.userid = user_x_role.userid + LEFT JOIN role ON user_x_role.roleid = role.roleid + "); $userdata= array(); while ($row = $res->fetch(PDO::FETCH_ASSOC)) { $userdata[$row['userid'].' '.$row['login']][] = array( @@ -24,7 +32,11 @@ class GetPermissionData { return $data; } - // get LocationIDs, Location Names, Roles of each Location + /** + * Get data for all locations. + * + * @return array array of locations (each including the roles that have permissions for them) + */ public static function getLocationData() { $res = Database::simpleQuery("SELECT role.roleid as roleid, rolename, GROUP_CONCAT(COALESCE(locationid, 0)) AS locationids FROM role INNER JOIN role_x_location ON role.roleid = role_x_location.roleid GROUP BY roleid ORDER BY rolename ASC"); @@ -46,7 +58,11 @@ class GetPermissionData { return array_values($locations); } - // get all roles from database (id and name) + /** + * Get all roles. + * + * @return array array roles (each with roleid and rolename) + */ public static function getRoles() { $res = Database::simpleQuery("SELECT roleid, rolename FROM role ORDER BY rolename ASC"); $data = array(); @@ -59,6 +75,12 @@ class GetPermissionData { return $data; } + /** + * Get permissions and locations for a given role. + * + * @param string $roleid id of the role + * @return array array containing an array of permissions and an array of locations + */ public static function getRoleData($roleid) { $query = "SELECT roleid, rolename FROM role WHERE roleid = :roleid"; $data = Database::queryFirst($query, array("roleid" => $roleid)); @@ -77,14 +99,4 @@ class GetPermissionData { return $data; } - // UserID, User Login Name, Roles of each User - private static function queryUserData() { - $res = Database::simpleQuery("SELECT user.userid AS userid, user.login AS login, role.rolename AS rolename, role.roleid AS roleid - FROM user - LEFT JOIN user_x_role ON user.userid = user_x_role.userid - LEFT JOIN role ON user_x_role.roleid = role.roleid - "); - return $res; - } - } \ 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 f144b35e..ffe5fac0 100644 --- a/modules-available/permissionmanager/inc/permissiondbupdate.inc.php +++ b/modules-available/permissionmanager/inc/permissiondbupdate.inc.php @@ -2,7 +2,12 @@ class PermissionDbUpdate { - // insert new user_x_role to database. "ignore" to ignore duplicate entry try + /** + * Insert all user/role combinations into the user_x_role table. + * + * @param array $users userids + * @param array $roles roleids + */ public static function addRoleToUser($users, $roles) { $query = "INSERT IGNORE INTO user_x_role (userid, roleid) VALUES (:userid, :roleid)"; foreach($users AS $userid) { @@ -12,24 +17,34 @@ class PermissionDbUpdate { } } - // remove user_x_role entry from database + /** + * Remove all user/role combinations from the user_x_role table. + * + * @param array $users userids + * @param array $roles roleids + */ public static function removeRoleFromUser($users, $roles) { $query = "DELETE FROM user_x_role WHERE userid IN (:users) AND roleid IN (:roles)"; Database::exec($query, array("users" => $users, "roles" => $roles)); } - // delete role, delete user_x_role relationships, delete role_x_location relationships, delete role_x_permission relationships + /** + * Delete role from the role table. + * + * @param string $roleid roleid + */ public static function deleteRole($roleid) { - $query = "DELETE FROM role WHERE roleid = :roleid"; - Database::exec($query, array("roleid" => $roleid)); - $query = "DELETE FROM user_x_role WHERE roleid = :roleid"; - Database::exec($query, array("roleid" => $roleid)); - $query = "DELETE FROM role_x_location WHERE roleid = :roleid"; - Database::exec($query, array("roleid" => $roleid)); - $query = "DELETE FROM role_x_permission WHERE roleid = :roleid"; - Database::exec($query, array("roleid" => $roleid)); + Database::exec("DELETE FROM role WHERE roleid = :roleid", array("roleid" => $roleid)); } + /** + * Save changes to a role or create a new one. + * + * @param string $rolename rolename + * @param array $locations array of locations + * @param array $permissions array of permissions + * @param string|null $roleid roleid or null if the role does not exist yet + */ public static function saveRole($rolename, $locations, $permissions, $roleid = NULL) { if ($roleid) { Database::exec("UPDATE role SET rolename = :rolename WHERE roleid = :roleid", diff --git a/modules-available/permissionmanager/inc/permissionutil.inc.php b/modules-available/permissionmanager/inc/permissionutil.inc.php index cd7fb09a..cb70c8bb 100644 --- a/modules-available/permissionmanager/inc/permissionutil.inc.php +++ b/modules-available/permissionmanager/inc/permissionutil.inc.php @@ -2,6 +2,14 @@ class PermissionUtil { + /** + * Check if the user has the given permission (for the given location). + * + * @param string $userid userid to check + * @param string $permissionid permissionid to check + * @param int|null $locationid locationid to check or null if the location should be disregarded + * @return bool true if user has permission, false if not + */ public static function userHasPermission($userid, $permissionid, $locationid) { $locations = array(); if (!is_null($locationid)) { @@ -27,6 +35,13 @@ class PermissionUtil return false; } + /** + * Get all locations where the user has the given permission. + * + * @param string $userid userid to check + * @param string $permissionid permissionid to check + * @return array array of locationids where the user has the given permission + */ public static function getAllowedLocations($userid, $permissionid) { $res = Database::simpleQuery("SELECT permissionid, COALESCE(locationid, 0) AS locationid FROM user_x_role @@ -51,6 +66,13 @@ class PermissionUtil return $allowedLocations; } + /** + * Extend an array of locations by adding all sublocations. + * + * @param array $tree tree of all locations (structured like Location::getTree()) + * @param array $locations the array of locationids to extend + * @return array extended array of locationids + */ public static function getSublocations($tree, $locations) { $result = array_flip($locations); foreach ($tree as $location) { @@ -65,6 +87,11 @@ class PermissionUtil return array_keys($result); } + /** + * Get all permissions of all active modules that have permissions in their permissions/permissions.json file. + * + * @return array permission tree as a multidimensional array + */ public static function getPermissions() { $permissions = array(); @@ -89,6 +116,13 @@ class PermissionUtil return $permissions; } + /** + * Place a permission into the given permission tree. + * + * @param string $permission the permission to place in the tree + * @param string $description the description of the permission + * @param array $tree the permission tree to modify + */ private static function putInPermissionTree($permission, $description, &$tree) { $subPermissions = explode('.', $permission); diff --git a/modules-available/permissionmanager/lang/de/template-tags.json b/modules-available/permissionmanager/lang/de/template-tags.json index 23b2dc68..88652152 100644 --- a/modules-available/permissionmanager/lang/de/template-tags.json +++ b/modules-available/permissionmanager/lang/de/template-tags.json @@ -2,12 +2,11 @@ "lang_Roles": "Rollen", "lang_Users": "Nutzer", "lang_Locations": "Räume", - "lang_addRole": "Rolle zuweisen", - "lang_removeRole": "Rolle entfernen", + "lang_addRole": "Rollen erteilen", + "lang_removeRole": "Rollen entziehen", "lang_newRole": "Rolle anlegen", "lang_Selected": "Ausgewählt", "lang_Edit": "Bearbeiten", - "lang_Remove": "Entfernen", "lang_Delete": "Löschen", "lang_removeCheck": "Sind Sie sich sicher, dass Sie diese Rolle entfernen wollen?", "lang_deleteCheck": "Sind Sie sich sicher, dass Sie diese Rolle löschen wollen?", diff --git a/modules-available/permissionmanager/lang/en/template-tags.json b/modules-available/permissionmanager/lang/en/template-tags.json index 01056632..08769f27 100644 --- a/modules-available/permissionmanager/lang/en/template-tags.json +++ b/modules-available/permissionmanager/lang/en/template-tags.json @@ -2,12 +2,11 @@ "lang_Roles": "Roles", "lang_Users": "Users", "lang_Locations": "Locations", - "lang_addRole": "Add Role", - "lang_removeRole": "Remove Role", + "lang_addRole": "Grant Roles", + "lang_removeRole": "Revoke Roles", "lang_newRole": "New Role", "lang_Selected": "Selected", "lang_Edit": "Edit", - "lang_Remove": "Remove", "lang_Delete": "Delete", "lang_removeCheck": "Are you sure you want to remove this role?", "lang_deleteCheck": "Are you sure you want to delete this role?", diff --git a/modules-available/permissionmanager/page.inc.php b/modules-available/permissionmanager/page.inc.php index 9aba80b3..eeed9c02 100644 --- a/modules-available/permissionmanager/page.inc.php +++ b/modules-available/permissionmanager/page.inc.php @@ -64,14 +64,14 @@ class Page_PermissionManager extends Page Render::addTemplate('locationstable', $data); } } elseif ($show === "roleEditor") { - $data = array(); + $data = array("cancelShow" => Request::get("cancel", "roles")); $selectedPermissions = array(); $selectedLocations = array(); - $roleID = Request::get("roleid", false); - if ($roleID) { - $roleData = GetPermissionData::getRoleData($roleID); - $data["roleid"] = $roleID; + $roleid = Request::get("roleid", false); + if ($roleid) { + $roleData = GetPermissionData::getRoleData($roleid); + $data["roleid"] = $roleid; $data["rolename"] = $roleData["rolename"]; $selectedPermissions = $roleData["permissions"]; $selectedLocations = $roleData["locations"]; @@ -85,12 +85,21 @@ class Page_PermissionManager extends Page } } - private static function generatePermissionHTML($subPermissions, $selectedPermissions = array(), $selectAll = false, $permString = "") + /** + * Recursively generate HTML code for the permission selection tree. + * + * @param array $permissions the permission tree + * @param array $selectedPermissions permissions that should be preselected + * @param array $selectAll true if all pemrissions should be preselected, false if only those in $selectedPermissions + * @param array $permString the prefix permission string with which all permissions in the permission tree should start + * @return string generated html code + */ + private static function generatePermissionHTML($permissions, $selectedPermissions = array(), $selectAll = false, $permString = "") { $res = ""; $toplevel = $permString == ""; if ($toplevel && in_array("*", $selectedPermissions)) $selectAll = true; - foreach ($subPermissions as $k => $v) { + foreach ($permissions as $k => $v) { $leaf = !is_array($v); $nextPermString = $permString ? $permString.".".$k : $k; $id = $leaf ? $nextPermString : $nextPermString.".*"; @@ -115,6 +124,15 @@ class Page_PermissionManager extends Page return $res; } + /** + * Recursively generate HTML code for the location selection tree. + * + * @param array $locations the location tree + * @param array $selectedLocations locations that should be preselected + * @param array $selectAll true if all locations should be preselected, false if only those in $selectedLocations + * @param array $toplevel true if the location tree are the children of the root location, false if not + * @return string generated html code + */ private static function generateLocationHTML($locations, $selectedLocations = array(), $selectAll = false, $toplevel = true) { $res = ""; @@ -141,6 +159,12 @@ class Page_PermissionManager extends Page return $res; } + /** + * Remove locations that are already covered by parent locations from the array. + * + * @param array $locations the locationid array + * @return array the locationid array without redundant locationids + */ private static function processLocations($locations) { if (in_array(0, $locations)) return array(NULL); @@ -158,6 +182,12 @@ class Page_PermissionManager extends Page return $result; } + /** + * Remove permissions that are already covered by parent permissions from the array. + * + * @param array $permissions the permissionid array + * @return array the permissionid array without redundant permissionids + */ private static function processPermissions($permissions) { if (in_array("*", $permissions)) return array("*"); @@ -171,6 +201,12 @@ class Page_PermissionManager extends Page return self::extractPermissions($result); } + /** + * Convert a multidimensional array of permissions to a flat array of permissions. + * + * @param array $permissions multidimensional array of permissionids + * @return array flat array of permissionids + */ private static function extractPermissions($permissions) { $result = array(); diff --git a/modules-available/permissionmanager/templates/locationstable.html b/modules-available/permissionmanager/templates/locationstable.html index dcfefa94..b910e3f3 100644 --- a/modules-available/permissionmanager/templates/locationstable.html +++ b/modules-available/permissionmanager/templates/locationstable.html @@ -26,7 +26,7 @@ {{locationpad}} {{locationname}} {{#roles}} - {{rolename}} + {{rolename}} {{/roles}} diff --git a/modules-available/permissionmanager/templates/roleeditor.html b/modules-available/permissionmanager/templates/roleeditor.html index b07e2112..ddf6ace9 100644 --- a/modules-available/permissionmanager/templates/roleeditor.html +++ b/modules-available/permissionmanager/templates/roleeditor.html @@ -10,11 +10,11 @@
  • {{lang_Locations}}
  • - {{lang_Name}}: - + +
  • - + {{lang_Cancel}}
  • @@ -56,15 +56,12 @@ } } }); - - $("#cancelButton").click(function () { - window.location.replace("?do=permissionmanager&show=roles"); - }); $('form').submit(function () { - var name = $.trim($('#rolename').val()); - if (name === '') { - $("#rolename").addClass("missingInput"); + var input = $("#rolename"); + var name = $.trim(input.val()); + if (!name) { + input.addClass("missingInput"); return false; } }); diff --git a/modules-available/permissionmanager/templates/rolestable.html b/modules-available/permissionmanager/templates/rolestable.html index 992feca1..7152a1dd 100644 --- a/modules-available/permissionmanager/templates/rolestable.html +++ b/modules-available/permissionmanager/templates/rolestable.html @@ -8,13 +8,13 @@
    - + {{lang_newRole}}
    - +
    @@ -25,10 +25,10 @@ {{#roles}} - - + + @@ -121,4 +121,8 @@ old.replaceWith(ta); } + document.addEventListener('DOMContentLoaded', function () { + $('.txt-empty').first().focus(); + }); + -- cgit v1.2.3-55-g7522 From 4537b9b7c9eb63bf3b2d5066d6c50e68f7de4956 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 11 Jan 2018 11:19:14 +0100 Subject: [statistics] Add "replace machines" feature (not linked to anywhere yet) --- .../dnbd3/hooks/statistics-machine-replace.inc.php | 6 ++ .../hooks/statistics-machine-replace.inc.php | 7 ++ .../hooks/statistics-machine-replace.inc.php | 6 ++ modules-available/statistics/lang/de/messages.json | 6 +- .../statistics/lang/de/template-tags.json | 6 ++ modules-available/statistics/lang/en/messages.json | 6 +- .../statistics/lang/en/template-tags.json | 6 ++ modules-available/statistics/page.inc.php | 6 +- modules-available/statistics/pages/replace.inc.php | 119 +++++++++++++++++++++ .../statistics/templates/page-replace.html | 4 + .../hooks/statistics-machine-replace.inc.php | 5 + 11 files changed, 174 insertions(+), 3 deletions(-) create mode 100644 modules-available/dnbd3/hooks/statistics-machine-replace.inc.php create mode 100644 modules-available/roomplanner/hooks/statistics-machine-replace.inc.php create mode 100644 modules-available/runmode/hooks/statistics-machine-replace.inc.php create mode 100644 modules-available/statistics/pages/replace.inc.php create mode 100644 modules-available/syslog/hooks/statistics-machine-replace.inc.php (limited to 'modules-available') diff --git a/modules-available/dnbd3/hooks/statistics-machine-replace.inc.php b/modules-available/dnbd3/hooks/statistics-machine-replace.inc.php new file mode 100644 index 00000000..5e4c4e75 --- /dev/null +++ b/modules-available/dnbd3/hooks/statistics-machine-replace.inc.php @@ -0,0 +1,6 @@ + $cat, 'id' => $id)); } diff --git a/modules-available/statistics/pages/replace.inc.php b/modules-available/statistics/pages/replace.inc.php new file mode 100644 index 00000000..80bbf0ce --- /dev/null +++ b/modules-available/statistics/pages/replace.inc.php @@ -0,0 +1,119 @@ + $split[0], 'new' => $split[1]]; + $old = Database::queryFirst('SELECT lastseen FROM machine WHERE machineuuid = :old', + ['old' => $entry['old']]); + if ($old === false) { + Message::addError('unknown-machine', $entry['old']); + continue; + } + $new = Database::queryFirst('SELECT firstseen FROM machine WHERE machineuuid = :new', + ['new' => $entry['new']]); + if ($new === false) { + Message::addError('unknown-machine', $entry['new']); + continue; + } + if ($old['lastseen'] - 86400*7 > $new['firstseen']) { + Message::addWarning('ignored-both-in-use', $entry['old'], $entry['new']); + continue; + } + $entry['datelimit'] = min($new['firstseen'], $old['lastseen']); + $list[] = $entry; + } + if (empty($list)) { + Message::addError('main.parameter-empty', 'replace'); + return; + } + + // First handle module internal tables + foreach ($list as $entry) { + Database::exec('UPDATE statistic SET machineuuid = :new WHERE machineuuid = :old AND dateline < :datelimit', $entry); + } + + // Let other modules do their thing + $fun = function($file, $list) { + include $file; + }; + foreach (Hook::load('statistics-machine-replace') as $hook) { + $fun($hook->file, $list); + } + + // Finalize by updating machine table + foreach ($list as $entry) { + unset($entry['datelimit']); + Database::exec('UPDATE machine old, machine new SET + new.fixedlocationid = old.fixedlocationid, + new.position = old.position, + old.position = NULL, + new.notes = old.notes, + old.notes = NULL, + old.lastseen = new.firstseen + WHERE old.machineuuid = :old AND new.machineuuid = :new', $entry); + } + Message::addSuccess('x-machines-replaced', count($list)); + } + + public static function doRender() + { + self::listSuggestions(); + } + + private static function listSuggestions() + { + if (Request::get('debug', false) !== false) { + $oldCutoff = time() - 86400 * 180; + $newCutoff = time() - 86400 * 180; + } else { + $oldCutoff = time() - 86400 * 90; + $newCutoff = time() - 86400 * 30; + } + $res = Database::simpleQuery("SELECT + old.machineuuid AS olduuid, old.locationid AS oldlid, old.hostname AS oldhost, + old.clientip AS oldip, old.macaddr AS oldmac, old.lastseen AS oldlastseen, old.systemmodel AS oldmodel, + new.machineuuid AS newuuid, new.locationid AS newlid, new.hostname AS newhost, + new.clientip AS newip, new.macaddr AS newmac, new.firstseen AS newfirstseen, new.systemmodel AS newmodel + FROM machine old INNER JOIN machine new ON (old.clientip = new.clientip AND old.lastseen < new.firstseen AND old.lastseen > $oldCutoff AND new.firstseen > $newCutoff) + ORDER BY oldhost ASC, oldip ASC"); + $list = []; + while ($row = $res->fetch(PDO::FETCH_ASSOC)) { + $row['oldlastseen_s'] = Util::prettyTime($row['oldlastseen']); + $row['newfirstseen_s'] = Util::prettyTime($row['newfirstseen']); + $list[] = $row; + } + $data = array('pairs' => $list); + Render::addTemplate('page-replace', $data); + if (empty($list)) { + Message::addInfo('no-replacement-matches'); + } + } + +} + diff --git a/modules-available/statistics/templates/page-replace.html b/modules-available/statistics/templates/page-replace.html index f87610a2..d0e9f766 100644 --- a/modules-available/statistics/templates/page-replace.html +++ b/modules-available/statistics/templates/page-replace.html @@ -17,6 +17,10 @@ } +

    + {{lang_replaceInstructions}} +

    +
    {{lang_Roles}}
    {{rolename}}
    {{rolename}} - + @@ -64,30 +64,18 @@ \ No newline at end of file diff --git a/modules-available/permissionmanager/templates/treenode.html b/modules-available/permissionmanager/templates/treenode.html index 336ca13e..ced973ca 100644 --- a/modules-available/permissionmanager/templates/treenode.html +++ b/modules-available/permissionmanager/templates/treenode.html @@ -1,8 +1,8 @@ {{#toplevel}}
      {{/toplevel}}
    • - - + +
        {{{HTML}}} diff --git a/modules-available/permissionmanager/templates/treepanel.html b/modules-available/permissionmanager/templates/treepanel.html index 53e316c9..6f358825 100644 --- a/modules-available/permissionmanager/templates/treepanel.html +++ b/modules-available/permissionmanager/templates/treepanel.html @@ -1,11 +1,11 @@ -
        -
        -
        - - +
        +
        +
        + +
        -
        +
        {{{HTML}}}
        diff --git a/modules-available/permissionmanager/templates/userstable.html b/modules-available/permissionmanager/templates/userstable.html index 9f684e99..749ae03d 100644 --- a/modules-available/permissionmanager/templates/userstable.html +++ b/modules-available/permissionmanager/templates/userstable.html @@ -13,8 +13,8 @@
        - - + +
        @@ -35,7 +35,7 @@
    {{username}} {{#roles}} - {{rolename}} + {{rolename}} {{/roles}} @@ -89,7 +89,7 @@ @@ -100,7 +100,7 @@ @@ -140,34 +140,85 @@ \ No newline at end of file -- cgit v1.2.3-55-g7522 From e80111e07a27d37e325e502908b7514c0dd47206 Mon Sep 17 00:00:00 2001 From: Udo Walter Date: Fri, 22 Dec 2017 18:03:52 +0100 Subject: [minilinux] Actualized translation. --- modules-available/minilinux/lang/de/template-tags.json | 2 +- modules-available/minilinux/lang/en/template-tags.json | 4 ++-- modules-available/minilinux/lang/pt/template-tags.json | 2 +- modules-available/minilinux/templates/filelist.html | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'modules-available') diff --git a/modules-available/minilinux/lang/de/template-tags.json b/modules-available/minilinux/lang/de/template-tags.json index 6a4e7b57..18a8b7af 100644 --- a/modules-available/minilinux/lang/de/template-tags.json +++ b/modules-available/minilinux/lang/de/template-tags.json @@ -1,5 +1,5 @@ { - "lang_actual": "Aktuell", + "lang_uptodate": "Aktuell", "lang_canUpdate1": "Mindestens eine Komponente von", "lang_canUpdate2": "kann aktualisiert werden. F\u00fcr einen reibungslosen Betrieb wird empfohlen, alle Komponenten auf dem aktuellen Stand zu halten.", "lang_configurationPackageNotFound": "Keine Konfigurationspakete gefunden!", diff --git a/modules-available/minilinux/lang/en/template-tags.json b/modules-available/minilinux/lang/en/template-tags.json index 28942f93..aef15c03 100644 --- a/modules-available/minilinux/lang/en/template-tags.json +++ b/modules-available/minilinux/lang/en/template-tags.json @@ -1,7 +1,7 @@ { - "lang_actual": "Actual", + "lang_uptodate": "Up to date", "lang_canUpdate1": "At least one component of", - "lang_canUpdate2": "can be updated. For a smooth operation, it is recommended to keep all components up to date.", + "lang_canUpdate2": "Can be updated. For a smooth operation, it is recommended to keep all components up to date.", "lang_configurationPackageNotFound": "Configuration package not found!", "lang_desiredVersion": "Desired version", "lang_errorGetting": "Error while downloading list!", diff --git a/modules-available/minilinux/lang/pt/template-tags.json b/modules-available/minilinux/lang/pt/template-tags.json index f7225455..4a25f9be 100644 --- a/modules-available/minilinux/lang/pt/template-tags.json +++ b/modules-available/minilinux/lang/pt/template-tags.json @@ -1,5 +1,5 @@ { - "lang_actual": "Atual", + "lang_uptodate": "Atual", "lang_canUpdate1": "Pelo menos um componente de", "lang_canUpdate2": "pode ser atualizado. Para um bom funcionamento, recomenda-se manter todos os componentes atualizados.", "lang_configurationPackageNotFound": "Pacote de configura\u00e7\u00e3o n\u00e3o encontrado!", diff --git a/modules-available/minilinux/templates/filelist.html b/modules-available/minilinux/templates/filelist.html index ec3aee57..a1d0aa48 100644 --- a/modules-available/minilinux/templates/filelist.html +++ b/modules-available/minilinux/templates/filelist.html @@ -31,7 +31,7 @@
    {{name}}
    - {{^fileChanged}} {{lang_actual}}{{/fileChanged}} + {{^fileChanged}} {{lang_uptodate}}{{/fileChanged}} {{#fileChanged}} {{lang_outdated}}{{/fileChanged}}
    -- cgit v1.2.3-55-g7522 From 5b5abf62a5718e9bf092bd8e95b5c1c286c0af7b Mon Sep 17 00:00:00 2001 From: Udo Walter Date: Wed, 27 Dec 2017 18:20:18 +0100 Subject: [permissionmanager] bugfix + added locationid 0 to the getAllowedLocations result array if the user has locationid 0 for this permission --- .../permissionmanager/inc/permissionutil.inc.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'modules-available') diff --git a/modules-available/permissionmanager/inc/permissionutil.inc.php b/modules-available/permissionmanager/inc/permissionutil.inc.php index cb70c8bb..5ff41046 100644 --- a/modules-available/permissionmanager/inc/permissionutil.inc.php +++ b/modules-available/permissionmanager/inc/permissionutil.inc.php @@ -18,17 +18,16 @@ class PermissionUtil else $locations[] = 0; } - $res = Database::simpleQuery("SELECT role_x_permission.permissionid as 'permissionid', - role_x_location.locationid as 'locationid' - FROM user_x_role + $res = Database::simpleQuery("SELECT permissionid, locationid FROM user_x_role INNER JOIN role_x_permission ON user_x_role.roleid = role_x_permission.roleid - LEFT JOIN role_x_location ON role_x_permission.roleid = role_x_location.roleid + LEFT JOIN (SELECT roleid, COALESCE(locationid, 0) AS locationid FROM role_x_location) t1 + ON role_x_permission.roleid = t1.roleid WHERE user_x_role.userid = :userid", array("userid" => $userid)); while ($row = $res->fetch(PDO::FETCH_ASSOC)) { - $userPermission = trim($row["permissionid"], "*"); - if (substr($permissionid, 0, strlen($userPermission)) === $userPermission - && (is_null($locationid) || in_array($row["locationid"], $locations))) { + $userPermission = rtrim($row["permissionid"], ".*")."."; + if ((is_null($locationid) || (!is_null($row["locationid"]) && in_array($row["locationid"], $locations))) && + (substr($permissionid.".", 0, strlen($userPermission)) === $userPermission || $userPermission === ".")) { return true; } } @@ -51,8 +50,8 @@ class PermissionUtil $allowedLocations = array(); while ($row = $res->fetch(PDO::FETCH_ASSOC)) { - $userPermission = trim($row["permissionid"], "*"); - if (!is_null($row["locationid"]) && substr($permissionid, 0, strlen($userPermission)) === $userPermission) { + $userPermission = rtrim($row["permissionid"], ".*")."."; + if (substr($permissionid.".", 0, strlen($userPermission)) === $userPermission || $userPermission === ".") { $allowedLocations[$row["locationid"]] = 1; } } @@ -60,6 +59,7 @@ class PermissionUtil $locations = Location::getTree(); if (in_array("0", $allowedLocations)) { $allowedLocations = array_map("intval", Location::extractIds($locations)); + $allowedLocations[] = 0; } else { $allowedLocations = self::getSublocations($locations, $allowedLocations); } -- cgit v1.2.3-55-g7522 From 37e4ff35a2b40cd8513e4f06df720668ba7fa661 Mon Sep 17 00:00:00 2001 From: Udo Walter Date: Wed, 27 Dec 2017 18:25:34 +0100 Subject: [serversetup-bwlp] added permissions to edit boot address and menu and to download the usb image --- modules-available/serversetup-bwlp/lang/de/permissions.json | 5 +++++ modules-available/serversetup-bwlp/lang/en/permissions.json | 5 +++++ modules-available/serversetup-bwlp/page.inc.php | 13 ++++++++----- .../serversetup-bwlp/permissions/permissions.json | 5 +++++ modules-available/serversetup-bwlp/style.css | 12 ++++++++++++ modules-available/serversetup-bwlp/templates/ipaddress.html | 2 +- modules-available/serversetup-bwlp/templates/ipxe.html | 6 +++--- 7 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 modules-available/serversetup-bwlp/lang/de/permissions.json create mode 100644 modules-available/serversetup-bwlp/lang/en/permissions.json create mode 100644 modules-available/serversetup-bwlp/permissions/permissions.json create mode 100644 modules-available/serversetup-bwlp/style.css (limited to 'modules-available') diff --git a/modules-available/serversetup-bwlp/lang/de/permissions.json b/modules-available/serversetup-bwlp/lang/de/permissions.json new file mode 100644 index 00000000..673bf153 --- /dev/null +++ b/modules-available/serversetup-bwlp/lang/de/permissions.json @@ -0,0 +1,5 @@ +{ + "edit.address": "Boot-Adresse des Servers auswählen.", + "edit.menu": "Bootmenü anpassen.", + "download": "USB-Image herunteladen." +} \ No newline at end of file diff --git a/modules-available/serversetup-bwlp/lang/en/permissions.json b/modules-available/serversetup-bwlp/lang/en/permissions.json new file mode 100644 index 00000000..c04f09f7 --- /dev/null +++ b/modules-available/serversetup-bwlp/lang/en/permissions.json @@ -0,0 +1,5 @@ +{ + "edit.address": "Choose boot address of the server.", + "edit.menu": "Customize boot menu.", + "download": "Download USB Image." +} \ No newline at end of file diff --git a/modules-available/serversetup-bwlp/page.inc.php b/modules-available/serversetup-bwlp/page.inc.php index a8d29d6e..16d3f8e2 100644 --- a/modules-available/serversetup-bwlp/page.inc.php +++ b/modules-available/serversetup-bwlp/page.inc.php @@ -12,12 +12,12 @@ class Page_ServerSetup extends Page { User::load(); - if (!User::hasPermission('superadmin')) { + if (!User::isLoggedIn()) { Message::addError('main.no-permission'); Util::redirect('?do=Main'); } - if (Request::any('action') === 'getimage') { + if (Request::any('action') === 'getimage' && User::hasPermission("download")) { $this->handleGetImage(); } @@ -30,13 +30,13 @@ class Page_ServerSetup extends Page $this->getLocalAddresses(); } - if ($action === 'ip') { + if ($action === 'ip' && User::hasPermission("edit.address")) { // New address is to be set $this->getLocalAddresses(); $this->updateLocalAddress(); } - if ($action === 'ipxe') { + if ($action === 'ipxe' && User::hasPermission("edit.menu")) { // iPXE stuff changes $this->updatePxeMenu(); } @@ -52,7 +52,8 @@ class Page_ServerSetup extends Page Render::addTemplate('ipaddress', array( 'ips' => $this->taskStatus['data']['addresses'], - 'chooseHintClass' => $this->hasIpSet ? '' : 'alert alert-danger' + 'chooseHintClass' => $this->hasIpSet ? '' : 'alert alert-danger', + 'editAllowed' => User::hasPermission("edit.address"), )); $data = $this->currentMenu; if (!isset($data['defaultentry'])) { @@ -67,6 +68,8 @@ class Page_ServerSetup extends Page if ($data['defaultentry'] === 'custom') { $data['active-custom'] = 'checked'; } + $data['editAllowed'] = User::hasPermission("edit.menu"); + $data['downloadAllowed'] = User::hasPermission("download"); Render::addTemplate('ipxe', $data); } diff --git a/modules-available/serversetup-bwlp/permissions/permissions.json b/modules-available/serversetup-bwlp/permissions/permissions.json new file mode 100644 index 00000000..2166cf8e --- /dev/null +++ b/modules-available/serversetup-bwlp/permissions/permissions.json @@ -0,0 +1,5 @@ +[ + "edit.address", + "edit.menu", + "download" +] \ No newline at end of file diff --git a/modules-available/serversetup-bwlp/style.css b/modules-available/serversetup-bwlp/style.css new file mode 100644 index 00000000..3aea98af --- /dev/null +++ b/modules-available/serversetup-bwlp/style.css @@ -0,0 +1,12 @@ +.disabledPanel { + cursor: not-allowed; +} + +.disabledPanel > .panel-body { + pointer-events: none; + opacity: 0.8; +} + +.panel-footer .btn-group { + cursor: not-allowed; +} \ No newline at end of file diff --git a/modules-available/serversetup-bwlp/templates/ipaddress.html b/modules-available/serversetup-bwlp/templates/ipaddress.html index 0b3b2ed7..e82253f5 100644 --- a/modules-available/serversetup-bwlp/templates/ipaddress.html +++ b/modules-available/serversetup-bwlp/templates/ipaddress.html @@ -1,4 +1,4 @@ -
    +
    {{lang_bootAddress}}
    diff --git a/modules-available/serversetup-bwlp/templates/ipxe.html b/modules-available/serversetup-bwlp/templates/ipxe.html index bb776dca..e0dc53e5 100644 --- a/modules-available/serversetup-bwlp/templates/ipxe.html +++ b/modules-available/serversetup-bwlp/templates/ipxe.html @@ -3,7 +3,7 @@ -
    +
    {{lang_bootMenu}}
    @@ -52,10 +52,10 @@
    {{^big}} - + {{/big}} {{#big}} - + {{/big}}
    diff --git a/modules-available/syslog/hooks/statistics-machine-replace.inc.php b/modules-available/syslog/hooks/statistics-machine-replace.inc.php new file mode 100644 index 00000000..6be0dd76 --- /dev/null +++ b/modules-available/syslog/hooks/statistics-machine-replace.inc.php @@ -0,0 +1,5 @@ + Request::post('url', 'https://www.bwlehrpool.de/', 'string'), 'insecure-ssl' => Request::post('insecure-ssl', 0, 'int'), + 'reload-minutes' => max(0, Request::post('reloadminutes', 0, 'int')), ); return array('config' => $conf, 'locationids' => []); } @@ -887,6 +888,7 @@ class Page_LocationInfo extends Page 'panelname' => $panel['panelname'], 'url' => $config['url'], 'ssl_checked' => $config['insecure-ssl'] ? 'checked' : '', + 'reloadminutes' => (int)$config['reload-minutes'], )); } else { Render::addTemplate('page-config-panel-summary', array( diff --git a/modules-available/locationinfo/templates/page-config-panel-url.html b/modules-available/locationinfo/templates/page-config-panel-url.html index 401214bd..cca81509 100644 --- a/modules-available/locationinfo/templates/page-config-panel-url.html +++ b/modules-available/locationinfo/templates/page-config-panel-url.html @@ -55,7 +55,10 @@
    - +
    + + +
    + + + -- cgit v1.2.3-55-g7522 From 3d1bfecc21d392e35553c989e24a1cfd532579fb Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 11 Jan 2018 15:15:30 +0100 Subject: Update translations + add global tags lang_username, lang_user and lang_password are now global tags --- modules-available/adduser/lang/de/template-tags.json | 6 ++---- modules-available/adduser/lang/en/template-tags.json | 6 ++---- modules-available/adduser/lang/pt/template-tags.json | 6 ++---- modules-available/dozmod/lang/de/template-tags.json | 4 +--- modules-available/dozmod/lang/en/template-tags.json | 4 +--- modules-available/locationinfo/lang/de/template-tags.json | 2 ++ modules-available/locationinfo/lang/en/template-tags.json | 2 ++ modules-available/main/lang/de/global-tags.json | 3 +++ modules-available/main/lang/en/global-tags.json | 3 +++ modules-available/main/lang/pt/global-tags.json | 3 +++ modules-available/session/lang/de/template-tags.json | 6 ++---- modules-available/session/lang/en/template-tags.json | 6 ++---- modules-available/session/lang/pt/template-tags.json | 6 ++---- modules-available/sysconfig/lang/de/template-tags.json | 3 +-- modules-available/sysconfig/lang/en/template-tags.json | 3 +-- modules-available/sysconfig/lang/pt/template-tags.json | 3 +-- modules-available/usermanagement/lang/en/template-tags.json | 6 ++---- modules-available/usermanagement/lang/pt/template-tags.json | 6 ++---- modules-available/vmstore/lang/de/template-tags.json | 4 +--- modules-available/vmstore/lang/en/template-tags.json | 4 +--- modules-available/vmstore/lang/pt/template-tags.json | 4 +--- 21 files changed, 37 insertions(+), 53 deletions(-) (limited to 'modules-available') diff --git a/modules-available/adduser/lang/de/template-tags.json b/modules-available/adduser/lang/de/template-tags.json index 0f446025..99d17947 100644 --- a/modules-available/adduser/lang/de/template-tags.json +++ b/modules-available/adduser/lang/de/template-tags.json @@ -2,7 +2,5 @@ "lang_confirmation": "Wiederholen", "lang_createUser": "Benutzer anlegen", "lang_fullName": "Vollst\u00e4ndiger Name", - "lang_password": "Passwort", - "lang_telephone": "Telefon", - "lang_username": "Benutzerkennung" -} \ No newline at end of file + "lang_telephone": "Telefon" +} diff --git a/modules-available/adduser/lang/en/template-tags.json b/modules-available/adduser/lang/en/template-tags.json index 42bae6dc..24f8cd42 100644 --- a/modules-available/adduser/lang/en/template-tags.json +++ b/modules-available/adduser/lang/en/template-tags.json @@ -2,7 +2,5 @@ "lang_confirmation": "Confirm Password", "lang_createUser": "Create User", "lang_fullName": "Full Name", - "lang_password": "Password", - "lang_telephone": "Telephone", - "lang_username": "Username" -} \ No newline at end of file + "lang_telephone": "Telephone" +} diff --git a/modules-available/adduser/lang/pt/template-tags.json b/modules-available/adduser/lang/pt/template-tags.json index 524f3dd5..ba204937 100644 --- a/modules-available/adduser/lang/pt/template-tags.json +++ b/modules-available/adduser/lang/pt/template-tags.json @@ -2,7 +2,5 @@ "lang_confirmation": "Confirmar Senha", "lang_createUser": "Criar Usu\u00e1rio", "lang_fullName": "Nome Completo", - "lang_password": "Senha", - "lang_telephone": "Telefone", - "lang_username": "Nome de Usu\u00e1rio" -} \ No newline at end of file + "lang_telephone": "Telefone" +} diff --git a/modules-available/dozmod/lang/de/template-tags.json b/modules-available/dozmod/lang/de/template-tags.json index 4b49579a..a1c23d2e 100644 --- a/modules-available/dozmod/lang/de/template-tags.json +++ b/modules-available/dozmod/lang/de/template-tags.json @@ -54,7 +54,6 @@ "lang_organizationListHeader": "Nutzungsrechte f\u00fcr den Satelliten festlegen", "lang_os": "Betriebssystem", "lang_owner": "Besitzer", - "lang_password": "Passwort", "lang_passwordplaceholder": "SMTP Passwort", "lang_placeholders": "Platzhalter", "lang_port": "Port", @@ -87,8 +86,7 @@ "lang_userList": "Benutzerliste", "lang_userListDescription": "Hier k\u00f6nnen Sie individuelle Nutzer zu \"Super-Usern\" machen. Diese haben in der bwLehrpool-Suite auf alle Veranstaltungen und VMs Vollzugriff, unabh\u00e4ngig von den gesetzten Berechtigungen. Au\u00dferdem k\u00f6nnen Sie hier Benutzer vom Zugriff mittels der bwLehrpool-Suite ausschlie\u00dfen.", "lang_userListHeader": "Dem Satelliten bekannte Benutzer", - "lang_username": "Benutzername", "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/template-tags.json b/modules-available/dozmod/lang/en/template-tags.json index ed8f3465..f12e4ab8 100644 --- a/modules-available/dozmod/lang/en/template-tags.json +++ b/modules-available/dozmod/lang/en/template-tags.json @@ -54,7 +54,6 @@ "lang_organizationListHeader": "Set access permissions for organizations", "lang_os": "Operating System", "lang_owner": "Owner", - "lang_password": "Password", "lang_passwordplaceholder": "SMTP Password", "lang_placeholders": "Placeholders", "lang_port": "Port", @@ -87,8 +86,7 @@ "lang_userList": "User List", "lang_userListDescription": "Here you can promote \"super users\", which will have all permissions in the bwLehrpool-Suite. You can also ban users from accessing this server via the bwLehrpool-Suite.", "lang_userListHeader": "Users known to this satellite", - "lang_username": "Username", "lang_usernameplaceholder": "SMTP Username", "lang_version": "Version timestamp", "lang_when": "When" -} \ No newline at end of file +} diff --git a/modules-available/locationinfo/lang/de/template-tags.json b/modules-available/locationinfo/lang/de/template-tags.json index b305f800..bcdf7148 100644 --- a/modules-available/locationinfo/lang/de/template-tags.json +++ b/modules-available/locationinfo/lang/de/template-tags.json @@ -71,6 +71,8 @@ "lang_prettytimeTooltip": "Verwende ein anderes Anzeigeformat f\u00fcr die Uhrzeit", "lang_recursiveServerSet": "Auch f\u00fcr alle untergeordneten R\u00e4ume setzen", "lang_recursiveSetTooltip": "Wenn aktiviert, wird der Backend-Server auch f\u00fcr alle untergeordneten R\u00e4ume auf den hier gew\u00e4hlten Wert gesetzt", + "lang_reloadIntervalMins": "Neuladen alle X Minuten", + "lang_reloadIntervalTooltip": "Setzen Sie dieses Feld auf einen Wert > 0 (in Minuten), um die Seite auf den Clients regelm\u00e4\u00dfig neu zu laden. Feld auf 0 setzen oder leer lassen deaktiviert diese Funktion.", "lang_remoteSchedule": "Abruf Belegungsplan", "lang_room": "Raum", "lang_roomId": "Raum ID", diff --git a/modules-available/locationinfo/lang/en/template-tags.json b/modules-available/locationinfo/lang/en/template-tags.json index 5679e8b8..558ddff0 100644 --- a/modules-available/locationinfo/lang/en/template-tags.json +++ b/modules-available/locationinfo/lang/en/template-tags.json @@ -71,6 +71,8 @@ "lang_prettytimeTooltip": "Use a different display format for the time", "lang_recursiveServerSet": "Also set for all child locations", "lang_recursiveSetTooltip": "If checked, all direct and indirect child locations will be configured to use the backend server selected above", + "lang_reloadIntervalMins": "Reload every X minutes", + "lang_reloadIntervalTooltip": "Set this field to a value > 0 (in minutes) to reload the page periodically. Set to 0 or leave blank to disable.", "lang_remoteSchedule": "Time table retrieval", "lang_room": "Room", "lang_roomId": "Room ID", diff --git a/modules-available/main/lang/de/global-tags.json b/modules-available/main/lang/de/global-tags.json index 451e016e..de6ee798 100644 --- a/modules-available/main/lang/de/global-tags.json +++ b/modules-available/main/lang/de/global-tags.json @@ -9,9 +9,12 @@ "lang_hours": "Stunde(n)", "lang_next": "Weiter", "lang_no": "Nein", + "lang_password": "Passwort", "lang_reset": "Zur\u00fccksetzen", "lang_save": "Speichern", "lang_today": "Heute", + "lang_user": "Benutzer", + "lang_username": "Benutzername", "lang_yes": "Ja", "lang_yesterday": "Gestern" } \ No newline at end of file diff --git a/modules-available/main/lang/en/global-tags.json b/modules-available/main/lang/en/global-tags.json index bfadf2f2..a915a625 100644 --- a/modules-available/main/lang/en/global-tags.json +++ b/modules-available/main/lang/en/global-tags.json @@ -9,9 +9,12 @@ "lang_hours": "hour(s)", "lang_next": "Next", "lang_no": "No", + "lang_password": "Password", "lang_reset": "Reset", "lang_save": "Save", "lang_today": "Today", + "lang_user": "User", + "lang_username": "Username", "lang_yes": "Yes", "lang_yesterday": "Yesterday" } \ No newline at end of file diff --git a/modules-available/main/lang/pt/global-tags.json b/modules-available/main/lang/pt/global-tags.json index 11e032e2..9029d936 100644 --- a/modules-available/main/lang/pt/global-tags.json +++ b/modules-available/main/lang/pt/global-tags.json @@ -7,8 +7,11 @@ "lang_edit": "Editar", "lang_hours": "Hora(s)", "lang_next": "Pr\u00f3ximo", + "lang_password": "Senha", "lang_reset": "Limpar", "lang_save": "Salvar", "lang_today": "Hoje", + "lang_user": "User", + "lang_username": "Nome do Usu\u00e1rio", "lang_yesterday": "Ontem" } \ No newline at end of file diff --git a/modules-available/session/lang/de/template-tags.json b/modules-available/session/lang/de/template-tags.json index 20f44be0..c7b6d881 100644 --- a/modules-available/session/lang/de/template-tags.json +++ b/modules-available/session/lang/de/template-tags.json @@ -4,9 +4,7 @@ "lang_enter": "Anmeldung", "lang_login": "Anmelden", "lang_newPassword": "Neues Passwort", - "lang_password": "Passwort", "lang_register": "Registrieren", "lang_rememberID": "Angemeldet bleiben", - "lang_repeatPassword": "Passwort wiederholen", - "lang_username": "Benutzerkennung" -} \ No newline at end of file + "lang_repeatPassword": "Passwort wiederholen" +} diff --git a/modules-available/session/lang/en/template-tags.json b/modules-available/session/lang/en/template-tags.json index 663354a9..f9e0b393 100644 --- a/modules-available/session/lang/en/template-tags.json +++ b/modules-available/session/lang/en/template-tags.json @@ -4,9 +4,7 @@ "lang_enter": "Enter", "lang_login": "Login", "lang_newPassword": "New password", - "lang_password": "Password", "lang_register": "Register", "lang_rememberID": "Remember ID", - "lang_repeatPassword": "Repeat password", - "lang_username": "Username" -} \ No newline at end of file + "lang_repeatPassword": "Repeat password" +} diff --git a/modules-available/session/lang/pt/template-tags.json b/modules-available/session/lang/pt/template-tags.json index 3d1e19eb..3a4b9478 100644 --- a/modules-available/session/lang/pt/template-tags.json +++ b/modules-available/session/lang/pt/template-tags.json @@ -1,8 +1,6 @@ { "lang_enter": "Entrar", "lang_login": "Entrar", - "lang_password": "Senha", "lang_register": "Registrar", - "lang_rememberID": "Lembrar Usu\u00e1rio", - "lang_username": "Nome de Usu\u00e1rio" -} \ No newline at end of file + "lang_rememberID": "Lembrar Usu\u00e1rio" +} diff --git a/modules-available/sysconfig/lang/de/template-tags.json b/modules-available/sysconfig/lang/de/template-tags.json index 9ad29e90..7f8511e6 100644 --- a/modules-available/sysconfig/lang/de/template-tags.json +++ b/modules-available/sysconfig/lang/de/template-tags.json @@ -82,7 +82,6 @@ "lang_noValidCert": "Der Server besitzt kein oder ein nicht valides Zertifikat.", "lang_onProblemSearchBase": "Werden keine Benutzer gefunden, dann \u00fcberpr\u00fcfen Sie bitte die Suchbasis", "lang_or": "oder", - "lang_password": "Passwort", "lang_rebuild": "Neu generieren", "lang_rebuildLong": "Modul oder Konfiguration neu generieren. Das entsprechende Modul bzw. Konfiguration ist aktuell und sollte nicht neu generiert werden m\u00fcssen.", "lang_rebuildOutdatedLong": "Modul oder Konfiguration neu generieren. Das entsprechende Modul bzw. Konfiguration ist veraltet oder nicht vorhanden.", @@ -125,4 +124,4 @@ "lang_userDirectoryInfo1": "Optionale Angabe: Wenn die Clients f\u00fcr die Benutzer ein eigenes Verzeichnis (Homeverzeichnis, Benutzerverzeichnis) von einem Server einbinden sollen, geben Sie bitte hier das Format in UNC-Notation an, also z.B.", "lang_userDirectoryInfo2": "%s ist dabei ein Platzhalter f\u00fcr den Login-Namen des Benutzers.", "lang_userDirectoryInfo3": "Das Verzeichnis wird mit den gleichen Zugangsdaten eingebunden, die der Benutzer beim Login angibt. (D.h. kein Kerberos Support o.\u00e4.)" -} \ No newline at end of file +} diff --git a/modules-available/sysconfig/lang/en/template-tags.json b/modules-available/sysconfig/lang/en/template-tags.json index e2cfd114..5a73c254 100644 --- a/modules-available/sysconfig/lang/en/template-tags.json +++ b/modules-available/sysconfig/lang/en/template-tags.json @@ -82,7 +82,6 @@ "lang_noValidCert": "The server did not supply a certificate, or the certificate is invalid.", "lang_onProblemSearchBase": "If no users are found, please check the search base", "lang_or": "or", - "lang_password": "Password", "lang_rebuild": "Rebuild", "lang_rebuildLong": "Rebuild module or configuration.", "lang_rebuildOutdatedLong": "Rebuild module or configuration. The module\/configuration is outdated or missing and should be regenerated.", @@ -125,4 +124,4 @@ "lang_userDirectoryInfo1": "Optional: If the clients should embed a separate directory (home directory, user directory) from a server for the user, please enter here the format in UNC notation, eg", "lang_userDirectoryInfo2": "%s is a placeholder for the user's login name.", "lang_userDirectoryInfo3": "The directory is loaded with the same credentials that the user specifies when login. (That is no Kerberos support, etc.)" -} \ No newline at end of file +} diff --git a/modules-available/sysconfig/lang/pt/template-tags.json b/modules-available/sysconfig/lang/pt/template-tags.json index 2384a891..abf8e075 100644 --- a/modules-available/sysconfig/lang/pt/template-tags.json +++ b/modules-available/sysconfig/lang/pt/template-tags.json @@ -17,7 +17,6 @@ "lang_newConfiguration": "Nova Configura\u00e7\u00e3o", "lang_newModule": "Novo M\u00f3dulo", "lang_noContent": "Sem conte\u00fado!", - "lang_password": "Senha", "lang_searchBase": "Base de Pesquisa", "lang_show": "Mostrar", "lang_systemConfiguration": "Confgura\u00e7\u00e3o do Sistema", @@ -27,4 +26,4 @@ "lang_userDirectoryInfo1": "Opcional: Se os clientes devem incorporar um diret\u00f3rio separado (diret\u00f3rio home, diret\u00f3rio de usu\u00e1rio) de um servidor para o usu\u00e1rio, digite aqui o formato em nota\u00e7\u00e3o UNC, por exemplo,", "lang_userDirectoryInfo2": "%s \u00e9 um marcador para o nome de login do usu\u00e1rio.", "lang_userDirectoryInfo3": "O diret\u00f3rio \u00e9 carregado com as mesmas credenciais que o usu\u00e1rio especifica quando entra. (Isto \u00e9, n\u00e3o h\u00e1 suporte Kerberos, etc)" -} \ No newline at end of file +} diff --git a/modules-available/usermanagement/lang/en/template-tags.json b/modules-available/usermanagement/lang/en/template-tags.json index 66b30c6a..35497fc9 100644 --- a/modules-available/usermanagement/lang/en/template-tags.json +++ b/modules-available/usermanagement/lang/en/template-tags.json @@ -5,11 +5,9 @@ "lang_email": "Email", "lang_login": "Login", "lang_operations": "Operation", - "lang_password": "Password", "lang_remove": "Remove", "lang_telephone": "Telephone", "lang_userAdmin": "Administrator", "lang_userInfo": "On this section, you will be able to create website users, besides editing or removing existing users.", - "lang_userPage": "Users", - "lang_username": "Username" -} \ No newline at end of file + "lang_userPage": "Users" +} diff --git a/modules-available/usermanagement/lang/pt/template-tags.json b/modules-available/usermanagement/lang/pt/template-tags.json index ad84126a..fefb441d 100644 --- a/modules-available/usermanagement/lang/pt/template-tags.json +++ b/modules-available/usermanagement/lang/pt/template-tags.json @@ -5,11 +5,9 @@ "lang_email": "Email", "lang_login": "Login", "lang_operations": "Opera\u00e7\u00f5es", - "lang_password": "Senha", "lang_remove": "Remover", "lang_telephone": "Telefone", "lang_userAdmin": "Administrador", "lang_userInfo": "Nesta se\u00e7\u00e3o voc\u00ea poder\u00e1 criar usu\u00e1rios para o site, al\u00e9m de editar as informa\u00e7\u00f5es ou remover usu\u00e1rios existentes.", - "lang_userPage": "Usu\u00e1rios", - "lang_username": "Nome do Usu\u00e1rio" -} \ No newline at end of file + "lang_userPage": "Usu\u00e1rios" +} diff --git a/modules-available/vmstore/lang/de/template-tags.json b/modules-available/vmstore/lang/de/template-tags.json index d434566a..0b56d84f 100644 --- a/modules-available/vmstore/lang/de/template-tags.json +++ b/modules-available/vmstore/lang/de/template-tags.json @@ -9,11 +9,9 @@ "lang_nfsHelp3": "Die erste Zeile erlaubt den Lese- und Schreibzugriff des\r\nSatellitenservers. Die zweite Zeile erteilt allen anderen Rechnern\r\nausschlie\u00dflich Lesezugriff. Sie k\u00f6nnen dies nat\u00fcrlich auch auf\r\nspezielle Subnetze oder IP-Bereiche beschr\u00e4nken.", "lang_nfsHelp4": "Wenn exklusiv DNBD3 verwendet wird, kann die zweite Zeile ausgelassen\r\nwerden. Dies erh\u00f6ht die Sicherheit.", "lang_noAdditionalInformation": "Keine weitere Konfiguration notwendig", - "lang_password": "Passwort", "lang_path": "Pfad", "lang_readOnly": "Nur-Lese-Zugangsdaten", "lang_readWrite": "Lese\/Schreib-Zugangsdaten", - "lang_username": "Benutzerkennung", "lang_vmLocation": "VM Speicherort", "lang_vmLocationChoose": "Bitte w\u00e4hlen Sie, wo die Images der Virtuellen Maschinen gespeichert werden sollen.", "lang_vmLocationConfiguration": "VM Speicherort wird konfiguriert", @@ -21,4 +19,4 @@ "lang_vmLocationHelp2": "Im Produktivbetrieb bietet es sich an, hierf\u00fcr einen performanten\r\nNetzwerkspeicher zu benutzen. Dieser Netzwerkspeicher kann per NFS oder\r\nCIFS\/SMB eingebunden werden. In jedem Fall muss sichergestellt werden,\r\ndass der Satellitenserver zum Hinzuf\u00fcgen neuer Virtueller Maschinen\r\nSchreibzugriff auf diesen Netzwerkspeicher hat. Bei der Nutzung von\r\nNFSv3 kann dies IP-Basiert eingerichtet werden, f\u00fcr die Nutzung von\r\nCIFS\/SMB k\u00f6nnen Sie Zugangsdaten angeben, die zum Schreiben\r\nberechtigen.", "lang_vmLocationHelp3": "Im Fall von NFS und CIFS ben\u00f6tigen die bwLehrpool-Clients\r\nausschlie\u00dflich Lesezugriff auf den Netzwerkspeicher (und sollten aus\r\nSicherheitsgr\u00fcnden auch wirklich nur lesen k\u00f6nnen). Wenn Sie exklusiv\r\nDNBD3 verwenden, sind f\u00fcr die Clients keine Freigaben oder\r\nBerechtigungen notwendig, da der Zugriff \u00fcber den Sallitenserver\r\nstattfindet.", "lang_vmLocationHelp4": "Sie k\u00f6nnen DNBD3 entweder exklusiv oder mit Fallback auf NFS\/CIFS verwenden. Im exklusiven Modus wird der Zugriff der Clients auf den kompletten VM-Speicher verhindert bzw. erschwert. Die Clients ben\u00f6tigen keinerlei Berechtigungen auf dem konfigurierten Share. Wenn Sie den Fallback Modus nutzen, werden f\u00fcr die Clients weiterhin Leseberechtigungen ben\u00f6tigt." -} \ No newline at end of file +} diff --git a/modules-available/vmstore/lang/en/template-tags.json b/modules-available/vmstore/lang/en/template-tags.json index d78877b9..1e712b13 100644 --- a/modules-available/vmstore/lang/en/template-tags.json +++ b/modules-available/vmstore/lang/en/template-tags.json @@ -9,11 +9,9 @@ "lang_nfsHelp3": "The first line allows read\/write access for the satellite server. The second line grants read-only access for every other IP address. You could limit the second line to specific IP ranges only if desired.", "lang_nfsHelp4": "If using DNBD3 in exclusive mode, you can remove the second line completely, so only the satellite server has access to the NFS store.", "lang_noAdditionalInformation": "No additional cofiguration required", - "lang_password": "Password", "lang_path": "Path", "lang_readOnly": "Read-only Access", "lang_readWrite": "Read\/Write Access", - "lang_username": "Username", "lang_vmLocation": "VM Storage Location", "lang_vmLocationChoose": "Please choose where the images of virtual machines will be stored.", "lang_vmLocationConfiguration": "VM location is configured", @@ -21,4 +19,4 @@ "lang_vmLocationHelp2": "In productive operation, it makes sense for this to use a high-performance network storage. This network storage can be integrated via NFS or CIFS \/ SMB. In any case, it must be ensured that the satellite server has write access to this network storage to add a new Virtual Machine . When using NFSv3 this can be set up IP-based, for the use of CIFS \/ SMB, you can access data disclosures that would entitle them to write.", "lang_vmLocationHelp3": "The bwLehrpool clients only need read access to the network storage (and for security reasons, really can only read). In CIFS \/ SMB You can do this most easily by allowing passwordless guest access with read access to the share.", "lang_vmLocationHelp4": "You can use DNBD3 exclusively or with NFS\/CIFS as fallback. In exclusive mode, you can deny direct access to the NFS\/CIFS store for clients, to prevent anyone from browsing the VM store directly. In fallback mode, the clients first try to use DNBD3 to run a VM and if that fails, they use NFS\/CIFS directly." -} \ No newline at end of file +} diff --git a/modules-available/vmstore/lang/pt/template-tags.json b/modules-available/vmstore/lang/pt/template-tags.json index 90ae64ad..8e0e4267 100644 --- a/modules-available/vmstore/lang/pt/template-tags.json +++ b/modules-available/vmstore/lang/pt/template-tags.json @@ -6,15 +6,13 @@ "lang_nfsHelp1": "\u00c9 necess\u00e1rio um NFSv3-Share. Ele deve poder ser lido por todas as esta\u00e7\u00f5es de trabalho, e poder ser escrito pelo server. Um exemplo, assumindo que o server possui endere\u00e7o ip 1.2.3.4:", "lang_nfsHelp2": "Configura\u00e7\u00e3o alternativa usando all_squash. O usu\u00e1rio com uid 1234 deve possuir ( e poder escrever em ) o diret\u00f3rio exportado.", "lang_noAdditionalInformation": "Nenhuma configura\u00e7\u00e3o adicional necess\u00e1ria", - "lang_password": "Senha", "lang_readOnly": "Acesso Somente Leitura", "lang_readWrite": "Acesso Leitura\/Escrita", "lang_save": "Salvar", - "lang_username": "Nome de Usu\u00e1rio", "lang_vmLocation": "Localiza\u00e7\u00e3o da VM", "lang_vmLocationChoose": "Por favor, escolha aonde as imagens das m\u00e1quinas virtuais ser\u00e3o armazenadas.", "lang_vmLocationConfiguration": "Localiza\u00e7\u00e3o da VM \u00e9 configurada", "lang_vmLocationHelp1": "Para fins de teste, as VMs podem ser armazenados diretamente no servidor sat\u00e9lite. No entanto, se voc\u00ea operar o vmdk do sat\u00e9lite entregue por favor lembre-se que voc\u00ea tem apenas cerca de 100 GB de mem\u00f3ria.", "lang_vmLocationHelp2": "Em opera\u00e7\u00e3o, faz sentido para este usar um armazenamento de rede de alto desempenho. Este armazenamento de rede pode ser integrado atrav\u00e9s de NFS ou CIFS \/ SMB. Em qualquer caso, deve-se assegurar de que o servidor de sat\u00e9lite tenha acesso de grava\u00e7\u00e3o para este armazenamento de rede para poder adicionar uma nova m\u00e1quina virtual. Ao utilizar NFSv3 este pode ser configurado com base em IP, para o uso de CIFS \/ SMB, voc\u00ea pode acessar as divulga\u00e7\u00f5es de dados que lhe permitiria escrever.", "lang_vmLocationHelp3": "Os clientes bwLehrpool s\u00f3 precisam ter acesso de leitura ao armazenamento de rede (e por raz\u00f5es de seguran\u00e7a, realmente s\u00f3 pode ler). Em CIFS \/ SMB Voc\u00ea pode fazer isso mais facilmente, permitindo o acesso a visitantes sem senha com acesso de leitura." -} \ No newline at end of file +} -- cgit v1.2.3-55-g7522 From dfe2d7225191c87905ed6487cd810d54ec8cb14a Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 11 Jan 2018 15:23:19 +0100 Subject: [permissionmanager] Sanitize language tag names --- .../permissionmanager/lang/de/template-tags.json | 20 ++++++++++---------- .../permissionmanager/lang/en/template-tags.json | 20 ++++++++++---------- modules-available/permissionmanager/page.inc.php | 4 ++-- .../permissionmanager/templates/_page.html | 6 +++--- .../permissionmanager/templates/locationstable.html | 4 ++-- .../permissionmanager/templates/roleeditor.html | 10 +++++----- .../permissionmanager/templates/rolestable.html | 10 +++++----- .../permissionmanager/templates/userstable.html | 14 +++++++------- 8 files changed, 44 insertions(+), 44 deletions(-) (limited to 'modules-available') diff --git a/modules-available/permissionmanager/lang/de/template-tags.json b/modules-available/permissionmanager/lang/de/template-tags.json index 88652152..71bd4075 100644 --- a/modules-available/permissionmanager/lang/de/template-tags.json +++ b/modules-available/permissionmanager/lang/de/template-tags.json @@ -1,22 +1,22 @@ { - "lang_Roles": "Rollen", - "lang_Users": "Nutzer", - "lang_Locations": "Räume", + "lang_roles": "Rollen", + "lang_users": "Nutzer", + "lang_locations": "Räume", "lang_addRole": "Rollen erteilen", "lang_removeRole": "Rollen entziehen", "lang_newRole": "Rolle anlegen", - "lang_Selected": "Ausgewählt", - "lang_Edit": "Bearbeiten", - "lang_Delete": "Löschen", + "lang_selected": "Ausgewählt", + "lang_edit": "Bearbeiten", + "lang_delete": "Löschen", "lang_removeCheck": "Sind Sie sich sicher, dass Sie diese Rolle entfernen wollen?", "lang_deleteCheck": "Sind Sie sich sicher, dass Sie diese Rolle löschen wollen?", "lang_emptyNameWarning": "Der Name der Rolle darf nicht leer sein!", - "lang_Name": "Name", - "lang_Cancel": "Abbrechen", - "lang_Save": "Speichern", + "lang_name": "Name", + "lang_cancel": "Abbrechen", + "lang_save": "Speichern", "lang_all": "alle", "lang_selected": "ausgewählte", - "lang_Permissions": "Rechte", + "lang_permissions": "Rechte", "lang_selectizePlaceholder": "Nach Rollen filtern...", "lang_searchPlaceholder": "Nach Rollen suchen...", "lang_moduleName": "Rechtemanager", diff --git a/modules-available/permissionmanager/lang/en/template-tags.json b/modules-available/permissionmanager/lang/en/template-tags.json index 08769f27..2d31b294 100644 --- a/modules-available/permissionmanager/lang/en/template-tags.json +++ b/modules-available/permissionmanager/lang/en/template-tags.json @@ -1,22 +1,22 @@ { - "lang_Roles": "Roles", - "lang_Users": "Users", - "lang_Locations": "Locations", + "lang_roles": "Roles", + "lang_users": "Users", + "lang_locations": "Locations", "lang_addRole": "Grant Roles", "lang_removeRole": "Revoke Roles", "lang_newRole": "New Role", - "lang_Selected": "Selected", - "lang_Edit": "Edit", - "lang_Delete": "Delete", + "lang_selected": "Selected", + "lang_edit": "Edit", + "lang_delete": "Delete", "lang_removeCheck": "Are you sure you want to remove this role?", "lang_deleteCheck": "Are you sure you want to delete this role?", "lang_emptyNameWarning": "Role name can not be empty!", - "lang_Name": "Name", - "lang_Cancel": "Cancel", - "lang_Save": "Save", + "lang_name": "Name", + "lang_cancel": "Cancel", + "lang_save": "Save", "lang_all": "all", "lang_selected": "selected", - "lang_Permissions": "Permissions", + "lang_permissions": "Permissions", "lang_selectizePlaceholder": "Filter for roles...", "lang_searchPlaceholder": "Search for roles...", "lang_moduleName": "Permission Manager", diff --git a/modules-available/permissionmanager/page.inc.php b/modules-available/permissionmanager/page.inc.php index eeed9c02..13d81c6a 100644 --- a/modules-available/permissionmanager/page.inc.php +++ b/modules-available/permissionmanager/page.inc.php @@ -116,7 +116,7 @@ class Page_PermissionManager extends Page if ($toplevel) { $res = Render::parse("treepanel", array("id" => "*", - "name" => Dictionary::translateFile("template-tags", "lang_Permissions"), + "name" => Dictionary::translateFile("template-tags", "lang_permissions"), "checkboxname" => "permissions", "selected" => $selectAll, "HTML" => $res)); @@ -151,7 +151,7 @@ class Page_PermissionManager extends Page if ($toplevel) { $res = Render::parse("treepanel", array("id" => 0, - "name" => Dictionary::translateFile("template-tags", "lang_Locations"), + "name" => Dictionary::translateFile("template-tags", "lang_locations"), "checkboxname" => "locations", "selected" => $selectAll, "HTML" => $res)); diff --git a/modules-available/permissionmanager/templates/_page.html b/modules-available/permissionmanager/templates/_page.html index 405462f7..4140ce78 100644 --- a/modules-available/permissionmanager/templates/_page.html +++ b/modules-available/permissionmanager/templates/_page.html @@ -8,17 +8,17 @@
    diff --git a/modules-available/permissionmanager/templates/locationstable.html b/modules-available/permissionmanager/templates/locationstable.html index b910e3f3..153258fe 100644 --- a/modules-available/permissionmanager/templates/locationstable.html +++ b/modules-available/permissionmanager/templates/locationstable.html @@ -15,8 +15,8 @@
    - - + + diff --git a/modules-available/permissionmanager/templates/roleeditor.html b/modules-available/permissionmanager/templates/roleeditor.html index ddf6ace9..871fd0cc 100644 --- a/modules-available/permissionmanager/templates/roleeditor.html +++ b/modules-available/permissionmanager/templates/roleeditor.html @@ -7,15 +7,15 @@
    diff --git a/modules-available/permissionmanager/templates/rolestable.html b/modules-available/permissionmanager/templates/rolestable.html index 7152a1dd..b121a9e0 100644 --- a/modules-available/permissionmanager/templates/rolestable.html +++ b/modules-available/permissionmanager/templates/rolestable.html @@ -17,9 +17,9 @@
    {{lang_Locations}}{{lang_Roles}}{{lang_locations}}{{lang_roles}}
    - - - + + + @@ -47,7 +47,7 @@ diff --git a/modules-available/permissionmanager/templates/userstable.html b/modules-available/permissionmanager/templates/userstable.html index 749ae03d..bb0e228e 100644 --- a/modules-available/permissionmanager/templates/userstable.html +++ b/modules-available/permissionmanager/templates/userstable.html @@ -23,9 +23,9 @@
    {{lang_Roles}}{{lang_Edit}}{{lang_Delete}}{{lang_roles}}{{lang_edit}}{{lang_delete}}
    - - - + + + @@ -65,8 +65,8 @@
    {{lang_Users}}{{lang_Roles}}{{lang_Selected}}{{lang_users}}{{lang_roles}}{{lang_selected}}
    - - + + @@ -108,8 +108,8 @@
    {{lang_Roles}}{{lang_Selected}}{{lang_roles}}{{lang_selected}}
    - - + + -- cgit v1.2.3-55-g7522 From f29bfb7c32a3a968cd46940612e877aa18528c55 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 12 Jan 2018 12:38:05 +0100 Subject: [statistics] Fix display of machine usage history bar --- modules-available/statistics/page.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules-available') diff --git a/modules-available/statistics/page.inc.php b/modules-available/statistics/page.inc.php index 877a90f2..ac103a41 100644 --- a/modules-available/statistics/page.inc.php +++ b/modules-available/statistics/page.inc.php @@ -947,9 +947,9 @@ class Page_Statistics extends Page // Not seen in last two weeks $spans['graph'] .= '
     
    '; } - if (isset($client['state_occupied'])) { + if ($client['state'] === 'OCCUPIED') { $spans['graph'] .= '
     
    '; - } elseif (isset($client['state_off'])) { + } elseif ($client['state'] === 'OFFLINE') { $spans['graph'] .= '
     
    '; } $t = explode('-', date('Y-n-j-G', $cutoff)); -- cgit v1.2.3-55-g7522 From 328744cad82f06ab736f3faf75667fa8a96d9d2a Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 15 Jan 2018 11:38:43 +0100 Subject: [statistics] Fix "filter by cores" button in client list Closes #3284 --- modules-available/statistics/templates/clientlist.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'modules-available') diff --git a/modules-available/statistics/templates/clientlist.html b/modules-available/statistics/templates/clientlist.html index 3d3e66a4..799c9c95 100644 --- a/modules-available/statistics/templates/clientlist.html +++ b/modules-available/statistics/templates/clientlist.html @@ -11,27 +11,27 @@ -- cgit v1.2.3-55-g7522 From e7e7a3ead773298256f6b6639deadefd37396ecc Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 15 Jan 2018 11:54:48 +0100 Subject: [statistics] Fix typo in last commit --- modules-available/statistics/templates/clientlist.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules-available') diff --git a/modules-available/statistics/templates/clientlist.html b/modules-available/statistics/templates/clientlist.html index 799c9c95..0ddd98c8 100644 --- a/modules-available/statistics/templates/clientlist.html +++ b/modules-available/statistics/templates/clientlist.html @@ -30,7 +30,7 @@ -- cgit v1.2.3-55-g7522 From d0fec47b6d956ee60cc77222588864b8efcefa6c Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 15 Jan 2018 16:56:08 +0100 Subject: [statistics] Fix runtime filter (had math backwards) --- modules-available/statistics/inc/filter.inc.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'modules-available') diff --git a/modules-available/statistics/inc/filter.inc.php b/modules-available/statistics/inc/filter.inc.php index 1686f328..f6765059 100644 --- a/modules-available/statistics/inc/filter.inc.php +++ b/modules-available/statistics/inc/filter.inc.php @@ -155,19 +155,19 @@ class RuntimeFilter extends Filter public function whereClause(&$args, &$joins) { global $SIZE_RAM; - $lower = time() + (int)$this->argument * 3600; - $upper = $lower + 3600; + $upper = time() - (int)$this->argument * 3600; + $lower = $upper - 3600; $common = "state IN ('OCCUPIED', 'IDLE', 'STANDBY') AND"; if ($this->operator == '=') { return "$common ({$this->column} BETWEEN $lower AND $upper)"; } elseif ($this->operator == '<') { - return "$common {$this->column} < $lower"; + return "$common {$this->column} > $upper"; } elseif ($this->operator == '<=') { - return "$common {$this->column} < $upper"; + return "$common {$this->column} > $lower"; } elseif ($this->operator == '>') { - return "$common {$this->column} > $upper"; + return "$common {$this->column} < $lower"; } elseif ($this->operator == '>=') { - return "$common {$this->column} > $lower"; + return "$common {$this->column} < $upper"; } elseif ($this->operator == '!=') { return "$common ({$this->column} < $lower OR {$this->column} > $upper)"; } else { -- cgit v1.2.3-55-g7522 From 9fdf21f602de38ebcd9cb0ccb03c709a06cd2d06 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 15 Jan 2018 17:19:56 +0100 Subject: [runmode] Do not allow re-assigning clients to new runmode if old mode doesn't support the generic editor Doing so might leave some stale data in the old module, so we better prevent it so the user has to manually remove the client from the old runmode using the non-generic way (module specific) first. --- modules-available/dnbd3/hooks/runmode/config.json | 4 +++- modules-available/runmode/inc/runmode.inc.php | 2 +- modules-available/runmode/lang/de/messages.json | 1 + modules-available/runmode/lang/en/messages.json | 1 + modules-available/runmode/page.inc.php | 24 ++++++++++++++++------ .../runmode/templates/module-machine-list.html | 4 ++-- 6 files changed, 26 insertions(+), 10 deletions(-) (limited to 'modules-available') diff --git a/modules-available/dnbd3/hooks/runmode/config.json b/modules-available/dnbd3/hooks/runmode/config.json index 095cb42f..5db53f0b 100644 --- a/modules-available/dnbd3/hooks/runmode/config.json +++ b/modules-available/dnbd3/hooks/runmode/config.json @@ -2,5 +2,7 @@ "isClient": false, "configHook": "Dnbd3Util::runmodeConfigHook", "noSysconfig": true, - "systemdDefaultTarget": "dnbd3-proxy" + "systemdDefaultTarget": "dnbd3-proxy", + "allowGenericEditor": false, + "deleteUrlSnippet": "dummyparam=" } \ No newline at end of file diff --git a/modules-available/runmode/inc/runmode.inc.php b/modules-available/runmode/inc/runmode.inc.php index ad1f52bf..2c8083ca 100644 --- a/modules-available/runmode/inc/runmode.inc.php +++ b/modules-available/runmode/inc/runmode.inc.php @@ -72,7 +72,7 @@ class RunMode * @param string $machineuuid * @param int $returnData bitfield of data to return * @return false|array {'machineuuid', 'isclient', 'module', 'modeid', 'modedata', - * <'hostname', 'clientip', 'macaddr', 'locationid', 'lastseen'>} + * ('hostname', 'clientip', 'macaddr', 'locationid', 'lastseen'), ('moduleName', 'modeName')} */ public static function getRunMode($machineuuid, $returnData = self::DATA_MACHINE_DATA) { diff --git a/modules-available/runmode/lang/de/messages.json b/modules-available/runmode/lang/de/messages.json index 21b4b6ae..911d48d4 100644 --- a/modules-available/runmode/lang/de/messages.json +++ b/modules-available/runmode/lang/de/messages.json @@ -5,5 +5,6 @@ "machine-not-found": "Rechner {{0}} nicht gefunden", "machine-not-runmode": "Rechner {{0}} hatte keinen speziellen Betriebsmodus aktiviert", "machine-removed": "Rechner {{0}} entfernt", + "machine-still-assigned": "Rechner {{0}} ist noch im Betriebsmodus {{1}}; ignoriert.", "module-hasnt-runmode": "Modul {{0}} bietet keine speziellen Betriebsmodi" } \ No newline at end of file diff --git a/modules-available/runmode/lang/en/messages.json b/modules-available/runmode/lang/en/messages.json index 1985ca66..6d890428 100644 --- a/modules-available/runmode/lang/en/messages.json +++ b/modules-available/runmode/lang/en/messages.json @@ -5,5 +5,6 @@ "machine-not-found": "Client {{0}} not found", "machine-not-runmode": "No special mode of operation configured for client {{0}}", "machine-removed": "Removed client {{0}}", + "machine-still-assigned": "Client {{0}} still set to mode {{1}}, not assigning new mode.", "module-hasnt-runmode": "Module {{0}} doesn't supply any special mode of operation" } \ No newline at end of file diff --git a/modules-available/runmode/page.inc.php b/modules-available/runmode/page.inc.php index e26950d0..b94b8a31 100644 --- a/modules-available/runmode/page.inc.php +++ b/modules-available/runmode/page.inc.php @@ -42,6 +42,14 @@ class Page_RunMode extends Page } $active = 0; foreach ($machines as $machine) { + $oldMode = RunMode::getRunMode($machine, 0); + if ($oldMode !== false) { + $oldModule = RunMode::getModuleConfig($oldMode['module']); + if ($oldModule !== false && (!$oldModule->allowGenericEditor || $oldModule->deleteUrlSnippet !== false)) { + Message::addError('runmode.machine-still-assigned', $machine, $oldMode['module']); + continue; + } + } $ret = RunMode::setRunMode($machine, $module, $modeId, null, null); if ($ret) { $active++; @@ -105,10 +113,6 @@ class Page_RunMode extends Page Message::addError('module-hasnt-runmode', $moduleId); Util::redirect('?do=runmode'); } - if (!$config->allowGenericEditor) { - Message::addError('runmode.cannot-edit-module', $moduleId); - return; - } // Given modeId? $modeId = Request::get('modeid', false, 'string'); if ($modeId !== false) { @@ -170,9 +174,17 @@ class Page_RunMode extends Page { $moduleId = $module->getIdentifier(); $modeName = RunMode::getModeName($moduleId, $modeId); + $redirect = Request::get('redirect', '', 'string'); + if (empty($redirect)) { + $redirect = '?do=runmode'; + } if ($modeName === false) { Message::addError('invalid-modeid', $moduleId, $modeId); - Util::redirect('?do=runmode'); + Util::redirect($redirect); + } + if (!RunMode::getModuleConfig($moduleId)->allowGenericEditor) { + Message::addError('runmode.cannot-edit-module', $module); + Util::redirect($redirect); } Render::addTemplate('machine-selector', [ 'module' => $moduleId, @@ -180,7 +192,7 @@ class Page_RunMode extends Page 'moduleName' => $module->getDisplayName(), 'modeName' => $modeName, 'machines' => json_encode(RunMode::getForMode($module, $modeId, true)), - 'redirect' => Request::get('redirect', '', 'string'), + 'redirect' => $redirect, ]); } diff --git a/modules-available/runmode/templates/module-machine-list.html b/modules-available/runmode/templates/module-machine-list.html index 61bbbad9..283fb393 100644 --- a/modules-available/runmode/templates/module-machine-list.html +++ b/modules-available/runmode/templates/module-machine-list.html @@ -41,8 +41,8 @@ {{/canedit}} {{#deleteUrl}} - - + + {{/deleteUrl}} -- cgit v1.2.3-55-g7522 From 9b8295a02aa5b8e864c1f42ec52ead4fe0dd3f2f Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 15 Jan 2018 17:21:18 +0100 Subject: [statistics] Properly display runmode name in client list --- modules-available/statistics/page.inc.php | 7 +++++++ modules-available/statistics/templates/clientlist.html | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'modules-available') diff --git a/modules-available/statistics/page.inc.php b/modules-available/statistics/page.inc.php index ac103a41..5fe4ebfa 100644 --- a/modules-available/statistics/page.inc.php +++ b/modules-available/statistics/page.inc.php @@ -661,6 +661,13 @@ class Page_Statistics extends Page } } $row['cpumodel'] = preg_replace('/\(R\)|\(TM\)|\bintel\b|\bamd\b|\bcpu\b|dual-core|\bdual\s+core\b|\bdual\b|\bprocessor\b/i', ' ', $row['cpumodel']); + if (!empty($row['rmmodule'])) { + $data = RunMode::getRunMode($row['machineuuid'], RunMode::DATA_STRINGS); + if ($data !== false) { + $row['moduleName'] = $data['moduleName']; + $row['modeName'] = $data['modeName']; + } + } $rows[] = $row; } if ($singleMachine !== false && $singleMachine !== 'none') { diff --git a/modules-available/statistics/templates/clientlist.html b/modules-available/statistics/templates/clientlist.html index 0ddd98c8..d06eb4f7 100644 --- a/modules-available/statistics/templates/clientlist.html +++ b/modules-available/statistics/templates/clientlist.html @@ -72,7 +72,11 @@ {{/state_STANDBY}} {{hostname}}
    {{machineuuid}}
    - {{#rmmodule}}
    {{lang_runMode}}: {{rmmodule}}
    {{/rmmodule}} + {{#rmmodule}} +
    {{lang_runMode}}: + {{moduleName}} / {{modeName}} +
    + {{/rmmodule}} -- cgit v1.2.3-55-g7522 From de8c8f6ba176855e5a461f0de1edd73793c74f8f Mon Sep 17 00:00:00 2001 From: Steffen Ritter Date: Tue, 16 Jan 2018 13:44:20 +0100 Subject: [syslog] Make client ip clickable, linking to statistics --- modules-available/syslog/page.inc.php | 4 ++-- modules-available/syslog/templates/page-syslog.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'modules-available') diff --git a/modules-available/syslog/page.inc.php b/modules-available/syslog/page.inc.php index c679877a..153b591f 100644 --- a/modules-available/syslog/page.inc.php +++ b/modules-available/syslog/page.inc.php @@ -55,10 +55,10 @@ class Page_SysLog extends Page else $whereClause .= ' AND '; - $whereClause .= "machineuuid='" . preg_replace('/[^0-9a-zA-Z\-]/', '', Request::get('machineuuid', '', 'string')) . "'"; + $whereClause .= "machineuuid='" . preg_replace('/[^0-9a-zA-Z\-]/', '', Request::get('machineuuid', '', 'string')) . "'"; } $lines = array(); - $paginate = new Paginate("SELECT logid, dateline, logtypeid, clientip, description, extra FROM clientlog $whereClause ORDER BY logid DESC", 50); + $paginate = new Paginate("SELECT logid, dateline, logtypeid, clientip, machineuuid, description, extra FROM clientlog $whereClause ORDER BY logid DESC", 50); $res = $paginate->exec(); while ($row = $res->fetch(PDO::FETCH_ASSOC)) { $row['date'] = Util::prettyTime($row['dateline']); diff --git a/modules-available/syslog/templates/page-syslog.html b/modules-available/syslog/templates/page-syslog.html index 8b590038..d4709456 100644 --- a/modules-available/syslog/templates/page-syslog.html +++ b/modules-available/syslog/templates/page-syslog.html @@ -45,7 +45,7 @@ - +
    {{lang_Roles}}{{lang_Selected}}{{lang_roles}}{{lang_selected}}
    -
    - {{subnet}}{{lastoctet}}
    {{macaddr}}
    {{lastseen}}
    {{date}}{{clientip}}{{clientip}} {{description}} {{#extra}} file, $list); } diff --git a/modules-available/syslog/hooks/statistics-machine-replace.inc.php b/modules-available/syslog/hooks/statistics-machine-replace.inc.php deleted file mode 100644 index 6be0dd76..00000000 --- a/modules-available/syslog/hooks/statistics-machine-replace.inc.php +++ /dev/null @@ -1,5 +0,0 @@ - @@ -82,7 +85,7 @@