Administrators now see all password groups

Administrators now see all password groups after login.
This commit is contained in:
Gergely Polonkai (W00d5t0ck) 2010-12-17 17:47:13 +01:00
parent 3bd1f3b4c2
commit f527d8657d

View File

@ -120,7 +120,15 @@ if (!class_exists('PWSdb'))
{ {
$this->userPasswordGroups[$username] = array(); $this->userPasswordGroups[$username] = array();
$sth = $this->prepare('SELECT permissions FROM usergroups WHERE groupname IN (\'' . join("', '", $this->userUsergroups($username)) . '\')'); if ($this->isAdmin($username))
{
$query = 'SELECT groupname || \'+\' AS permissions FROM passwordgroups';
}
else
{
$query = 'SELECT permissions FROM usergroups WHERE groupname IN (\'' . join("', '", $this->userUsergroups($username)) . '\')';
}
$sth = $this->prepare($query);
$sth->execute(); $sth->execute();
while ($row = $sth->fetch()) while ($row = $sth->fetch())
{ {