PHPマニュアル/PEARマニュアル | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot

ldap_exop - Performs an extended operation | JavaScript入門&応用&リファレンスなら「JavaScriptist」

  

ldap_exop

(PHP 7 >= 7.2.0)

ldap_exopPerforms an extended operation

説明

mixed ldap_exop ( resource $link , string $reqoid [, string $reqdata [, array $servercontrols [, string &$retdata [, string &$retoid ]]]] )

Performs an extended operation on the specified link with reqoid the OID of the operation and reqdata the data.

パラメータ

link

An LDAP link identifier, returned by ldap_connect().

reqoid

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.

reqdata

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

servercontrols

Unused as of PHP 7.2.

retdata

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.

retoid

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

返り値

When used with retdata, returns TRUE on success or FALSE on error. When used without retdata, returns a result identifier or FALSE on error.

例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 $retdata 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";
}
?>

参考


忘却曲線を使ってこの関数を確実に記憶に残す

フォーラムで「ldap_exop - Performs an extended operation」について話す
各種マニュアル: PHPマニュアル | PEARマニュアル | Smarty(英語)マニュアル | PHP-GTKマニュアル | ldap_exop - Performs an extended operation」をGoogle検索
copyright © 1997-2024 PHP ドキュメント作成グループ(ライセンス). provided by php spot. マニュアル: