From 3d88bb5a4223d3fdc9084eee3e75defc8da674b0 Mon Sep 17 00:00:00 2001 From: Udo Walter Date: Tue, 21 Nov 2017 17:24:44 +0100 Subject: [permissionmanager] added key relationships to install script; changed nested php for loops to sql code; standardized sql column naming; small bugfixes; --- .../permissionmanager/clientscript.js | 4 +- .../inc/getpermissiondata.inc.php | 84 +++++++++------------- .../inc/permissiondbupdate.inc.php | 62 ++++++++-------- .../permissionmanager/inc/permissionutil.inc.php | 10 +-- .../permissionmanager/install.inc.php | 83 +++++++++++++++++---- modules-available/permissionmanager/page.inc.php | 28 +++----- modules-available/permissionmanager/style.css | 2 +- .../permissionmanager/templates/_page.html | 6 +- .../templates/locationstable.html | 10 +-- .../permissionmanager/templates/roleeditor.html | 6 +- .../permissionmanager/templates/rolestable.html | 10 +-- .../permissionmanager/templates/userstable.html | 16 ++--- 12 files changed, 173 insertions(+), 148 deletions(-) diff --git a/modules-available/permissionmanager/clientscript.js b/modules-available/permissionmanager/clientscript.js index 1881c70d..700ebc11 100644 --- a/modules-available/permissionmanager/clientscript.js +++ b/modules-available/permissionmanager/clientscript.js @@ -19,7 +19,7 @@ document.addEventListener("DOMContentLoaded", function() { $('.dataTable tbody').find('tr').hide(); } // Find all rows which shall be shown and increase their counter by 1 - $(".roleId-" + value).closest("tr").each(function () { + $(".roleid-" + value).closest("tr").each(function () { $(this).data("selectizeCount", $(this).data("selectizeCount") + 1); $(this).show(); }); @@ -31,7 +31,7 @@ document.addEventListener("DOMContentLoaded", function() { $('.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 () { + $(".roleid-" + value).closest("tr").each(function () { $(this).data("selectizeCount", $(this).data("selectizeCount") - 1); // If counter is 0, hide the row (no filter given to show the row anymore) if ($(this).data("selectizeCount") === 0) { diff --git a/modules-available/permissionmanager/inc/getpermissiondata.inc.php b/modules-available/permissionmanager/inc/getpermissiondata.inc.php index 5114f4ef..9d69c722 100644 --- a/modules-available/permissionmanager/inc/getpermissiondata.inc.php +++ b/modules-available/permissionmanager/inc/getpermissiondata.inc.php @@ -8,8 +8,8 @@ class GetPermissionData { $userdata= array(); while ($row = $res->fetch(PDO::FETCH_ASSOC)) { $userdata[$row['userid'].' '.$row['login']][] = array( - 'roleId' => $row['roleId'], - 'roleName' => $row['roleName'] + 'roleid' => $row['roleid'], + 'rolename' => $row['rolename'] ); } $data = array(); @@ -26,60 +26,51 @@ class GetPermissionData { // get LocationIDs, Location Names, Roles of each Location public static function getLocationData() { - $res = self::queryLocationData(); - $locdata = array(); + $res = Database::simpleQuery("SELECT role.roleid as roleid, rolename, GROUP_CONCAT(locationid) as locationids FROM role + LEFT JOIN (SELECT roleid, COALESCE(locationid, 0) AS locationid FROM role_x_location) rxl + ON role.roleid = rxl.roleid GROUP BY roleid ORDER BY rolename ASC"); + $locations = Location::getLocations(0, 0, false, true); while ($row = $res->fetch(PDO::FETCH_ASSOC)) { - $locdata[$row['locid'].' '.$row['locname']][] = array( - 'roleId' => $row['roleId'], - 'roleName' => $row['roleName'] - ); + $locationids = explode(",", $row['locationids']); + if (in_array("0", $locationids)) { + $locationids = array_map("intval", Location::extractIds(Location::getTree())); + } else { + $locationids = PermissionUtil::getSublocations(Location::getTree(), $locationids); + } + foreach ($locationids as $locationid) { + $locations[$locationid]['roles'][] = array( + 'roleid' => $row['roleid'], + 'rolename' => $row['rolename'] + ); + } } - $data = array(); - foreach($locdata AS $loc => $roles) { - $loc = explode(" ", $loc, 2); - $data[] = array( - 'locid' => $loc[0], - 'locname' => $loc[1], - 'roles' => $roles - ); - } - return $data; + return array_values($locations); } // get all roles from database (id and name) public static function getRoles() { - $res = Database::simpleQuery("SELECT id, name FROM role ORDER BY name ASC"); + $res = Database::simpleQuery("SELECT roleid, rolename FROM role ORDER BY rolename ASC"); $data = array(); while ($row = $res->fetch(PDO::FETCH_ASSOC)) { $data[] = array( - 'roleId' => $row['id'], - 'roleName' => $row['name'] + 'roleid' => $row['roleid'], + 'rolename' => $row['rolename'] ); } return $data; } - public static function getLocations($selected) { - $res = Database::simplequery("SELECT locationid, locationname FROM location"); - $data = array(); - while ($row = $res->fetch(PDO::FETCH_ASSOC)) { - $data[] = array('locid' => $row['locationid'], 'locName' => $row['locationname'], - 'selected' => in_array($row['locationid'], $selected) ? "selected" : ""); - } - return $data; - } - - public static function getRoleData($roleId) { - $query = "SELECT id, name FROM role WHERE id = :roleId"; - $data = Database::queryFirst($query, array("roleId" => $roleId)); - $query = "SELECT roleid, locid FROM role_x_location WHERE roleid = :roleId"; - $res = Database::simpleQuery($query, array("roleId" => $roleId)); + public static function getRoleData($roleid) { + $query = "SELECT roleid, rolename FROM role WHERE roleid = :roleid"; + $data = Database::queryFirst($query, array("roleid" => $roleid)); + $query = "SELECT roleid, locationid FROM role_x_location WHERE roleid = :roleid"; + $res = Database::simpleQuery($query, array("roleid" => $roleid)); $data["locations"] = array(); while ($row = $res->fetch(PDO::FETCH_ASSOC)) { - $data["locations"][] = $row['locid']; + $data["locations"][] = $row['locationid']; } - $query = "SELECT roleid, permissionid FROM role_x_permission WHERE roleid = :roleId"; - $res = Database::simpleQuery($query, array("roleId" => $roleId)); + $query = "SELECT roleid, permissionid FROM role_x_permission WHERE roleid = :roleid"; + $res = Database::simpleQuery($query, array("roleid" => $roleid)); $data["permissions"] = array(); while ($row = $res->fetch(PDO::FETCH_ASSOC)) { $data["permissions"][] = $row['permissionid']; @@ -89,21 +80,10 @@ class GetPermissionData { // 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.name AS roleName, role.id AS roleId + $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.id - "); - return $res; - } - - // LocationID, Location Name, Roles of each Location - private static function queryLocationData() { - $res = Database::simpleQuery("SELECT location.locationid AS locid, location.locationname AS locname, role.name AS roleName, role.id AS roleId - FROM location - LEFT JOIN role_x_location ON location.locationid = role_x_location.locid - LEFT JOIN role ON role_x_location.roleid = role.id - ORDER BY location.locationname + LEFT JOIN role ON user_x_role.roleid = role.roleid "); return $res; } diff --git a/modules-available/permissionmanager/inc/permissiondbupdate.inc.php b/modules-available/permissionmanager/inc/permissiondbupdate.inc.php index 87c989fa..f144b35e 100644 --- a/modules-available/permissionmanager/inc/permissiondbupdate.inc.php +++ b/modules-available/permissionmanager/inc/permissiondbupdate.inc.php @@ -4,53 +4,49 @@ class PermissionDbUpdate { // insert new user_x_role to database. "ignore" to ignore duplicate entry try public static function addRoleToUser($users, $roles) { - foreach($users AS $user) { - foreach ($roles AS $role) { - $query = "INSERT IGNORE INTO user_x_role (userid, roleid) VALUES (:user, :role)"; - Database::exec($query, array("user" => $user, "role" => $role)); + $query = "INSERT IGNORE INTO user_x_role (userid, roleid) VALUES (:userid, :roleid)"; + foreach($users AS $userid) { + foreach ($roles AS $roleid) { + Database::exec($query, array("userid" => $userid, "roleid" => $roleid)); } } } // remove user_x_role entry from database public static function removeRoleFromUser($users, $roles) { - foreach($users AS $user) { - foreach ($roles AS $role) { - $query = "DELETE FROM user_x_role WHERE userid = :user AND roleid = :role"; - Database::exec($query, array("user" => $user, "role" => $role)); - } - } + $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 - public static function deleteRole($id) { - $query = "DELETE FROM role WHERE id = :id"; - Database::exec($query, array("id" => $id)); - $query = "DELETE FROM user_x_role WHERE roleid = :id"; - Database::exec($query, array("id" => $id)); - $query = "DELETE FROM role_x_location WHERE roleid = :id"; - Database::exec($query, array("id" => $id)); - $query = "DELETE FROM role_x_permission WHERE roleid = :id"; - Database::exec($query, array("id" => $id)); + 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)); } - public static function saveRole($roleName, $locations, $permissions, $role = NULL) { - if ($role) { - Database::exec("UPDATE role SET name = :roleName WHERE id = :role", - array("roleName" => $roleName, "role" => $role)); - Database::exec("DELETE FROM role_x_location WHERE roleid = :role", array("role" => $role)); - Database::exec("DELETE FROM role_x_permission WHERE roleid = :role", array("role" => $role)); + public static function saveRole($rolename, $locations, $permissions, $roleid = NULL) { + if ($roleid) { + Database::exec("UPDATE role SET rolename = :rolename WHERE roleid = :roleid", + array("rolename" => $rolename, "roleid" => $roleid)); + Database::exec("DELETE FROM role_x_location WHERE roleid = :roleid", array("roleid" => $roleid)); + Database::exec("DELETE FROM role_x_permission WHERE roleid = :roleid", array("roleid" => $roleid)); } else { - Database::exec("INSERT INTO role (name) VALUES (:roleName)", array("roleName" => $roleName)); - $role = Database::lastInsertId(); + Database::exec("INSERT INTO role (rolename) VALUES (:rolename)", array("rolename" => $rolename)); + $roleid = Database::lastInsertId(); } - foreach ($locations as $locID) { - Database::exec("INSERT INTO role_x_location (roleid, locid) VALUES (:role, :locid)", - array("role" => $role, "locid" => $locID)); + foreach ($locations as $locationid) { + Database::exec("INSERT INTO role_x_location (roleid, locationid) VALUES (:roleid, :locationid)", + array("roleid" => $roleid, "locationid" => $locationid)); } - foreach ($permissions as $permission) { - Database::exec("INSERT INTO role_x_permission (roleid, permissionid) VALUES (:role, :permission)", - array("role" => $role, "permission" => $permission)); + foreach ($permissions as $permissionid) { + Database::exec("INSERT INTO role_x_permission (roleid, permissionid) VALUES (:roleid, :permissionid)", + array("roleid" => $roleid, "permissionid" => $permissionid)); } } diff --git a/modules-available/permissionmanager/inc/permissionutil.inc.php b/modules-available/permissionmanager/inc/permissionutil.inc.php index 5c3eef58..17257eec 100644 --- a/modules-available/permissionmanager/inc/permissionutil.inc.php +++ b/modules-available/permissionmanager/inc/permissionutil.inc.php @@ -11,7 +11,7 @@ class PermissionUtil } $res = Database::simpleQuery("SELECT role_x_permission.permissionid as 'permissionid', - role_x_location.locid as 'locationid' + role_x_location.locationid as '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 @@ -29,11 +29,11 @@ class PermissionUtil public static function getAllowedLocations($userid, $permissionid) { - $res = Database::simpleQuery("SELECT role_x_permission.permissionid as 'permissionid', - role_x_location.locid as 'locationid' + $res = Database::simpleQuery("SELECT role_x_permission.permissionid, rxl.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) rxl + ON role_x_permission.roleid = rxl.roleid WHERE user_x_role.userid = :userid", array("userid" => $userid)); $allowedLocations = array(); @@ -53,7 +53,7 @@ class PermissionUtil return $allowedLocations; } - private static function getSublocations($tree, $locations) { + public static function getSublocations($tree, $locations) { $result = array_flip($locations); foreach ($tree as $location) { if (array_key_exists("children", $location)) { diff --git a/modules-available/permissionmanager/install.inc.php b/modules-available/permissionmanager/install.inc.php index 8c882498..71ee7a1e 100644 --- a/modules-available/permissionmanager/install.inc.php +++ b/modules-available/permissionmanager/install.inc.php @@ -3,25 +3,84 @@ $res = array(); $res[] = tableCreate('role', " - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(200) NOT NULL, - PRIMARY KEY (`id`) + roleid int(10) unsigned NOT NULL AUTO_INCREMENT, + rolename varchar(200) NOT NULL, + PRIMARY KEY (roleid) "); $res[] = tableCreate('user_x_role', " - `userid` int(10) unsigned NOT NULL, - `roleid` int(10) unsigned NOT NULL, - PRIMARY KEY (`userid`, `roleid`) + userid int(10) unsigned NOT NULL, + roleid int(10) unsigned NOT NULL, + PRIMARY KEY (userid, roleid) "); $res[] = tableCreate('role_x_location', " - `roleid` int(10) unsigned NOT NULL, - `locid` int(10) unsigned NOT NULL, - PRIMARY KEY (`roleid`, `locid`) + id int(10) unsigned NOT NULL AUTO_INCREMENT, + roleid int(10) unsigned NOT NULL, + locationid int(11), + PRIMARY KEY (id) "); $res[] = tableCreate('role_x_permission', " - `roleid` int(10) unsigned NOT NULL, - `permissionid` varchar(200) NOT NULL, - PRIMARY KEY (`roleid`, `permissionid`) + roleid int(10) unsigned NOT NULL, + permissionid varchar(200) NOT NULL, + PRIMARY KEY (roleid, permissionid) "); + +if (!tableExists('user') || !tableExists('location')) { + finalResponse(UPDATE_RETRY, 'Cannot add constraint yet. Please retry.'); +} else { + $c = tableGetContraints('user_x_role', 'userid', 'user', 'userid'); + if ($c === false) + finalResponse(UPDATE_FAILED, 'Cannot get constraints of user table: ' . Database::lastError()); + if (empty($c)) { + $alter = Database::exec('ALTER TABLE user_x_role ADD FOREIGN KEY (userid) REFERENCES user (userid) ON DELETE CASCADE ON UPDATE CASCADE'); + if ($alter === false) + finalResponse(UPDATE_FAILED, 'Cannot add userid constraint referencing user table: ' . Database::lastError()); + $res[] = UPDATE_DONE; + } + + $c = tableGetContraints('user_x_role', 'roleid', 'role', 'roleid'); + if ($c === false) + finalResponse(UPDATE_FAILED, 'Cannot get constraints of role table: ' . Database::lastError()); + if (empty($c)) { + $alter = Database::exec('ALTER TABLE user_x_role ADD FOREIGN KEY (roleid) REFERENCES role (roleid) ON DELETE CASCADE ON UPDATE CASCADE'); + if ($alter === false) + finalResponse(UPDATE_FAILED, 'Cannot add roleid constraint referencing role table: ' . Database::lastError()); + $res[] = UPDATE_DONE; + } + + $c = tableGetContraints('role_x_location', 'roleid', 'role', 'roleid'); + if ($c === false) + finalResponse(UPDATE_FAILED, 'Cannot get constraints of role table: ' . Database::lastError()); + if (empty($c)) { + $alter = Database::exec('ALTER TABLE role_x_location ADD FOREIGN KEY (roleid) REFERENCES role (roleid) ON DELETE CASCADE ON UPDATE CASCADE'); + if ($alter === false) + finalResponse(UPDATE_FAILED, 'Cannot add roleid constraint referencing role table: ' . Database::lastError()); + $res[] = UPDATE_DONE; + } + + $c = tableGetContraints('role_x_location', 'locationid', 'location', 'locationid'); + if ($c === false) + finalResponse(UPDATE_FAILED, 'Cannot get constraints of location table: ' . Database::lastError()); + if (empty($c)) { + $alter = Database::exec('ALTER TABLE role_x_location ADD FOREIGN KEY (locationid) REFERENCES location (locationid) ON DELETE CASCADE ON UPDATE CASCADE'); + if ($alter === false) + finalResponse(UPDATE_FAILED, 'Cannot add locationid constraint referencing location table: ' . Database::lastError()); + $res[] = UPDATE_DONE; + } + + $c = tableGetContraints('role_x_permission', 'roleid', 'role', 'roleid'); + if ($c === false) + finalResponse(UPDATE_FAILED, 'Cannot get constraints of role table: ' . Database::lastError()); + if (empty($c)) { + $alter = Database::exec('ALTER TABLE role_x_permission ADD FOREIGN KEY (roleid) REFERENCES role (roleid) ON DELETE CASCADE ON UPDATE CASCADE'); + if ($alter === false) + finalResponse(UPDATE_FAILED, 'Cannot add roleid constraint referencing role table: ' . Database::lastError()); + $res[] = UPDATE_DONE; + } +} +if (in_array(UPDATE_DONE, $res)) { + finalResponse(UPDATE_DONE, 'Tables created successfully'); +} +finalResponse(UPDATE_NOOP, 'Everything already up to date'); diff --git a/modules-available/permissionmanager/page.inc.php b/modules-available/permissionmanager/page.inc.php index 7f288fd9..20e8ad3a 100644 --- a/modules-available/permissionmanager/page.inc.php +++ b/modules-available/permissionmanager/page.inc.php @@ -29,10 +29,10 @@ class Page_PermissionManager extends Page PermissionDbUpdate::deleteRole($id); } elseif ($action === 'saveRole') { $roleID = Request::post("roleid", false); - $roleName = Request::post("roleName"); - $locations = Request::post("allLocations", "off") == "on" ? array(0) : Request::post("locations"); + $rolename = Request::post("rolename"); + $locations = Request::post("allLocations", "off") == "on" ? array(NULL) : Request::post("locations"); $permissions = Request::post("allPermissions", "off") == "on" ? array("*") : Request::post("permissions");; - PermissionDbUpdate::saveRole($roleName, $locations, $permissions, $roleID); + PermissionDbUpdate::saveRole($rolename, $locations, $permissions, $roleID); } } @@ -61,7 +61,7 @@ class Page_PermissionManager extends Page $data = array("user" => GetPermissionData::getUserData(), "roles" => GetPermissionData::getRoles()); Render::addTemplate('userstable', $data); } elseif ($show === "locations") { - $data = array("location" => GetPermissionData::getLocationData(), "roles" => GetPermissionData::getRoles()); + $data = array("location" => GetPermissionData::getLocationData(), "allroles" => GetPermissionData::getRoles()); Render::addTemplate('locationstable', $data); } } elseif ($show === "roleEditor") { @@ -72,7 +72,7 @@ class Page_PermissionManager extends Page if ($roleID) { $roleData = GetPermissionData::getRoleData($roleID); $data["roleid"] = $roleID; - $data["roleName"] = $roleData["name"]; + $data["rolename"] = $roleData["rolename"]; if (count($roleData["locations"]) == 1 && $roleData["locations"][0] == 0) { $data["allLocChecked"] = "checked"; $data["selectizeClass"] = "faded unclickable"; @@ -93,7 +93,7 @@ class Page_PermissionManager extends Page $permissions = PermissionUtil::getPermissions(); - $data["locations"] = GetPermissionData::getLocations($selectedLocations); + $data["locations"] = Location::getLocations($selectedLocations); $data["moduleNames"] = array(); foreach (array_keys($permissions) as $moduleid) { $data["moduleNames"][] = array("id" => $moduleid, "name" => Module::get($moduleid)->getDisplayName()); @@ -107,21 +107,11 @@ class Page_PermissionManager extends Page // Menu: Selected table is shown in blue (btn-primary) private function setButtonColors($show) { if ($show === 'roles') { - $buttonColors['rolesButtonClass'] = 'btn-primary'; - $buttonColors['usersButtonClass'] = 'btn-default'; - $buttonColors['locationsButtonClass'] = 'btn-default'; + $buttonColors['rolesButtonClass'] = 'active'; } elseif ($show === 'users') { - $buttonColors['rolesButtonClass'] = 'btn-default'; - $buttonColors['usersButtonClass'] = 'btn-primary'; - $buttonColors['locationsButtonClass'] = 'btn-default'; + $buttonColors['usersButtonClass'] = 'active'; } elseif ($show === 'locations') { - $buttonColors['rolesButtonClass'] = 'btn-default'; - $buttonColors['usersButtonClass'] = 'btn-default'; - $buttonColors['locationsButtonClass'] = 'btn-primary'; - } else { - $buttonColors['rolesButtonClass'] = 'btn-default'; - $buttonColors['usersButtonClass'] = 'btn-default'; - $buttonColors['locationsButtonClass'] = 'btn-default'; + $buttonColors['locationsButtonClass'] = 'active'; } return $buttonColors; diff --git a/modules-available/permissionmanager/style.css b/modules-available/permissionmanager/style.css index f1d0646f..abc3270a 100644 --- a/modules-available/permissionmanager/style.css +++ b/modules-available/permissionmanager/style.css @@ -7,7 +7,7 @@ margin-left: 10px; } -#roleName { +#rolename { width: 200px; display: inline-block; margin-left: 20px; diff --git a/modules-available/permissionmanager/templates/_page.html b/modules-available/permissionmanager/templates/_page.html index 65a52c52..ff487c8f 100644 --- a/modules-available/permissionmanager/templates/_page.html +++ b/modules-available/permissionmanager/templates/_page.html @@ -5,17 +5,17 @@
- - - diff --git a/modules-available/permissionmanager/templates/locationstable.html b/modules-available/permissionmanager/templates/locationstable.html index 79b0a076..dcfefa94 100644 --- a/modules-available/permissionmanager/templates/locationstable.html +++ b/modules-available/permissionmanager/templates/locationstable.html @@ -3,9 +3,9 @@
@@ -23,10 +23,10 @@ {{#location}} - {{locname}} + {{locationpad}} {{locationname}} {{#roles}} - {{roleName}} + {{rolename}} {{/roles}} diff --git a/modules-available/permissionmanager/templates/roleeditor.html b/modules-available/permissionmanager/templates/roleeditor.html index fd78fc54..359f09a1 100644 --- a/modules-available/permissionmanager/templates/roleeditor.html +++ b/modules-available/permissionmanager/templates/roleeditor.html @@ -6,7 +6,7 @@
{{lang_Name}}: - +
@@ -20,7 +20,7 @@
@@ -121,7 +121,7 @@ }); $('form').submit(function () { - var name = $.trim($('#roleName').val()); + var name = $.trim($('#rolename').val()); if (name === '') { alert('{{lang_emptyNameWarning}}'); return false; diff --git a/modules-available/permissionmanager/templates/rolestable.html b/modules-available/permissionmanager/templates/rolestable.html index dab0faeb..99401624 100644 --- a/modules-available/permissionmanager/templates/rolestable.html +++ b/modules-available/permissionmanager/templates/rolestable.html @@ -24,12 +24,12 @@ {{#roles}} - {{roleName}} + {{rolename}} - + - + {{/roles}} @@ -66,8 +66,8 @@ window.location.href = "?do=permissionmanager&show=roleEditor" } - function deleteRole($roleId) { - $(".modal-footer #deleteId").val($roleId); + function deleteRole($roleid) { + $(".modal-footer #deleteId").val($roleid); } function searchFieldFunction() { diff --git a/modules-available/permissionmanager/templates/userstable.html b/modules-available/permissionmanager/templates/userstable.html index e794608c..bd48d16d 100644 --- a/modules-available/permissionmanager/templates/userstable.html +++ b/modules-available/permissionmanager/templates/userstable.html @@ -10,7 +10,7 @@ @@ -33,7 +33,7 @@ {{username}} {{#roles}} - {{roleName}} + {{rolename}} {{/roles}} @@ -71,11 +71,11 @@ {{#roles}} - {{roleName}} + {{rolename}}
- - + +
@@ -114,11 +114,11 @@ {{#roles}} - {{roleName}} + {{rolename}}
- - + +
-- cgit v1.2.3-55-g7522