Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Conf.sql : deleting a group was deleting all groups with the same pre…
Browse files Browse the repository at this point in the history
…fix!
  • Loading branch information
cdujeu committed Mar 18, 2014
1 parent a8a434c commit fd408bb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/src/plugins/conf.sql/class.sqlConfDriver.php
Expand Up @@ -555,15 +555,14 @@ public function relabelGroup($groupPath, $groupLabel)
public function deleteGroup($groupPath)
{
// Delete users of this group, as well as subgroups
$ids = array();
$res = dibi::query("SELECT * FROM [ajxp_users] WHERE [groupPath] LIKE %like~ ORDER BY [login] ASC", $groupPath);
$res = dibi::query("SELECT * FROM [ajxp_users] WHERE [groupPath] LIKE %like~ OR [groupPath] = %s ORDER BY [login] ASC", $groupPath."/", $groupPath);
$rows = $res->fetchAll();
$subUsers = array();
foreach ($rows as $row) {
$this->deleteUser($row["login"], $subUsers);
dibi::query("DELETE FROM [ajxp_users] WHERE [login] = %s", $row["login"]);
}
dibi::query("DELETE FROM [ajxp_groups] WHERE [groupPath] LIKE %like~", $groupPath);
dibi::query("DELETE FROM [ajxp_groups] WHERE [groupPath] LIKE %like~ OR [groupPath] = %s", $groupPath."/", $groupPath);
dibi::query('DELETE FROM [ajxp_roles] WHERE [role_id] = %s', 'AJXP_GRP_'.$groupPath);
}

Expand Down

0 comments on commit fd408bb

Please sign in to comment.