ldap_exop

(PHP 7 >= 7.2.0, PHP 8)

ldap_exopPerforms an extended operation

Beschreibung

ldap_exop(
    LDAP\Connection $ldap,
    string $request_oid,
    string $request_data = null,
    array $controls = null,
    string &$response_data = ?,
    string &$response_oid = ?
): mixed

Performs an extended operation on the specified ldap with request_oid the OID of the operation and request_data the data.

Parameter-Liste

ldap

Eine LDAP\ConnectionInstanz, die von ldap_connect() zurückgegeben wurde.

request_oid

The extended operation request OID. You may use one of LDAP_EXOP_START_TLS, LDAP_EXOP_MODIFY_PASSWD, LDAP_EXOP_REFRESH, LDAP_EXOP_WHO_AM_I, LDAP_EXOP_TURN, or a string with the OID of the operation you want to send.

request_data

The extended operation request data. May be NULL for some operations like LDAP_EXOP_WHO_AM_I, may also need to be BER encoded.

controls

Array of LDAP Controls to send with the request.

response_data

Will be filled with the extended operation response data if provided. If not provided you may use ldap_parse_exop on the result object later to get this data.

response_oid

Will be filled with the response OID if provided, usually equal to the request OID.

Rückgabewerte

When used with response_data, returns true on success or false on error. When used without response_data, returns a result identifier or false on error.

Changelog

Version Beschreibung
8.1.0 Der Parameter ldap erwartet nun eine LDAP\Connection-Instanz; vorher wurde eine Ressource erwartet.
7.3.0 Support for serverctrls added

Beispiele

Beispiel #1 Whoami extended operation

<?php
$ds 
ldap_connect("localhost");  // assuming the LDAP server is on this host

if ($ds) {
    
// bind with appropriate dn to give update access
    
$bind ldap_bind($ds"cn=root, o=My Company, c=US""secret");
    if (!
$bind) {
      echo 
"Unable to bind to LDAP server";
      exit;
    }

    
// Call WHOAMI EXOP
    
$r ldap_exop($dsLDAP_EXOP_WHO_AM_I);

    
// Parse the result object
    
ldap_parse_exop($ds$r$retdata);
    
// Output: string(31) "dn:cn=root, o=My Company, c=US"
    
var_dump($retdata);

    
// Same thing using $response_data parameter
    
$success ldap_exop($dsLDAP_EXOP_WHO_AM_INULLNULL$retdata$retoid);
    if (
$success) {
      
var_dump($retdata);
    }

    
ldap_close($ds);
} else {
    echo 
"Unable to connect to LDAP server";
}
?>

Siehe auch

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Grundlagen von Views in MySQL

Views in einer MySQL-Datenbank bieten die Möglichkeit, eine virtuelle Tabelle basierend auf dem Ergebnis einer SQL-Abfrage zu erstellen. ...

admin

Autor : admin
Kategorie: mySQL-Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

Daten einer Abfrage mit Hilfe von Thumbnails nebeneinander ausgeben

Warum soll ich float meiden? Siehe https://www.linkedin.com/pulse/css-float-vs-grid-flexbox-sachin-tiwari Falls es mit Englisch nicht so klappt: ...

Geschrieben von scatello am 18.05.2024 05:57:56
Forum: PHP Developer Forum
Daten einer Abfrage mit Hilfe von Thumbnails nebeneinander ausgeben

Also den Fehler habe ich gefunden und abgestellt. Warum soll ich float meiden?

Geschrieben von Malchor am 17.05.2024 20:54:01
Forum: PHP Developer Forum
Daten einer Abfrage mit Hilfe von Thumbnails nebeneinander ausgeben

Dein HTML-Code ist definitiv kaputt und float solltest du auch vergessen. Beschäftige dich mit Flex-Box oder Grid

Geschrieben von scatello am 17.05.2024 20:43:50
Forum: PHP Developer Forum
Daten einer Abfrage mit Hilfe von Thumbnails nebeneinander ausgeben

Da ich viele unterschiedliche Tabellen benötige mache ich das so umständlich. Aber ist das der Grund warum das Floaten nicht funktioniert?

Geschrieben von Malchor am 17.05.2024 17:15:03
Forum: PHP Developer Forum