使用下面錯誤中引入的補丁(已包含在 CVS 中),此函式的參數應為
bool ldap_sasl_bind ( resource $link [, string $binddn [, string $password [, string $sasl_mech [, string $sasl_realm [, string $sasl_authc_id [, string $sasl_authz_id [, string $props]]]]]]] )
一些範例呼叫
$r=ldap_sasl_bind ( $ds, NULL, 'mysecret', 'DIGEST-MD5', NULL, 'jimmy');
使用 authz_id,指定 dn
$r = ldap_sasl_bind($ds, NULL, 'mysecret', 'DIGEST-MD5', NULL, 'jimmy', 'dn:uid=tommy,ou=people,dc=example,dc=com');
使用 authz_id 指定 SASL 使用者名稱
$r = ldap_sasl_bind($ds, NULL, 'mysecret', 'DIGEST-MD5', NULL, 'jimmy', 'u:tommy');
此外,由於 SASL 驗證是在 LDAP 版本 3 中引入的,
您可能需要使用以下指令明確設定版本號碼
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);