Programmer's Reference Guide
| Einführung |
API Übersicht
Konfiguration und Optionen
Die Zend_Ldap Komponente akzeptiert ein Array von Optionen die entweder im Constructor übergeben werden oder durch die setOptions() Methode. Die erlaubten Optionen sind folgende:
| Name | Beschreibung |
|---|---|
| host | Der Standard Hostname des LDAP Servers wenn bei connect() keiner angegeben wurde (kann auch verwendet werden wenn versucht wird Benutzernamen in bind() zu kanonisieren). |
| port | Standard Port des LDAP Servers wenn bei connect() keiner angegeben wurde. |
| useStartTls | Ob der LDAP Client TLS (auch als SSLv2 bekannt) verschlüsselten Transport verwenden soll oder nicht. Der Wert TRUE wird in Produktionsumgebungen stärkstens empfohlen um zu verhindern das Passwörter im Klartext übermittelt werden. Der Standardwert ist FALSE, da Server oft ein separat installiertes Zertifikat nach der Installation benötigen. Die Optionen useSsl und useStartTls sind gegenseitig exklusiv. Die Option useStartTls sollte gegenüber useSsl bevorzugt verwendet werden aber nicht alle Server unterstützen diesen neueren Mechanismus. |
| useSsl | Ob der LDAP Client einen SSL verschlüsselten Transport verwenden soll. Die Optionen useSsl und useStartTls sind gegenseitig exklusiv. |
| username | Der Standard Benutzername des Accounts. Einige Server erwarten Ihn in DN Form. Er muß in DN Form angegeben werden wenn der LDAP Server einen DN für das Binden benötigt und das Binden mit einem einfachen Benutzernamen möglich sein soll. |
| password | Das Standard Passwort des Accounts (nur mit dem obigen Benutzernamen verwendet). |
| bindRequiresDn | Ist er TRUE, dann instruiert er Zend_Ldap den DN für den Account zu empfangen der für das Binden des Benutzernamens verwendet wird wenn dieser nicht bereits in DN Form ist. Der Standardwert ist FALSE. |
| baseDn | Der Standard Basis DN der für das Suchen (z.B. nach Accounts) verwendet wird. Diese Option wird fr die meisten Account bezogenen Operationen verwendet und sollte den DN anzeigen unter dem Accounts zu finden sind. |
| accountCanonicalForm | Ein kleiner Integerwert der die Form anzeigt zu der Accountnamen kanonisiert werden sollen. Siehe auch das Kapitel Kanonisierung von Account Namen weiter unten. |
| accountDomainName | Die FQDN Domain für die der LDAP Zielserver die Authorität ist (z.B., example.com). |
| accountDomainNameShort | Die 'short' Domain für die der LDAP Zielserver die Authorität ist. Das wird normalerweise verwendet um den NetBIOS Domainnamen für Windows Netzwerke zu spezifizieren, kann aber auch von nicht-AD Servern verwendet werden. |
| accountFilterFormat | Der Suchfilter für LDAP der für das Suchen von Accounts verwendet wird. Der String ist ein Ausdruck im Stil von » sprintf() der ein '%s' enthalten muss um den Benutzernamen zu notieren. Der Standardwert ist '(&(objectClass=user)(sAMAccountName=%s))' solange bindRequiresDn nicht auf TRUE gesetzt ist. In dem Fall ist der Standardwert '(&(objectClass=posixAccount)(uid=%s))'. Benutzer eines eigenen Schemas können die Notwendigkeit haben diese Option zu ändern. |
| allowEmptyPassword | Einige LDAP Server können konfiguriert werden um ein leeres Passwort als anonymen Bind zu akzeptieren. Dieses Verhalten ist meistens immer unerwünscht. Aus diesem Grund sind leere Passwörter explizit unerwünscht. Dieser Wert muß auf TRUE gesetzt werden um zu akzeptieren das ein leeres Passwort wärend des Bindens übergeben werden kann. |
| optReferrals | Wenn Sie auf TRUE gesetzt wird zeigt diese Option an das dem LDAP Client der referiert, gefolgt werden soll. Der Standardwert ist FALSE. |
| tryUsernameSplit | Wenn Sie auf FALSE gesetzt wird zeigt diese Option an das der angegebene Benutzername nicht mit dem ersten @ oder \ Zeichen geteilt werden soll um den Benutzernamen wärend der Bindungs-Prozedur von der Domain zu trennen. Das erlaubt es dem Benutzer, Benutzernamen zu verwenden die ein @ oder \ Zeichen enthalten, welche keine Domain-Information enthalten, z.B. die Verwendung von Email Adressen für das Binden. Der Standardwert ist TRUE. |
API Referenz
Hinweis: Methodennamen in italic sind statische Methoden.
Zend_Ldap
Zend_Ldap is the base interface into a LDAP server. It provides connection and binding methods as well as methods to operate on the LDAP tree.
| Method | Description |
|---|---|
string filterEscape(string $str)
|
Escapes a value to be used in a LDAP filter according to RFC 2254. This method is deprecated, please use Zend_Ldap_Filter_Abstract::escapeValue() instead. |
boolean explodeDn($dn, array &$keys = null, array &$vals = null)
|
Checks if a given DN $dn is malformed. If
$keys or $keys and $vals are
given, these arrays will be filled with the appropriate DN keys and
values. This method is deprecated, please use
Zend_Ldap_Dn::checkDn() instead.
|
__construct($options) |
Constructor. The $options parameter is optional
and can be set to an array or a Zend_Config instance.
If no options are provided at instantiation, the connection
parameters must be passed to the instance using
Zend_Ldap::setOptions(). The allowed options are
specified in Zend_Ldap
Options
|
resource getResource() |
Returns the raw LDAP extension (ext/ldap) resource. |
integer getLastErrorCode() |
Returns the LDAP error number of the last LDAP command. |
string getLastError(integer &$errorCode, array &$errorMessages)
|
Returns the LDAP error message of the last LDAP command. The
optional $errorCode parameter is set to the LDAP error
number when given. The optional $errorMessages array
will be filled with the raw error messages when given. The various
LDAP error retrieval functions can return different things, so they
are all collected if $errorMessages is given.
|
Zend_Ldap setOptions($options) |
Sets the LDAP connection and binding parameters.
$options can be an array or an instance of
Zend_Config. The allowed options are specified in
Zend_Ldap Options
|
array getOptions() |
Returns the current connection and binding parameters. |
string getBaseDn() |
Returns the base DN this LDAP connection is bound to. |
string getCanonicalAccountName(string $acctname, integer $form)
|
Returns the canonical account name of the given account name
$acctname. $form specifies the format
into which the account name is canonicalized. See Account Name Canonicalization
for more details.
|
Zend_Ldap disconnect() |
Disconnects the Zend_Ldap instance from the LDAP server. |
Zend_Ldap connect(string $host, integer $port, boolean $useSsl, boolean $useStartTls)
|
Connects the Zend_Ldap instance to the given LDAP server.
All parameters are optional and will be taken from the LDAP
connection and binding parameters passed to the instance via the
construtor or via Zend_Ldap::setOptions() when set to
null.
|
Zend_Ldap bind(string $username, string $password)
|
Authenticates $username with
$password at the LDAP server. If both paramaters are
omitted the binding will be carried out with the credentials given
in the connection and binding parameters. If no credentials are
given in the connection and binding parameters an anonymous bind
will be performed. Note that this requires anonymous binds to be
allowed on the LDAP server. An empty string '' can be
passed as $password together with a username if, and
only if, allowEmptyPassword is set to
true in the connection and binding parameters.
|
Zend_Ldap_Collection search(string|Zend_Ldap_Filter_Abstract $filter, string|Zend_Ldap_Dn $basedn, integer $scope, array $attributes, string $sort, string $collectionClass)
|
Searches the LDAP tree with the given $filter
and the given search parameters.
|
integer count(string|Zend_Ldap_Filter_Abstract
$filter, string|Zend_Ldap_Dn $basedn, integer
$scope)
|
Counts the elements returned by the given search parameters. See Zend_Ldap::search() for a detailed description of the method parameters. |
integer countChildren(string|Zend_Ldap_Dn
$dn)
|
Counts the direct descendants (children) of the entry
identified by the given $dn.
|
boolean exists(string|Zend_Ldap_Dn $dn) |
Checks whether the entry identified by the given
$dn exists.
|
array searchEntries(string|Zend_Ldap_Filter_Abstract
$filter, string|Zend_Ldap_Dn $basedn, integer $scope, array
$attributes, string $sort)
|
Performs a search operation and returns the result as an PHP array. This is essentially the same method as Zend_Ldap::search() except for the return type. See Zend_Ldap::search() for a detailed description of the method parameters. |
array getEntry(string|Zend_Ldap_Dn $dn, array
$attributes, boolean $throwOnNotFound)
|
Retrieves the LDAP entry identified by $dn with
the attributes specified in $attributes. If
$attributes is ommitted, all attributes
( array()) are included in the result.
$throwOnNotFound is false by default, so
the method will return null if the specified entry
cannot be found. If set to true, a
Zend_Ldap_Exception will be thrown instead.
|
void prepareLdapEntryArray(array
&$entry)
|
Prepare an array for the use in LDAP modification operations. This method does not need to be called by the end-user as it's implicitly called on every data modification method. |
Zend_Ldap add(string|Zend_Ldap_Dn $dn, array
$entry)
|
Adds the entry identified by $dn with its
attributes $entry to the LDAP tree. Throws a
Zend_Ldap_Exception if the entry could not be
added.
|
Zend_Ldap update(string|Zend_Ldap_Dn $dn, array
$entry)
|
Updates the entry identified by $dn with its
attributes $entry to the LDAP tree. Throws a
Zend_Ldap_Exception if the entry could not be
modified.
|
Zend_Ldap save(string|Zend_Ldap_Dn $dn, array
$entry)
|
Saves the entry identified by $dn with its
attributes $entry to the LDAP tree. Throws a
Zend_Ldap_Exception if the entry could not be saved.
This method decides by querying the LDAP tree if the entry will be
added or updated.
|
Zend_Ldap delete(string|Zend_Ldap_Dn $dn, boolean
$recursively)
|
Deletes the entry identified by $dn from the
LDAP tree. Throws a Zend_Ldap_Exception if the entry
could not be deleted. $recursively is
false by default. If set to true the
deletion will be carried out recursively and will effectively
delete a complete subtree. Deletion will fail if
$recursively is false and the entry
$dn is not a leaf entry.
|
Zend_Ldap moveToSubtree(string|Zend_Ldap_Dn $from,
string|Zend_Ldap_Dn $to, boolean $recursively, boolean
$alwaysEmulate)
|
Moves the entry identified by $from to a
location below $to keeping its RDN unchanged.
$recursively specifies if the operation will be
carried out recursively (false by default) so that the
entry $from and all its descendants will be moved.
Moving will fail if $recursively is false
and the entry $from is not a leaf entry.
$alwaysEmulate controls whether the ext/ldap function
ldap_rename() should be used if available. This can
only work for leaf entries and for servers and for ext/ldap
supporting this function. Set to true to always use an
emulated rename operation.
|
Zend_Ldap move(string|Zend_Ldap_Dn $from,
string|Zend_Ldap_Dn $to, boolean $recursively, boolean
$alwaysEmulate)
|
This is an alias for Zend_Ldap::rename(). |
Zend_Ldap rename(string|Zend_Ldap_Dn $from,
string|Zend_Ldap_Dn $to, boolean $recursively, boolean
$alwaysEmulate)
|
Renames the entry identified by $from to
$to. $recursively specifies if the
operation will be carried out recursively (false by
default) so that the entry $from and all its
descendants will be moved. Moving will fail if
$recursively is false and the entry
$from is not a leaf entry. $alwaysEmulate
controls whether the ext/ldap function ldap_rename()
should be used if available. This can only work for leaf entries
and for servers and for ext/ldap supporting this function. Set to
true to always use an emulated rename
operation.
|
Zend_Ldap copyToSubtree(string|Zend_Ldap_Dn $from,
string|Zend_Ldap_Dn $to, boolean $recursively)
|
Copies the entry identified by $from to a
location below $to keeping its RDN unchanged.
$recursively specifies if the operation will be
carried out recursively (false by default) so that the
entry $from and all its descendants will be copied.
Copying will fail if $recursively is
false and the entry $from is not a leaf
entry.
|
Zend_Ldap copy(string|Zend_Ldap_Dn $from,
string|Zend_Ldap_Dn $to, boolean $recursively)
|
Copies the entry identified by $from to
$to. $recursively specifies if the
operation will be carried out recursively (false by
default) so that the entry $from and all its
descendants will be copied. Copying will fail if
$recursively is false and the entry
$from is not a leaf entry.
|
Zend_Ldap_Node getNode(string|Zend_Ldap_Dn
$dn)
|
Gibt den $dn Eintrag zurück der in einem
Zend_Ldap_Node gewrappt ist.
|
Zend_Ldap_Node getBaseNode() |
Gibt den Eintrag für den Basis DN $baseDn zurück
der in einer Zend_Ldap_Node gewrappt ist.
|
Zend_Ldap_Node_RootDse getRootDse() |
Gibt den RootDSE für den aktuellen Server zurück. |
Zend_Ldap_Node_Schema getSchema() |
Gibt das LDAP Schema für den aktuellen Server zurück. |
Zend_Ldap_Collection
Zend_Ldap_Collection implementiert Iterator um
das Durchlaufen von Einträgen zu erlauben indem foreach() und
Countable verwendet werden welche in der Lage sind auf
count() zu Antworten. Mit seiner geschützten _createEntry()
Methode bietet es einen einfachen Punkt der Erweiterung für Entwickler welche die
Notwendigkeit für eigene Ergebnisobjekte haben.
| Methode | Beschreibung |
|---|---|
__construct(Zend_Ldap_Collection_Iterator_Interface
$iterator)
|
Constructor. Der Constructor muß von einem Zend_Ldap_Collection_Iterator_Interface angeboten werden welches die echte Iteration der Resultate durchführt. Zend_Ldap_Collection_Iterator_Default ist die standardmäßige Implementation für die Interation durch ext/ldap Ergebnisse. |
boolean close() |
Schließt den internen Iterator. Wird auch im Destructor aufgerufen. |
array toArray() |
Gibt alle Einträge als Array zurück. |
array getFirst() |
Gibt den ersten Eintrag der Collection zurück, oder null wenn
die Collection leer ist.
|
Zend_Ldap_Attribute
Zend_Ldap_Attribute ist eine Helfer Klasse die nur Statische Methoden anbietet für die Manipulation von Arrays die zur Struktur passen welche in den Zend_Ldap Data Änderungs Methoden verwendet werden und zum Datenformat das vom Zend_Ldap Server benötigt wird. PHP Datentypen werden wie folgt konvertiert:
-
string -
Es wird keine Konvertierung durchgeführt.
-
integerundfloat -
Der Wert wird zu einem String konvertiert.
-
boolean -
truewird zu'TRUE'konvertiert undfalsezu'FALSE' -
objectundarray -
Diese Werte werden zu einem String konvertiert indem serialize() verwendet wird.
-
resource -
Wenn eine
streamRessource angegeben wurde, werden die Daten durch den Aufruf von stream_get_contents() geholt. - others
-
Alle anderen Datentypen (speziell nicht-Stream Ressourcen) werden verweigert.
Beim Lesen von Attributwerten werden die folgenden Konvertierungen durchgeführt:
-
'TRUE' -
Wird zu
truekonvertiert. -
'FALSE' -
Wird zu
falsekonvertiert. - others
-
Alle anderen Strings werden nicht automatisch konvertiert und so wie Sie sind übergeben.
| Methode | Beschreibung |
|---|---|
void setAttribute(array &$data, string
$attribName, mixed $value, boolean $append)
|
Setzt die Attribute $attribName in
$data auf den Wert $value. Wenn
$append true ist (standardmäßig
false) wird $value an das Attribut angehängt.
$value kann ein skalarer Wert oder ein Array von skalaren
Werten sein. Eine Konvertierung wird durchgeführt.
|
array|mixed getAttribute(array $data,
string $attribName, integer|null $index)
|
Gibt das Attribut $attribName von $data zurück.
Wenn $index null ist (Standardwert) wird ein
Array zurückgegeben welches alle Werte für das angegebene Attribut
enthält. Ein leeres Array wird zurückgegeben wenn das Attribut im
angegebenen Array nicht existiert. Wenn ein Integer für den Index
spezifiziert wird, dann wird der korrespondierende Wert mit dem gegebenen
Index zurückgegeben. Wenn der Index ausserhalb der Grenzen ist wird
null zurückgegeben. Eine Konvertierung wird durchgeführt.
|
boolean attributeHasValue(array &$data,
string $attribName, mixed|array $value)
|
Prüft ob das Attribut $attribName in $data den
Wert oder die Werte welche in $value angegeben wurden hat.
Die Methode gibt nur dann true zurück wenn alle Werte von
$value im Attribut enthalten sind. Der Vergleich wird
strikt durchgeführt (der Datentyp wird respektiert).
|
void removeDuplicatesFromAttribute(array
&$data, string $attribName)
|
Entfernt alle Duplikate vom Attribut $attribName in
$data.
|
void removeFromAttribute(array &$data,
string $attribName, mixed|array $value)
|
Entfernt den Wert oder die Werte vom Attribut $attribName die
in $value angegeben werden von $data.
|
string|null convertToLdapValue(mixed
$value)
|
Konvertiert einen PHP Datentyp in seine LDAP Repräsentation. Siehe die Einleitung für Details. |
mixed convertFromLdapValue(string
$value)
|
Konvertiert einen LDAP Wert in seinen PHP Datentyp. Siehe die Einleitung für Details. |
string|null
convertToLdapDateTimeValue(integer $value, boolean $utc)
|
Konvertiert einen Zeitpunkt in seine LDAP Datum und Zeit
Repräsentation. Wenn $utc true ist (standardmäßig
ist es false) dann wird der resultierende
LDAP Datum und Zeit String in UTC sein, andernfalls wird
ein lokaler Datum und Zeit String zurückgegeben.
|
integer|null
convertFromLdapDateTimeValue(string $value)
|
Konvertiert eine Datum und Zeit Repräsentation für LDAP
in einen Zeitpunkt. Die Methode gibt null zurück wenn
$value nicht in einen PHP Zeitpunkt zurückkonvertiert werden
kann.
|
void setPassword(array &$data, string
$password, string $hashType, string $attribName)
|
Setzt ein LDAP Passwort für das Attribut
$attribName in $data zurück.
$attribName ist standardmäßig 'userPassword'
welches das standardmäßige Attribut für Passwörter ist. Der Hash für das
Passwort kann mit $hashType spezifiziert werden. Der
Standardwert ist Zend_Ldap_Attribute::PASSWORD_HASH_MD5 wobei
Zend_Ldap_Attribute::PASSWORD_HASH_SHA die andere Möglichkeit
ist.
|
string createPassword(string $password,
string $hashType)
|
Erstellt ein LDAP Passwort. Der Hash für das Passwort
kann mit $hashType spezifiziert werden. Der Standardwert
ist Zend_Ldap_Attribute::PASSWORD_HASH_MD5 wobei
Zend_Ldap_Attribute::PASSWORD_HASH_SHA die andere Möglichkeit
ist.
|
void setDateTimeAttribute(array &$data,
string $attribName, integer|array $value, boolean $utc, boolean
$append)
|
Setzt das Attribut $attribName in $data auf den
Datum und Zeitwert $value. Wenn $append
true ist (standardmäßig ist er false) dann wird
$value an das Attribut angehängt. $value kann ein
Integerwert oder ein Array von Integerwerten sein. Die Konvertierung von
Datum und Zeit wird entsprechend zu
Zend_Ldap_Attribute::convertToLdapDateTimeValue()
durchgeführt.
|
array|integer getDateTimeAttribute(array
$data, string $attribName, integer|null $index)
|
Gibt das Datum und Zeit Attribut $attribName von
$data zurück. Wenn $index null ist
(das ist der Standardwert) dann wird ein Array zurückgegeben welches alle
Datum und Zeitwerte für das angegebene Attribut enthält. Ein leeres Array
wird zurückgegeben wenn das Attribut im angegebenen Array nicht existiert.
Wenn ein Integer Index spezifiziert wird, dann wird der korrespondierende
Datum und Zeitwert vom angegebenen Index zurückgegeben. Wenn der Index
ausserhalb der Grenzen ist dann wird null zurückgegeben. Die
Konvertierung von Datum und Zeit wird entsprechend zu
Zend_Ldap_Attribute::convertFromLdapDateTimeValue()
durchgeführt.
|
Zend_Ldap_Dn
Zend_Ldap_Dn bietet ein objektorientiertes Interface für die
Manipulation von LDAP Distinguished Names (DN). Der Parameter
$caseFold wird in verschiedenen Methoden verwendet um festzustellen wie DN
Attribute betreffend Ihres Schreibweise behandelt werden. Die erlaubten Werte für diesen
Parameter sind:
-
Zend_Ldap_Dn::ATTR_CASEFOLD_NONE -
Es wird keine Änderung der Schreibweise durchgeführt.
-
Zend_Ldap_Dn::ATTR_CASEFOLD_UPPER -
Alle Attribute werden zur Großschreibung konvertiert.
-
Zend_Ldap_Dn::ATTR_CASEFOLD_LOWER -
Alle Attribute werden zur Kleinschreibung konvertiert.
Die Standardmäßige Schreibweise ist Zend_Ldap_Dn::ATTR_CASEFOLD_NONE und kann
mit Zend_Ldap_Dn::setDefaultCaseFold() gesetzt werden. Jede
Instanz von Zend_Ldap_Dn kann Ihre eigenen Einstellungen für die
Schreibweise haben. Wenn der Parameter $caseFold beim Methodenaufruf nicht
angegeben wird dann ist er standardmäßig die Einstellung der Schreibweise von der Instanz.
Die Klasse implementiert ArrayAccess um den indizierten Zugriff auf die
unterschiedlichen Teile der DN zu gestatten. Die ArrayAccess Methoden verweisen
für offsetGet(integer $offset) auf
Zend_Ldap_Dn::get($offset, 1, null), für
offsetSet() auf
Zend_Ldap_Dn::set($offset, $value) und für
offsetUnset() auf
Zend_Ldap_Dn::remove($offset, 1).
offsetExists() prüft einfach ob der Index innerhalb der Grenzen
ist.
| Methode | Beschreibung |
|---|---|
Zend_Ldap_Dn factory(string|array $dn,
string|null $caseFold)
|
Erstellt eine Zend_Ldap_Dn Instanz von einem Array oder String. Das Array muß der unter Zend_Ldap_Dn::implodeDn() beschriebenen Arraystruktur entsprechen. |
Zend_Ldap_Dn fromString(string $dn,
string|null $caseFold)
|
Erstellt eine Zend_Ldap_Dn Instanz von einem String. |
Zend_Ldap_Dn fromArray(array $dn,
string|null $caseFold)
|
Erstellt eine Zend_Ldap_Dn Instanz von einem Array. Das Array muß der Arraystruktur entsprechen welche unter Zend_Ldap_Dn::implodeDn() beschrieben ist. |
array getRdn(string|null $caseFold) |
Gibt den RDN des aktuellen DN zurück. Der zurückgegebene Wert ist ein Array wobei die Namen der Attribute von RDN im Schlüssel gesetzt sind und die RDN Attribute als Wert. |
string getRdnString(string|null
$caseFold)
|
Gibt den RDN vom aktuellen DN zurück. Der zurückgegebene Wert ist ein String. |
Zend_Ldap_Dn getParentDn(integer
$levelUp)
|
Gibt den DN des aktuellen DN Knotens, $levelUp Levels höher,
zurück. $levelUp ist standardmäßig 1.
|
array get(integer $index, integer $length, string|null
$caseFold)
|
Gibt einen Teil des aktuellen DN zurück der von $index und
$length eingegrenzt wird. $index beginnt mit
0 und der DN Teil von links.
|
Zend_Ldap_Dn set(integer $index, array
$value)
|
Ersetzt den DN Teil im aktuellen DN. Diese Operation manipuliert die aktuelle Instanz. |
Zend_Ldap_Dn remove(integer $index, integer
$length)
|
Entfernt einen DN Teil vom aktuellen DN. Diese Operation manipuliert die
aktuelle Instanz. $length ist standardmäßig 1.
|
Zend_Ldap_Dn append(array $value) |
Fügt einen DN Teil zum aktuellen DN hinzu, Diese Operation manipuliert die aktuelle Instanz. |
Zend_Ldap_Dn prepend(array $value) |
Fügt einen DN Teil vor dem aktuellen DN hinzu. Diese Operation manipuliert die aktuelle Instanz. |
Zend_Ldap_Dn insert(integer $index, array
$value)
|
Fügt einen DN Teil nach dem Index $index in den aktuellen DN
ein. Diese Operation manipuliert die aktuelle Instanz.
|
void setCaseFold(string|null $caseFold) |
Setzt die Option für die Schreibweise auf der aktuellen DN Instanz. Wenn
$caseFold null ist dann wird die standardmäßige Einstellung
der Schreibweise (standardmäßig ist
Zend_Ldap_Dn::ATTR_CASEFOLD_NONE oder über
Zend_Ldap_Dn::setDefaultCaseFold() gesetzt)
für die aktuelle Instanz gesetzt.
|
string toString(string|null $caseFold) |
Gibt den DN als String zurück. |
array toArray(string|null $caseFold) |
Gibt den DN als Array zurück. |
string __toString() |
Gibt den DN als String zurück - verweist auf Zend_Ldap_Dn::toString(null). |
void setDefaultCaseFold(string
$caseFold)
|
Setzt die standardmäßige Option für die Schreibweise welche von allen Instanzen bei der Erstellung standardmäßig verwendet wird. Bereits existierende Instanzen sind von dieser Einstellung nicht betroffen. |
array escapeValue(string|array
$values)
|
Escapt einen DN Wert entsprechend RFC 2253. |
array unescapeValue(string|array
$values)
|
Macht die Konvertierung von Zend_Ldap_Dn::escapeValue() rückgängig. |
array explodeDn(string $dn, array
&$keys, array &$vals, string|null $caseFold)
|
Zerteilt den DN $dn in ein Array das alle Teile des
angegebenen DN enthält. $keys sind optional die DN
Schlüssel (z.B. CN, OU, DC, ...). $vals sind optional die
DN Werte. Das zurückgegebene Array ist vom Typ
für einen DN von cn=name1+uid=user,cn=name2,dc=example,dc=org.
|
boolean checkDn(string $dn, array
&$keys, array &$vals, string|null $caseFold)
|
Prüft ob der gegebene DN $dn fehlerhaft ist. Wenn
$keys oder $keys und $vals
angegeben sind, werden diese Arrays mit dem betreffenden DN Schlüssel und
Werten gefüllt.
|
string implodeRdn(array $part, string|null
$caseFold)
|
Gibt den DN Teil in der Form $attribute=$value zurück.
|
string implodeDn(array $dnArray,
string|null $caseFold, string $separator)
|
Implodiert ein Array der Form die von
Zend_Ldap_Dn::explodeDn() kommt in einen DN
String. $separator ist standardmäßig ',' aber
einige LDAP Server verstehen auch ';'. $dnArray
muß von folgendem Typ sein:
|
boolean isChildOf(string|Zend_Ldap_Dn
$childDn, string|Zend_Ldap_Dn $parentDn)
|
Prüft ob der angegebene $childDn unter dem
$parentDn Subbaum ist.
|
Zend_Ldap_Filter
| Methode | Beschreibung |
|---|---|
Zend_Ldap_Filter equals(string $attr,
string $value)
|
Erstellt einen 'gleich' Filter: (attr=value).
|
Zend_Ldap_Filter begins(string $attr,
string $value)
|
Erstellt einen 'beginnt mit' Filter: (attr=value*).
|
Zend_Ldap_Filter ends(string $attr, string
$value)
|
Erstellt einen 'endet mit' Filter: (attr=*value).
|
Zend_Ldap_Filter contains(string $attr,
string $value)
|
Erstellt einen 'enthält' Filter: (attr=*value*).
|
Zend_Ldap_Filter greater(string $attr,
string $value)
|
Erstellt einen 'größer' Filter: (attr>value).
|
Zend_Ldap_Filter greaterOrEqual(string
$attr, string $value)
|
Erstellt einen 'größer oder gleich' Filter: (attr>=value).
|
Zend_Ldap_Filter less(string $attr, string
$value)
|
Erstellt einen 'kleiner' Filter: (attr<value).
|
Zend_Ldap_Filter lessOrEqual(string $attr,
string $value)
|
Erstellt einen 'kleiner oder gleich' Filter: (attr<=value).
|
Zend_Ldap_Filter approx(string $attr,
string $value)
|
Erstellt einen 'ungefähr' Filter: (attr~=value).
|
Zend_Ldap_Filter any(string $attr)
|
Erstellt einen 'jeden' Filter: (attr=*). |
Zend_Ldap_Filter string(string
$filter)
|
Erstellt einen einfachen eigenen String Filter. Der Benutzer ist dafür verantwortlich das alle Werte kommentiert sind da der Filter so wie er ist verwendet wird. |
Zend_Ldap_Filter mask(string $mask, string
$value,...)
|
Erstellt einen Filter von einer String Maske. Alle $value
Parameter werden kommentiert und in $mask umgewandelt indem
» sprintf()
verwendet wird.
|
Zend_Ldap_Filter
andFilter(Zend_Ldap_Filter_Abstract $filter,...)
|
Erstellt einen 'und' Filter von allen angegebenen Attributen. |
Zend_Ldap_Filter
orFilter(Zend_Ldap_Filter_Abstract $filter,...)
|
Erstellt einen 'oder' Filter von allen angegebenen Attributen. |
__construct(string $attr, string $value, string
$filtertype, string|null $prepend, string|null
$append)
|
Constructor. Erstellt einen eigenen Filter entsprechend den angegebenen
Parametern. Der resultierende Filter ist eine Verknüpfung von
$attr . $filtertype . $prepend . $value . $append.
Normalerweise wird dieser Constructor nicht benötigt da alle Filter durch
Verwendung der entsprechenden Factory Methoden erstellt werden können.
|
string toString() |
Gibt eine String Repräsentation des Filters zurück. |
string __toString() |
Gibt eine String Repräsentation des Filters zurück. Verweist auf Zend_Ldap_Filter::toString(). |
Zend_Ldap_Filter_Abstract negate() |
Invertiert den aktuellen Filter. |
Zend_Ldap_Filter_Abstract
addAnd(Zend_Ldap_Filter_Abstract $filter,...)
|
Erstellt einen 'und' Filter vom aktuellen Filter und allen als Argument übergegebenen Filtern. |
Zend_Ldap_Filter_Abstract
addOr(Zend_Ldap_Filter_Abstract $filter,...)
|
Erstellt einen 'oder' Filter vom aktuellen Filter und allen als Argument übergebenen Filtern. |
string|array escapeValue(string|array
$values)
|
Kommentiert die angegenen $values entsprechend RFC 2254 so das
Sie sicher in LDAP Filtern verwendet werden können. Wenn
ein einzelner String angegeben wird, wird ein String zurückgegeben -
andernfalls wird ein Array zurückgegeben. Jedes Control Zeichen wie der
ASCII Code < 32 sowie die Zeichen mit spezieller Bedeutung in
LDAP Filtern "*", "(", ")", und "\" (der Schrägstrich)
werden in die Repräsentation Schrägstrich gefolgt von zwei hexadezimalen
Ziffern konvertiert das den Hexadezimalen Wert des Zeichens repräsentiert.
|
string|array unescapeValue(string|array
$values)
|
Entfernt die Konvertierung die von Zend_Ldap_Filter::escapeValue() durchgeführt wurde. Konvertiert jede Sequenz eines Schrägstriches gefolgt von zwei hexadezimalen Ziffern in die korrespondierenden Zeichen. |
Zend_Ldap_Node
Zend_Ldap_Node includes the magic propery accessors
__set(), __get(), __unset() and
__isset() to access the attributes by their name. They proxy to
Zend_Ldap_Node::setAttribute(),
Zend_Ldap_Node::getAttribute(),
Zend_Ldap_Node::deleteAttribute() and
Zend_Ldap_Node::existsAttribute() respectively. Furthermore the class
implements ArrayAccess for array-style-access to the attributes.
Zend_Ldap_Node also implements Iterator and
RecursiveIterato to allow for recursive tree-traversal.
| Method | Description |
|---|---|
Zend_Ldap getLdap() |
Returns the current LDAP connection. Throws Zend_Ldap_Exception if current node is in detached mode (not connected to a Zend_Ldap instance). |
Zend_Ldap_Node attachLdap(Zend_Ldap
$ldap)
|
Attach the current node to the $ldap
Zend_Ldap instance. Throws
Zend_Ldap_Exception if $ldap is not
responsible for the current node (node is not a child of the
$ldap base DN).
|
Zend_Ldap_Node detachLdap() |
Detach node from LDAP connection. |
boolean isAttached() |
Checks if the current node is attached to a LDAP connection. |
Zend_Ldap_Node
create(string|array|Zend_Ldap_Dn $dn, array $objectClass)
|
Factory method to create a new detached
Zend_Ldap_Node for a given DN. Creates a new
Zend_Ldap_Node with the DN $dn and the
object-classes $objectClass.
|
Zend_Ldap_Node
fromLdap(string|array|Zend_Ldap_Dn $dn, Zend_Ldap $ldap)
|
Factory method to create an attached
Zend_Ldap_Node for a given DN. Loads an existing
Zend_Ldap_Node with the DN $dn from the
LDAP connection $ldap.
|
Zend_Ldap_Node fromArray((array $data,
boolean $fromDataSource)
|
Factory method to create a detached
Zend_Ldap_Node from array data $data. If
$fromDataSource is true
(false by default), the data is treated as beeing
present in a LDAP tree.
|
boolean isNew() |
Tells if the node is consiedered as new (not present on the server). Please note, that this doesn't tell if the node is really present on the server. Use Zend_Ldap_Node::exists() to see if a node is already there. |
boolean willBeDeleted() |
Tells if this node is going to be deleted once Zend_Ldap_Node::update() is called. |
Zend_Ldap_Node delete() |
Marks this node as to be deleted. Node will be deleted on calling Zend_Ldap_Node::update() if Zend_Ldap_Node::willBeDeleted() is true. |
boolean willBeMoved() |
Tells if this node is going to be moved once Zend_Ldap_Node::update() is called. |
Zend_Ldap_Node update(Zend_Ldap $ldap) |
Sends all pending changes to the LDAP server. If
$ldap is omitted the current LDAP connection is used.
If the current node is detached from a LDAP connection a
Zend_Ldap_Exception will be thrown. If
$ldap is provided the current node will be attached to
the given LDAP connection.
|
Zend_Ldap_Dn getCurrentDn() |
Gets the current DN of the current node as a Zend_Ldap_Dn. This does not reflect possible rename-operations. |
Zend_Ldap_Dn getDn() |
Gets the original DN of the current node as a Zend_Ldap_Dn. This reflects possible rename-operations. |
string getDnString(string $caseFold) |
Gets the original DN of the current node as a string. This reflects possible rename-operations. |
array getDnArray(string $caseFold) |
Gets the original DN of the current node as an array. This reflects possible rename-operations. |
string getRdnString(string $caseFold) |
Gets the RDN of the current node as a string. This reflects possible rename-operations. |
array getRdnArray(string $caseFold) |
Gets the RDN of the current node as an array. This reflects possible rename-operations. |
Zend_Ldap_Node setDn(Zend_Ldap_Dn|string|array
$newDn)
|
Sets the new DN for this node effectively moving the node once Zend_Ldap_Node::update() is called. |
Zend_Ldap_Node move(Zend_Ldap_Dn|string|array
$newDn)
|
This is an alias for Zend_Ldap_Node::setDn(). |
Zend_Ldap_Node rename(Zend_Ldap_Dn|string|array
$newDn)
|
This is an alias for Zend_Ldap_Node::setDn(). |
array getObjectClass() |
Returns the objectClass of the node. |
Zend_Ldap_Node setObjectClass(array|string
$value)
|
Sets the objectClass attribute. |
Zend_Ldap_Node appendObjectClass(array|string
$value)
|
Appends to the objectClass attribute. |
string toLdif(array $options) |
Returns a LDIF representation of the current node.
$options will be passed to the
Zend_Ldap_Ldif_Encoder.
|
array getChangedData() |
Gets changed node data. The array contains all changed attributes. This format can be used in Zend_Ldap::add() and Zend_Ldap::update(). |
array getChanges() |
Returns all changes made. |
string toString() |
Returns the DN of the current node - proxies to Zend_Ldap_Dn::getDnString(). |
string __toString() |
Casts to string representation - proxies to Zend_Ldap_Dn::toString(). |
array toArray(boolean
$includeSystemAttributes)
|
Returns an array representation of the current node. If
$includeSystemAttributes is false
(defaults to true) the system specific attributes are
stripped from the array. Unlike
Zend_Ldap_Node::getAttributes() the resulting array
contains the DN with key 'dn'.
|
string toJson(boolean
$includeSystemAttributes)
|
Returns a JSON representation of the current node using Zend_Ldap_Node::toArray(). |
array getData(boolean
$includeSystemAttributes)
|
Returns the node's attributes. The array contains all attributes in its internal format (no conversion). |
boolean existsAttribute(string $name, boolean
$emptyExists)
|
Checks whether a given attribute exists. If
$emptyExists is false empty attributes
(containing only array()) are treated as non-existent returning
false. If $emptyExists is true empty
attributes are treated as existent returning true. In
this case teh method returns false only if the
attribute name is missing in the key-collection.
|
boolean attributeHasValue(string $name, mixed|array
$value)
|
Checks if the given value(s) exist in the attribute. The
method returns true only if all values in
$value are present in the attribute. Comparison is
done strictly (respecting the data type).
|
integer count() |
Returns the number of attributes in the node. Implements Countable. |
mixed getAttribute(string $name, integer|null
$index)
|
Gets a LDAP attribute. Data conversion is applied using Zend_Ldap_Attribute::getAttribute(). |
array getAttributes(boolean
$includeSystemAttributes)
|
Gets all attributes of node. If
$includeSystemAttributes is false
(defaults to true) the system specific attributes are
stripped from the array.
|
Zend_Ldap_Node setAttribute(string $name, mixed
$value)
|
Sets a LDAP attribute. Data conversion is applied using Zend_Ldap_Attribute::setAttribute(). |
Zend_Ldap_Node appendToAttribute(string $name, mixed
$value)
|
Appends to a LDAP attribute. Data conversion is applied using Zend_Ldap_Attribute::setAttribute(). |
array|integer getDateTimeAttribute(string $name,
integer|null $index)
|
Gets a LDAP date/time attribute. Data conversion is applied using Zend_Ldap_Attribute::getDateTimeAttribute(). |
Zend_Ldap_Node setDateTimeAttribute(string $name,
integer|array $value, boolean $utc)
|
Sets a LDAP date/time attribute. Data conversion is applied using Zend_Ldap_Attribute::setDateTimeAttribute(). |
Zend_Ldap_Node appendToDateTimeAttribute(string $name,
integer|array $value, boolean $utc)
|
Appends to a LDAP date/time attribute. Data conversion is applied using Zend_Ldap_Attribute::setDateTimeAttribute(). |
Zend_Ldap_Node setPasswordAttribute(string $password,
string $hashType, string $attribName)
|
Sets a LDAP password on $attribName (defaults
to 'userPassword') to $password with the
hash type $hashType (defaults to
Zend_Ldap_Attribute::PASSWORD_HASH_MD5).
|
Zend_Ldap_Node deleteAttribute(string
$name)
|
Deletes a LDAP attribute. |
void removeDuplicatesFromAttribute(string
$name)
|
Removes duplicate values from a LDAP attribute. |
void removeFromAttribute(string $attribName,
mixed|array $value)
|
Removes the given values from a LDAP attribute. |
boolean exists(Zend_Ldap $ldap) |
Checks if the current node exists on the given LDAP server
(current server is used if null is passed).
|
Zend_Ldap_Node reload(Zend_Ldap $ldap) |
Reloads the current node's attributes from the given LDAP
server (current server is used if null is
passed).
|
Zend_Ldap_Node_Collection
searchSubtree(string|Zend_Ldap_Filter_Abstract $filter, integer
$scope, string $sort)
|
Searches the nodes's subtree with the given
$filter and the given search parameters. See
Zend_Ldap::search() for details on the parameters
$scope and $sort.
|
integer countSubtree(string|Zend_Ldap_Filter_Abstract
$filter, integer $scope)
|
Count the nodes's subtree items matching the given
$filter and the given search scope. See
Zend_Ldap::search() for details on the
$scope parameter.
|
integer countChildren() |
Count the nodes's children. |
Zend_Ldap_Node_Collection
searchChildren(string|Zend_Ldap_Filter_Abstract $filter, string
$sort)
|
Searches the nodes's children matching the given
$filter. See Zend_Ldap::search() for
details on the $sort parameter.
|
boolean hasChildren() |
Returns whether the current node has children. |
Zend_Ldap_Node_ChildrenIterator
getChildren()
|
Returns all children of the current node. |
Zend_Ldap_Node getParent(Zend_Ldap
$ldap)
|
Returns the parent of the current node using the LDAP
connection $ldap (uses the current LDAP connection if
omitted).
|
Zend_Ldap_Node_RootDse
The following methods are available on all vendor-specific subclasses.
Zend_Ldap_Node_RootDse includes the magic propery accessors
__get() and __isset() to access the attributes by their
name. They proxy to Zend_Ldap_Node_RootDse::getAttribute() and
Zend_Ldap_Node_RootDse::existsAttribute() respectively.
__set() and __unset() are also implemented but they throw
a BadMethodCallException as modifications are not allowed on RootDSE
nodes. Furthermore the class implements ArrayAccess for
array-style-access to the attributes. offsetSet() and
offsetUnset() also throw a BadMethodCallException due ro
obvious reasons.
| Method | Description |
|---|---|
Zend_Ldap_Dn getDn() |
Gets the DN of the current node as a Zend_Ldap_Dn. |
string getDnString(string $caseFold) |
Gets the DN of the current node as a string. |
array getDnArray(string $caseFold) |
Gets the DN of the current node as an array. |
string getRdnString(string $caseFold) |
Gets the RDN of the current node as a string. |
array getRdnArray(string $caseFold) |
Gets the RDN of the current node as an array. |
array getObjectClass() |
Returns the objectClass of the node. |
string toString() |
Returns the DN of the current node - proxies to Zend_Ldap_Dn::getDnString(). |
string __toString() |
Casts to string representation - proxies to Zend_Ldap_Dn::toString(). |
array toArray(boolean
$includeSystemAttributes)
|
Returns an array representation of the current node. If
$includeSystemAttributes is false
(defaults to true) the system specific attributes are
stripped from the array. Unlike
Zend_Ldap_Node_RootDse::getAttributes() the resulting
array contains the DN with key 'dn'.
|
string toJson(boolean
$includeSystemAttributes)
|
Returns a JSON representation of the current node using Zend_Ldap_Node_RootDse::toArray(). |
array getData(boolean
$includeSystemAttributes)
|
Returns the node's attributes. The array contains all attributes in its internal format (no conversion). |
boolean existsAttribute(string $name, boolean
$emptyExists)
|
Checks whether a given attribute exists. If
$emptyExists is false empty attributes
(containing only array()) are treated as non-existent returning
false. If $emptyExists is true empty
attributes are treated as existent returning true. In
this case teh method returns false only if the
attribute name is missing in the key-collection.
|
boolean attributeHasValue(string $name, mixed|array
$value)
|
Checks if the given value(s) exist in the attribute. The
method returns true only if all values in
$value are present in the attribute. Comparison is
done strictly (respecting the data type).
|
integer count() |
Returns the number of attributes in the node. Implements Countable. |
mixed getAttribute(string $name, integer|null
$index)
|
Gets a LDAP attribute. Data conversion is applied using Zend_Ldap_Attribute::getAttribute(). |
array getAttributes(boolean
$includeSystemAttributes)
|
Gets all attributes of node. If
$includeSystemAttributes is false
(defaults to true) the system specific attributes are
stripped from the array.
|
array|integer getDateTimeAttribute(string $name,
integer|null $index)
|
Gets a LDAP date/time attribute. Data conversion is applied using Zend_Ldap_Attribute::getDateTimeAttribute(). |
Zend_Ldap_Node_RootDse reload(Zend_Ldap
$ldap)
|
Reloads the current node's attributes from the given LDAP server. |
Zend_Ldap_Node_RootDse create(Zend_Ldap
$ldap)
|
Factory method to create the RootDSE. |
array getNamingContexts() |
Gets the namingContexts. |
string|null getSubschemaSubentry() |
Gets the subschemaSubentry. |
boolean supportsVersion(string|int|array
$versions)
|
Determines if the LDAP version is supported. |
boolean supportsSaslMechanism(string|array
$mechlist)
|
Determines if the sasl mechanism is supported. |
integer getServerType() |
Gets the server type. Returns
|
| Zend_Ldap_Dn getSchemaDn() | Returns the schema DN. |
OpenLDAP
Additionally the common methods above apply to instances of Zend_Ldap_Node_RootDse_OpenLdap.
Hinweis: Refer to » LDAP Operational Attributes and Objectsfor information on the attributes of OpenLDAP RootDSE.
| Method | Description |
|---|---|
integer getServerType() |
Gets the server type. Returns
Zend_Ldap_Node_RootDse::SERVER_TYPE_OPENLDAP
|
string|null getConfigContext() |
Gets the configContext. |
string|null getMonitorContext() |
Gets the monitorContext. |
boolean supportsControl(string|array
$oids)
|
Determines if the control is supported. |
boolean supportsExtension(string|array
$oids)
|
Determines if the extension is supported. |
boolean supportsFeature(string|array
$oids)
|
Determines if the feature is supported. |
ActiveDirectory
Additionally the common methods above apply to instances of Zend_Ldap_Node_RootDse_ActiveDirectory.
Hinweis: Refer to » RootDSEfor information on the attributes of Microsoft ActiveDirectory RootDSE.
| Method | Description |
|---|---|
integer getServerType() |
Gets the server type. Returns
Zend_Ldap_Node_RootDse::SERVER_TYPE_ACTIVEDIRECTORY
|
string|null
getConfigurationNamingContext()
|
Gets the configurationNamingContext. |
string|null getCurrentTime() |
Gets the currentTime. |
string|null
getDefaultNamingContext()
|
Gets the defaultNamingContext. |
string|null getDnsHostName() |
Gets the dnsHostName. |
string|null
getDomainControllerFunctionality()
|
Gets the domainControllerFunctionality. |
string|null
getDomainFunctionality()
|
Gets the domainFunctionality. |
string|null getDsServiceName() |
Gets the dsServiceName. |
string|null
getForestFunctionality()
|
Gets the forestFunctionality. |
string|null
getHighestCommittedUSN()
|
Gets the highestCommittedUSN. |
string|null
getIsGlobalCatalogReady()
|
Gets the isGlobalCatalogReady. |
string|null getIsSynchronized() |
Gets the isSynchronized. |
string|null getLdapServiceName() |
Gets the ldapServiceName. |
string|null
getRootDomainNamingContext()
|
Gets the rootDomainNamingContext. |
string|null
getSchemaNamingContext()
|
Gets the schemaNamingContext. |
string|null getServerName() |
Gets the serverName. |
boolean supportsCapability(string|array
$oids)
|
Determines if the capability is supported. |
boolean supportsControl(string|array
$oids)
|
Determines if the control is supported. |
boolean supportsPolicy(string|array
$policies)
|
Determines if the version is supported. |
eDirectory
Additionally the common methods above apply to instances of
Zend_Ldap_Node_RootDse_eDirectory.
Hinweis: Refer to » Getting Information about the LDAP Serverfor information on the attributes of Novell eDirectory RootDSE.
| Method | Description |
|---|---|
integer getServerType() |
Gets the server type. Returns
Zend_Ldap_Node_RootDse::SERVER_TYPE_EDIRECTORY
|
boolean supportsExtension(string|array
$oids)
|
Determines if the extension is supported. |
string|null getVendorName() |
Gets the vendorName. |
string|null getVendorVersion() |
Gets the vendorVersion. |
string|null getDsaName() |
Gets the dsaName. |
string|null getStatisticsErrors() |
Gets the server statistics "errors". |
string|null
getStatisticsSecurityErrors()
|
Gets the server statistics "securityErrors". |
string|null
getStatisticsChainings()
|
Gets the server statistics "chainings". |
string|null
getStatisticsReferralsReturned()
|
Gets the server statistics "referralsReturned". |
string|null
getStatisticsExtendedOps()
|
Gets the server statistics "extendedOps". |
string|null
getStatisticsAbandonOps()
|
Gets the server statistics "abandonOps". |
string|null
getStatisticsWholeSubtreeSearchOps()
|
Gets the server statistics "wholeSubtreeSearchOps". |
Zend_Ldap_Node_Schema
The following methods are available on all vendor-specific subclasses.
Zend_Ldap_Node_Schema includes the magic propery accessors
__get() and __isset() to access the attributes by their
name. They proxy to Zend_Ldap_Node_Schema::getAttribute() and
Zend_Ldap_Node_Schema::existsAttribute() respectively.
__set() and __unset() are also implemented but they throw
a BadMethodCallException as modifications are not allowed on RootDSE
nodes. Furthermore the class implements ArrayAccess for
array-style-access to the attributes. offsetSet() and
offsetUnset() also throw a BadMethodCallException due ro
obvious reasons.
| Method | Description |
|---|---|
Zend_Ldap_Dn getDn() |
Gets the DN of the current node as a Zend_Ldap_Dn. |
string getDnString(string $caseFold) |
Gets the DN of the current node as a string. |
array getDnArray(string $caseFold) |
Gets the DN of the current node as an array. |
string getRdnString(string $caseFold) |
Gets the RDN of the current node as a string. |
array getRdnArray(string $caseFold) |
Gets the RDN of the current node as an array. |
array getObjectClass() |
Returns the objectClass of the node. |
string toString() |
Returns the DN of the current node - proxies to
Zend_Ldap_Dn::getDnString().
|
string __toString() |
Casts to string representation - proxies to
Zend_Ldap_Dn::toString().
|
array toArray(boolean
$includeSystemAttributes)
|
Returns an array representation of the current node. If
$includeSystemAttributes is false
(defaults to true) the system specific attributes are
stripped from the array. Unlike
Zend_Ldap_Node_Schema::getAttributes() the resulting
array contains the DN with key 'dn'.
|
string toJson(boolean
$includeSystemAttributes)
|
Returns a JSON representation of the current node using
Zend_Ldap_Node_Schema::toArray().
|
array getData(boolean
$includeSystemAttributes)
|
Returns the node's attributes. The array contains all attributes in its internal format (no conversion). |
boolean existsAttribute(string $name, boolean
$emptyExists)
|
Checks whether a given attribute exists. If
$emptyExists is false empty attributes
(containing only array()) are treated as non-existent returning
false. If $emptyExists is true empty
attributes are treated as existent returning true. In
this case teh method returns false only if the
attribute name is missing in the key-collection.
|
boolean attributeHasValue(string $name, mixed|array
$value)
|
Checks if the given value(s) exist in the attribute. The
method returns true only if all values in
$value are present in the attribute. Comparison is
done strictly (respecting the data type).
|
integer count() |
Returns the number of attributes in the node. Implements Countable. |
mixed getAttribute(string $name, integer|null
$index)
|
Gets a LDAP attribute. Data conversion is applied using
Zend_Ldap_Attribute::getAttribute().
|
array getAttributes(boolean
$includeSystemAttributes)
|
Gets all attributes of node. If
$includeSystemAttributes is false
(defaults to true) the system specific attributes are
stripped from the array.
|
array|integer getDateTimeAttribute(string $name,
integer|null $index)
|
Gets a LDAP date/time attribute. Data conversion is applied
using
Zend_Ldap_Attribute::getDateTimeAttribute().
|
Zend_Ldap_Node_Schema reload(Zend_Ldap
$ldap)
|
Reloads the current node's attributes from the given LDAP server. |
Zend_Ldap_Node_Schema create(Zend_Ldap
$ldap)
|
Factory method to create the Schema node. |
array getAttributeTypes() |
Gets the attribute types as an array of . |
array getObjectClasses() |
Gets the object classes as an array of
Zend_Ldap_Node_Schema_ObjectClass_Interface.
|
| Method | Description |
|---|---|
string getName() |
Gets the attribute name. |
string getOid() |
Gets the attribute OID. |
string getSyntax() |
Gets the attribute syntax. |
int|null getMaxLength() |
Gets the attribute maximum length. |
boolean isSingleValued() |
Returns if the attribute is single-valued. |
string getDescription() |
Gets the attribute description |
| Method | Description |
|---|---|
string getName() |
Returns the objectClass name. |
string getOid() |
Returns the objectClass OID. |
array getMustContain() |
Returns the attributes that this objectClass must contain. |
array getMayContain() |
Returns the attributes that this objectClass may contain. |
string getDescription() |
Returns the attribute description |
integer getType() |
Returns the objectClass type. The method returns one of the
following values:
|
array getParentClasses() |
Returns the parent objectClasses of this class. This includes structural, abstract and auxiliary objectClasses. |
Classes representing attribute types and object classes extend
Zend_Ldap_Node_Schema_Item which provides some core methods to access
arbitrary attributes on the underlying LDAP node.
Zend_Ldap_Node_Schema_Item includes the magic propery accessors
__get() and __isset() to access the attributes by their
name. Furthermore the class implements ArrayAccess for
array-style-access to the attributes. offsetSet() and
offsetUnset() throw a BadMethodCallException as
modifications are not allowed on schema information nodes.
| Method | Description |
|---|---|
array getData() |
Gets all the underlying data from the schema information node. |
integer count() |
Returns the number of attributes in this schema information node. Implements Countable. |
OpenLDAP
Additionally the common methods above apply to instances of
Zend_Ldap_Node_Schema_OpenLDAP.
| Method | Description |
|---|---|
array getLdapSyntaxes() |
Gets the LDAP syntaxes. |
array getMatchingRules() |
Gets the matching rules. |
array getMatchingRuleUse() |
Gets the matching rule use. |
| Method | Description |
|---|---|
Zend_Ldap_Node_Schema_AttributeType_OpenLdap|null
getParent()
|
Returns the parent attribute type in the inhertitance tree if one exists. |
| Method | Description |
|---|---|
array getParents() |
Returns the parent object classes in the inhertitance
tree if one exists. The returned array is an array of
Zend_Ldap_Node_Schema_ObjectClass_OpenLdap.
|
ActiveDirectory
Hinweis: Schema browsing on ActiveDirectory servers
Due to restrictions on Microsoft ActiveDirectory servers regarding the number of entries returned by generic search routines and due to the structure of the ActiveDirectory schema repository, schema browsing is currently not available for Microsoft ActiveDirectory servers.
Zend_Ldap_Node_Schema_ActiveDirectory does not provide any
additional methods.
Zend_Ldap_Node_Schema_AttributeType_ActiveDirectory
does not provide any additional methods.
|
Zend_Ldap_Node_Schema_ObjectClass_ActiveDirectory
does not provide any additional methods.
|
Zend_Ldif_Encoder
| Methode | Beschreibung |
|---|---|
array decode(string $string)
|
Dekodiert den String $string in ein Array von
LDIF Elementen.
|
string encode(scalar|array|Zend_Ldap_Node
$value, array $options)
|
Kodiert $value in eine LDIF Repräsentation.
$options ist ein Array welches die folgenden Schlüssel
enthalten kann:
|
| Einführung |
