ldap_bindとは? わかりやすく解説

ldap_bind

(PHP 4, PHP 5)
ldap_bind — LDAP ディレクトリにバインドする

説明

bool ldap_bind ( resource link_identifier [, string bind_rdn [, string bind_password]] )
指定した RDN およびパスワードを用いて LDAP ディレクトリをバインドします。 成功の場合に TRUE、エラーの場合に FALSE を返します。
ldap_bind() は、ディレクトリに関するバインド動作を 行います、bind_rdn および bind_password はオプションです。 指定されない場合は、匿名(anonymous) バインドが試みられます。
例 1016. LDAP バインドの使用
<?php

// ldap バインドを使用する
$ldaprdn  = 'uname';    // ldap rdn あるいは dn
$ldappass = 'password';  // パスワード

// ldap サーバに接続する
$ldapconn = ldap_connect("ldap.example.com")
   or die("Could not connect to LDAP server.");

if ($ldapconn) {

   // ldap サーバにバインドする
   $ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);

   // バインド結果を検証する
   if ($ldapbind) {
       echo "LDAP bind successful...";
   } else {
       echo "LDAP bind failed...";
   }
      
}

?>

例 1017. LDAP 匿名バインドの使用
<?php

// ldap 匿名バインドを使用する

// ldap サーバに接続する
$ldapconn = ldap_connect("ldap.example.com")
   or die("Could not connect to LDAP server.");

if ($ldapconn) {

   // 匿名でバインドする
   $ldapbind = ldap_bind($ldapconn);

   if ($ldapbind) {
       echo "LDAP bind anonymous successful...";
   } else {
       echo "LDAP bind anonymous failed...";
   }
 
}
  
?>




英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「ldap_bind」の関連用語

ldap_bindのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ldap_bindのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
PHP Documentation GroupPHP Documentation Group
Copyright © 1997 - 2024 by the PHP Documentation Group.

©2024 GRAS Group, Inc.RSS