Example #1
0
 /**
  * Converts the inserted string boolean to a PHP boolean.
  *
  * @param string $bool
  *
  * @return null|bool
  */
 protected function convertStringToBool($bool)
 {
     $bool = strtoupper($bool);
     if ($bool === strtoupper($this->schema->false())) {
         return false;
     } elseif ($bool === strtoupper($this->schema->true())) {
         return true;
     } else {
         return;
     }
 }
Example #2
0
 /**
  * Finds a record by its Object SID.
  *
  * @param string       $sid
  * @param array|string $columns
  *
  * @return bool|Entry
  */
 public function findBySid($sid, $columns = [])
 {
     return $this->findBy($this->schema->objectSid(), $sid, $columns);
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function getRootDse()
 {
     return $this->search()->setDn(null)->read(true)->whereHas($this->schema->objectClass())->first();
 }
Example #4
0
 /**
  * Get the RootDSE properties from a domain controller.
  *
  * @return AbstractModel|bool
  */
 protected function getRootDse()
 {
     return $this->query->setDn(null)->read(true)->whereHas($this->schema->objectClass())->first();
 }
Example #5
0
 /**
  * Returns the object category model class mapping.
  *
  * @return array
  */
 protected function map()
 {
     return [$this->schema->objectCategoryComputer() => 'Adldap\\Models\\Computer', $this->schema->objectCategoryPerson() => 'Adldap\\Models\\User', $this->schema->objectCategoryGroup() => 'Adldap\\Models\\Group', $this->schema->objectCategoryExchangeServer() => 'Adldap\\Models\\ExchangeServer', $this->schema->objectCategoryContainer() => 'Adldap\\Models\\Container', $this->schema->objectCategoryPrinter() => 'Adldap\\Models\\Printer', $this->schema->objectCategoryOrganizationalUnit() => 'Adldap\\Models\\OrganizationalUnit'];
 }
Example #6
0
 /**
  * Creates a new computer instance.
  *
  * @param array $attributes
  *
  * @return Computer
  */
 public function computer(array $attributes = [])
 {
     return (new Computer($attributes, $this->query))->setAttribute($this->schema->objectClass(), [$this->schema->top(), $this->schema->person(), $this->schema->organizationalPerson(), $this->schema->user(), $this->schema->computer()]);
 }
Example #7
0
 /**
  * Returns the object category model class mapping.
  *
  * @return array
  */
 public function map()
 {
     return [$this->schema->objectClassComputer() => \Adldap\Models\Computer::class, $this->schema->objectClassContact() => \Adldap\Models\Contact::class, $this->schema->objectClassPerson() => \Adldap\Models\User::class, $this->schema->objectClassGroup() => \Adldap\Models\Group::class, $this->schema->objectClassContainer() => \Adldap\Models\Container::class, $this->schema->objectClassPrinter() => \Adldap\Models\Printer::class, $this->schema->objectClassOu() => \Adldap\Models\OrganizationalUnit::class];
 }