diff --git a/app/Classes/LDAP/Attribute.php b/app/Classes/LDAP/Attribute.php index 59d93c8f..3f502e40 100644 --- a/app/Classes/LDAP/Attribute.php +++ b/app/Classes/LDAP/Attribute.php @@ -106,11 +106,17 @@ class Attribute implements \Countable, \ArrayAccess $this->_values = collect($values); $this->_values_old = collect($values); - $this->oc = collect($oc); - - $this->schema = (new Server) + $this->schema = config('server') ->schema('attributetypes',$name); + $this->oc = collect(); + + // Get the objectclass heirarchy for required attribute determination + foreach ($oc as $objectclass) { + $this->oc->push($objectclass); + $this->oc = $this->oc->merge(config('server')->schema('objectclasses',$objectclass)->getParents()->pluck('name')); + } + /* # Should this attribute be hidden if ($server->isAttrHidden($this->name))