Keine Cache-Version

Caching deaktiviert Standardeinstellung für diese Seite:aktiviert (code LNG204)
Wenn die Anzeige zu langsam ist, können Sie den Benutzermodus deaktivieren, um die zwischengespeicherte Version anzuzeigen.

Rechercher une fonction PHP

ldap_modify_batch

(PHP 5.4 >= 5.4.26, PHP 5.5 >= 5.5.10, PHP 5.6 >= 5.6.0, PHP 7)

ldap_modify_batchBatch and execute modifications on an LDAP entry

Beschreibung

ldap_modify_batch ( resource $link_identifier , string $dn , array $entry [, array $serverctrls = array() ] ) : bool

Modifies an existing entry in the LDAP directory. Allows detailed specification of the modifications to perform.

Erste Seite von PHP-Handbuch Inhaltsverzeichnis Haut

Parameter-Liste

link_identifier

An LDAP link identifier, returned by ldap_connect().

dn

The distinguished name of an LDAP entity.

entry

An array that specifies the modifications to make. Each entry in this array is an associative array with two or three keys: attrib maps to the name of the attribute to modify, modtype maps to the type of modification to perform, and (depending on the type of modification) values maps to an array of attribute values relevant to the modification.

Possible values for modtype include:

LDAP_MODIFY_BATCH_ADD

Each value specified through values is added (as an additional value) to the attribute named by attrib.

LDAP_MODIFY_BATCH_REMOVE

Each value specified through values is removed from the attribute named by attrib. Any value of the attribute not contained in the values array will remain untouched.

LDAP_MODIFY_BATCH_REMOVE_ALL

All values are removed from the attribute named by attrib. A values entry must not be provided.

LDAP_MODIFY_BATCH_REPLACE

All current values of the attribute named by attrib are replaced with the values specified through values.

Note that any value for attrib must be a string, any value for values must be an array of strings, and any value for modtype must be one of the LDAP_MODIFY_BATCH_* constants listed above.

serverctrls

Array of LDAP Controls to send with the request.

Erste Seite von PHP-Handbuch Inhaltsverzeichnis Haut

Rückgabewerte

Gibt bei Erfolg TRUE zurück. Im Fehlerfall wird FALSE zurückgegeben.

Erste Seite von PHP-Handbuch Inhaltsverzeichnis Haut

Changelog

Version Beschreibung
7.3 Support for serverctrls added

Erste Seite von PHP-Handbuch Inhaltsverzeichnis Haut

Beispiele

Beispiel #1 Add a telephone number to a contact

<?php
$dn 
"cn=John Smith,ou=Wizards,dc=example,dc=com";
$modifs = [
    [
        
"attrib"  => "telephoneNumber",
        
"modtype" => LDAP_MODIFY_BATCH_ADD,
        
"values"  => ["+1 555 555 1717"],
    ],
];
ldap_modify_batch($connection$dn$modifs);
?>

Beispiel #2 Rename a user

<?php
$dn 
"cn=John Smith,ou=Wizards,dc=example,dc=com";
$modifs = [
    [
        
"attrib"  => "sn",
        
"modtype" => LDAP_MODIFY_BATCH_REPLACE,
        
"values"  => ["Smith-Jones"],
    ],
    [
        
"attrib"  => "givenName",
        
"modtype" => LDAP_MODIFY_BATCH_REPLACE,
        
"values"  => ["Jack"],
    ],
];
ldap_modify_batch($connection$dn$modifs);
ldap_rename($connection$dn"cn=Jack Smith-Jones"NULLTRUE);
?>

Beispiel #3 Add two e-mail addresses to a user

<?php
$dn 
"cn=Jack Smith-Jones,ou=Wizards,dc=example,dc=com";
$modifs = [
    [
        
"attrib"  => "mail",
        
"modtype" => LDAP_MODIFY_BATCH_ADD,
        
"values"  => [
            
"jack.smith@example.com",
            
"jack.smith-jones@example.com",
        ],
    ],
];
ldap_modify_batch($connection$dn$modifs);
?>

Beispiel #4 Change a user's password

<?php
$dn 
"cn=Jack Smith-Jones,ou=Wizards,dc=example,dc=com";
$modifs = [
    [
        
"attrib"  => "userPassword",
        
"modtype" => LDAP_MODIFY_BATCH_REMOVE,
        
"values"  => ["Tr0ub4dor&3"],
    ],
    [
        
"attrib"  => "userPassword",
        
"modtype" => LDAP_MODIFY_BATCH_ADD,
        
"values"  => ["correct horse battery staple"],
    ],
];
ldap_modify_batch($connection$dn$modifs);
?>

Beispiel #5 Change a user's password (Active Directory)

<?php
function adifyPw($pw)
{
    return 
iconv("UTF-8""UTF-16LE"'"' $pw '"');
}

$dn "cn=Jack Smith-Jones,ou=Wizards,dc=ad,dc=example,dc=com";
$modifs = [
    [
        
"attrib"  => "unicodePwd",
        
"modtype" => LDAP_MODIFY_BATCH_REMOVE,
        
"values"  => [adifyPw("Tr0ub4dor&3")],
    ],
    [
        
"attrib"  => "unicodePwd",
        
"modtype" => LDAP_MODIFY_BATCH_ADD,
        
"values"  => [adifyPw("correct horse battery staple")],
    ],
];
ldap_modify_batch($connection$dn$modifs);

Finde eine PHP-Funktion

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 30/01/2003, zuletzt geändert 26/10/2018
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/php-rf-function.ldap-modify-batch.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:fr Manuel PHP : http://php.net

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.

Inhaltsverzeichnis Haut