Skip to content
Snippets Groups Projects
Commit 9727b3bd authored by Robert Anderson's avatar Robert Anderson
Browse files

Fixed SQL, some tables had been renamed

parent 74484b71
No related branches found
No related tags found
No related merge requests found
...@@ -21,17 +21,19 @@ function getAdminGroupMembers($params) { ...@@ -21,17 +21,19 @@ function getAdminGroupMembers($params) {
# Filters and sorts are the same here # Filters and sorts are the same here
$filtersorts = array( $filtersorts = array(
'ID' => 'users_to_groups.ID', 'ID' => 'users_to_groups.ID',
'Name' => 'group_attributes.Name', 'Username' => 'group_attributes.Username',
'Disabled' => 'group_attributes.Disabled' 'Disabled' => 'group_attributes.Disabled'
); );
$res = DBSelectSearch(" $res = DBSelectSearch("
SELECT SELECT
ID, Name, Operator, Value, Disabled users_to_groups.ID, users.Username, users.Disabled
FROM FROM
group_attributes users_to_groups, users
WHERE WHERE
GroupID = ".DBQuote($params[0])." users.ID = users_to_groups.UserID
AND
users_to_groups.GroupID = ".DBQuote($params[0])."
",$params[1],$filtersorts,$filtersorts); ",$params[1],$filtersorts,$filtersorts);
$sth = $res[0]; $numResults = $res[1]; $sth = $res[0]; $numResults = $res[1];
...@@ -47,7 +49,7 @@ function getAdminGroupMembers($params) { ...@@ -47,7 +49,7 @@ function getAdminGroupMembers($params) {
$item = array(); $item = array();
$item['ID'] = $row->id; $item['ID'] = $row->id;
$item['Name'] = $row->name; $item['Username'] = $row->username;
$item['Disabled'] = $row->disabled; $item['Disabled'] = $row->disabled;
# push this row onto array # push this row onto array
......
...@@ -43,7 +43,7 @@ function getAdminUserGroups($params) { ...@@ -43,7 +43,7 @@ function getAdminUserGroups($params) {
FROM FROM
users_to_groups, groups users_to_groups, groups
WHERE WHERE
groups.ID = users_to_groups.GroupID users_to_groups.GroupID = groups.ID
AND users_to_groups.UserID = ".DBQuote($params[0])." AND users_to_groups.UserID = ".DBQuote($params[0])."
",$params[1],$filtersorts,$filtersorts); ",$params[1],$filtersorts,$filtersorts);
......
...@@ -9,8 +9,8 @@ function getWiSPLocations($params) { ...@@ -9,8 +9,8 @@ function getWiSPLocations($params) {
# Filters and sorts are the same here # Filters and sorts are the same here
$filtersorts = array( $filtersorts = array(
'ID' => 'groups.ID', 'ID' => 'wisp_locations.ID',
'Name' => 'groups.Name' 'Name' => 'wisp_locations.Name'
); );
$res = DBSelectSearch("SELECT ID, Name FROM wisp_locations",$params[1],$filtersorts,$filtersorts); $res = DBSelectSearch("SELECT ID, Name FROM wisp_locations",$params[1],$filtersorts,$filtersorts);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment