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

Commit

Permalink
Add method groupExists() implement in serial and sql confdriver
Browse files Browse the repository at this point in the history
  • Loading branch information
c12simple committed Dec 2, 2015
1 parent 1ae2198 commit b571eb2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/src/plugins/conf.serial/class.serialConfDriver.php
Expand Up @@ -705,6 +705,12 @@ public function pruneTemporaryKeys($keyType, $expiration)
*/
public function groupExists($groupPath)
{
$groups = AJXP_Utils::loadSerialFile(AJXP_VarsFilter::filter($this->getOption("USERS_DIRPATH"))."/groups.ser");
$reverse = array_flip($groups);
if (isSet($reverse[$groupPath])) {
return true;
}

return false;
}

Expand Down
4 changes: 4 additions & 0 deletions core/src/plugins/conf.sql/class.sqlConfDriver.php
Expand Up @@ -811,6 +811,10 @@ public function filterUsersByGroup(&$flatUsersList, $baseGroup = "/", $fullTree
*/
public function groupExists($groupPath)
{
$ret = dibi::query("SELECT [groupPath] FROM [ajxp_groups] WHERE [groupPath] = %s", $groupPath);
$groups = $ret->fetchSingle();
if(!empty($groups)) return true;

return false;
}

Expand Down

0 comments on commit b571eb2

Please sign in to comment.