Zend_Ldap in ZF 1.12 unable to update attributes

For programming and general questions on Zend Framework
Post Reply
Posts: 12
Joined: Sun Jul 03, 2011 1:00 am

Zend_Ldap in ZF 1.12 unable to update attributes

Post by petxi » Fri Nov 03, 2017 7:52 pm


I am trying to modify attributes from an active directory domain. I am able connect and change password but not able to activate the user nor change the email account. This is a code snippet:

Code: Select all

$options = array(
    'host'                   => HOST_LDAP_STUDENTS,
    'useStartTls'            => true,
    'username'               => USERNAME_LDAP_STUDENTS,
    'password'               => PASSWORD_LDAP_STUDENTS,
    'accountDomainName'      => ACCOUNTDOMAINNAME_LDAP_STUDENTS,
    'baseDn'                 => BASEDN_LDAP2_STUDENTS,



$ldap = new Zend_Ldap($options);

try {

    $hm = $ldap->getEntry('cn=CRISTINA GARCIA BESORA,ou=SCG,dc=CAMPUS,dc=EUG,dc=ES');
    //Zend_Ldap_Attribute::setAttribute($hm, 'useraccountcontrol', 512);
    Zend_Ldap_Attribute::setAttribute($hm, 'mail', 'mueller@my.local');
    $ldap->update('cn=CRISTINA GARCIA BESORA,ou=SCG,dc=CAMPUS,dc=EUG,dc=ES', $hm);
    echo "SUCCESS: modificat $nom $cognoms\n";
} catch (Zend_Ldap_Exception $zle) {
    echo '  ' . $zle->getMessage() . "\n";
    if ($zle->getCode() === Zend_Ldap_Exception::LDAP_X_DOMAIN_MISMATCH) {
The error am i receiving is:

0x35 (Server is unwilling to perform; 0000209A: SvcErr: DSID-031A10B0, problem 5003 (WILL_NOT_PERFORM), data 0 ): updating: cn=CRISTINA GARCIA BESORA,ou=SCG,dc=CAMPUS,dc=EUG,dc=ES

Can you help me ?

Thank you !


Post Reply