OpenLDAP 2.4.32およびPHP 5.4.6でldap_modifyを使用してアクセスエラーが不十分です。エラーを与えているPHP ldap_modifyアクセスが不十分です
PHP関数は次のようになります。
function set_user($dn, $password, $data)
{
/* This function sets the users infomation */
// Get Configuration Items
$ldapServer = $this->config->item('ldapServer');
$ldapDCRoot = $this->config->item('ldapDCRoot');
// Connect to LDAP
$ldapConnection = ldap_connect($ldapServer);
if($ldapConnection)
{
$r = ldap_bind($ldapConnection, $dn, $password);
if ($r)
{
// Bind completed successfully
$r = ldap_modify($ldapConnection, $dn, $data);
return True;
}
die("Unsuccessful Bind");
}
die("Can't connect to LDAP");
}
$ dnは自分のパスワードと一緒に自分の情報を変更しようとしているユーザーの完全なDNです。 $ dataは更新中の値です。現在、データには$ data ['mobile'] = "newPhoneNumber"を変更するための電話番号が含まれています。これは、データが実際には決して書き込まれないという事実を除いて、すべて機能しているように見えます。
ACLに書き込むことができるとわかるように、openldapファイルが以下に含まれています。
include /etc/openldap/schema/corba.schema
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/duaconf.schema
include /etc/openldap/schema/dyngroup.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/java.schema
include /etc/openldap/schema/misc.schema
include /etc/openldap/schema/nis.schema
include /etc/openldap/schema/openldap.schema
include /etc/openldap/schema/ppolicy.schema
include /etc/openldap/schema/collective.schema
allow bind_v2
pidfile /var/run/openldap/slapd.pid
argsfile /var/run/openldap/slapd.args
TLSCertificateFile /etc/pki/tls/certs/slapd.pem
TLSCertificateKeyFile /etc/pki/tls/certs/slapd.pem
access to *
by self write
by users read
by anonymous auth
database bdb
suffix "dc=example,dc=com"
checkpoint 1024 15
rootdn "cn=manager,dc=example,dc=com"
rootpw REDACTED
directory /var/lib/ldap
index objectClass eq,pres
index ou,cn,mail,surname,givenname eq,pres,sub
index uidNumber,gidNumber,loginShell eq,pres
index uid,memberUid eq,pres,sub
index nisMapName,nisMapEntry eq,pres,sub
なぜPHPは値を更新できず、代わりに不十分なアクセスエラーが発生していますか?
)、 'たldap_set_optionしてみてください(NULL、LDAP_OPT_DEBUG_LEVELは、7);'(これはバーチャルホスト固有にダンプNOT_ARCHIVEDの_will Apacheのグローバルエラーログにデバッグ出力の束をダンプしますログ、または 'error_log'設定に変更します)。 – miken32