Zend_Ldap in ZF 1.12 unable to update attributes

For programming and general questions on Zend Framework

Zend_Ldap in ZF 1.12 unable to update attributes

Postby petxi on Fri Nov 03, 2017 7:52 pm

Hello,

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,
    'accountDomainNameShort' => ACCOUNTDOMAINNAMESHORT_LDAP_STUDENTS,
    'baseDn'                 => BASEDN_LDAP2_STUDENTS,

);

putenv('LDAPTLS_REQCERT=never');

$ldap = new Zend_Ldap($options);

try {
    $ldap->bind();

    $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";
    return;
   
   
} catch (Zend_Ldap_Exception $zle) {
    echo '  ' . $zle->getMessage() . "\n";
    if ($zle->getCode() === Zend_Ldap_Exception::LDAP_X_DOMAIN_MISMATCH) {
        continue;
    }
}


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 !

--
Sergi
petxi
 
Posts: 12
Joined: Sun Jul 03, 2011 1:00 am

Return to Zend Framework

Who is online

Users browsing this forum: No registered users and 5 guests

cron