Ejemplo n.º 1
0
 public function getMemberOfGroups()
 {
     $cacheKey = 'getMemberOf' . $this->getUsername();
     $memberOfGroups = $this->connection->getFromCache($cacheKey);
     if (!is_null($memberOfGroups)) {
         return $memberOfGroups;
     }
     $groupDNs = $this->access->readAttribute($this->getDN(), 'memberOf');
     $this->connection->writeToCache($cacheKey, $groupDNs);
     return $groupDNs;
 }
Ejemplo n.º 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;
     $sid = $this->connection->getFromCache($cacheKey);
     if (!is_null($sid)) {
         return $sid;
     }
     $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;
 }