_base = $base; } $options = PEAR::getStaticProperty('LDAP_DataObject','options'); if (isset($options['base'])) { $this->_base = 'ou=Objectclasses,ou=Schema,'.$options['base']; } return $this->_base; } function fetch() { $ret = parent::fetch(); $this->mayList = @implode("\n",$this->may); $this->mustList = @implode("\n",$this->must); //print_r($this); return $ret; } var $supObject= false; function getSup() { if (empty($this->sup[0])) { return; } $this->supObject = new DataObjects_LDAPObjectClass; $this->supObject->get($this->sup[0]); $this->supObject->getSup(); } var $mustObjects = array(); var $mayObjects = array(); function getAttributes() { require_once 'DataObjects/LDAPattribute.php'; if (!empty($this->must)) { asort($this->must); foreach($this->must as $m) { $this->mustObjects[$m] = new DataObjects_LDAPattribute; $this->mustObjects[$m]->get($m); $this->mustObjects[$m]->getSup(); $this->mustObjects[$m]->getSyntax(); $this->mustObjects[$m]->getMatching(); $this->mustObjects[$m]->inheritedFrom = $this->cn[0]; } } if (!empty($this->may)) { asort($this->may); foreach($this->may as $m) { $this->mayObjects[$m] =new DataObjects_LDAPattribute; $this->mayObjects[$m]->get($m); $this->mayObjects[$m]->getSup(); $this->mayObjects[$m]->getSyntax(); $this->mayObjects[$m]->getMatching(); $this->mayObjects[$m]->inheritedFrom = $this->cn[0]; } } if ($this->supObject) { $this->supObject->getAttributes(); } } var $mustInherited = array(); var $mayInherited = array(); var $allAttributes = array(); function flattenAttributes() { $this->allAttributes = array_merge($this->mustObjects,$this->mayObjects); if (empty($this->sup)) { return; } $sup = $this->supObject; while (1) { $this->mustInherited = array_merge($sup->mustObjects,$this->mustInherited); $this->mayInherited = array_merge($sup->mayObjects,$this->mayInherited); $this->allAttributes = array_merge($this->allAttributes ,$sup->mustObjects); $this->allAttributes = array_merge($this->allAttributes ,$sup->mayObjects); if (empty($sup->sup)) { ksort($this->allAttributes ); return; } $sup = $sup->supObject; } } function toBNC() { $sup = $this->sup[0] ? "\nSUP {$this->sup[0]}" : ''; $st = $this->structural[0] ? "\nSTRUCTURAL" : ''; $ax = $this->auxiliary[0] ? "\nAUXILARY" : ''; $may = $this->may[0] ? ("\nMAY ( ". implode(' $ ',$this->may) . ' )') : ''; $must = $this->must[0] ? ("\nMUST ( ". implode(' $ ',$this->must) . ' )') : ''; return "{$this->uid[0]} NAME '{$this->cn[0]}' {$sup} {$st} {$ax} {$may} {$must}"; } } ?>