|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-12-12 01:34 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 00:00:01 2025 UTC |
Description: ------------ We work with OpenLDAP 2.1.22 and PHP 4.3.8 I'm working in a set of applications to manage our LDAP directory. We archive into the LDAP information about users, and need to save spanish characters, such as "?", "?",... So when I try to add an entry into the ldap, I apply "utf8_encode" to some attributes. By the moment these attributes are: 'cn', 'sn' and 'gecos'. When this happens, I have 2 problems: 1. In 'sn' there use to be 2 words, first surname and second surname, and after apply utf8_encode, it deletes the second surname. 2. When I try to add the entry into the ldap, I get an error and it can't be done Any idea? Reproduce code: --------------- The code is this: $info['uid']=$uid; $info['cn']=utf8_encode($cn); $info['sn']=utf8_encode($sn); $info['userPassword']="{MD5}".base64_encode(pack("H*",md5($clave))); $info['gecos']=utf8_encode($gecos); $info['ou']=$ou; $ds=ldap_connect($servidor); if($ds) { $user="cn=Administrador,o=ou.uvigo.es"; $r=ldap_bind($ds,$user,$cla); if ($r) { $a?ade= ldap_add($ds,$usuario,$info); ... } } Expected result: ---------------- If everything were ok, I would see "Usuario a?adido con ?xito". Instead of that I only get "Invalid syntax". Actual result: -------------- The actual result is: Warning: ldap_add(): Add: Invalid syntax in /var/www/html/proyecto/crear_usuario.php on line 70