Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion resources/lib/UnityGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,14 @@ public function getPIUID()
*
* @return bool true if yes, false if no
*/
public function exists()
public function exists(bool $ignorecache = false): bool
{
if (!$ignorecache) {
$cached_pi_groups = $this->REDIS->getCache("sorted_pi_groups", "");
if (!is_null($cached_pi_groups)) {
return in_array($this->getPIUID(), $cached_pi_groups);
}
}
return $this->getLDAPPiGroup()->exists();
}

Expand Down
8 changes: 7 additions & 1 deletion resources/lib/UnityUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,14 @@ public function getLDAPGroup()
return $this->LDAP->getGroupEntry($this->uid);
}

public function exists()
public function exists(bool $ignorecache = false): bool
{
if (!$ignorecache) {
$cached_users = $this->REDIS->getCache("sorted_users", "");
if (!is_null($cached_users)) {
return in_array($this->uid, $cached_users);
}
}
return $this->getLDAPUser()->exists() && $this->getLDAPGroup()->exists();
}

Expand Down
Loading