Beispiel #1
0
 public function getMemberOfGroups()
 {
     $cacheKey = 'getMemberOf' . $this->getUsername();
     if ($this->connection->isCached($cacheKey)) {
         return $this->connection->getFromCache($cacheKey);
     }
     $groupDNs = $this->access->readAttribute($this->getDN(), 'memberOf');
     $this->connection->writeToCache($cacheKey, $groupDNs);
     return $groupDNs;
 }
Beispiel #2
0
 /**
  * gets a SID of the domain of the given dn
  * @param string $dn
  * @return string|bool
  */
 public function getSID($dn)
 {
     $domainDN = $this->getDomainDNFromDN($dn);
     $cacheKey = 'getSID-' . $domainDN;
     if ($this->connection->isCached($cacheKey)) {
         return $this->connection->getFromCache($cacheKey);
     }
     $objectSid = $this->readAttribute($domainDN, 'objectsid');
     if (!is_array($objectSid) || empty($objectSid)) {
         $this->connection->writeToCache($cacheKey, false);
         return false;
     }
     $domainObjectSid = $this->convertSID2Str($objectSid[0]);
     $this->connection->writeToCache($cacheKey, $domainObjectSid);
     return $domainObjectSid;
 }