Re: [PHP] ldap_rename refused to work
--- Stig Venaas <[EMAIL PROTECTED]> wrote: > > But you're not doing what I wrote... :) or else i won't be asking hehehe > > The third parameter should be the new rdn (which is the same as the old), > and the fourth should be new parent. So it should look like this: > > $r=ldap_rename($ds, > "uid=roger,ou=People,ou=Civil,o=Engineering,dc=mydomain,dc=net", > "uid=roger", > "ou=People,ou=Credit,o=Finance,dc=mydomain,dc=net", TRUE); > > Stig Great, it works. Stig, you saved my day. I owe you my eternal gratitude. -- roger __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ldap_rename refused to work
On Wed, Aug 14, 2002 at 02:18:58AM -0700, Roger Thomas wrote: > built: php-4.2.2 with openldap 2.0.25 > > i tried using the ldap_rename function to modify the dn of my ldap db but > nothing seems to happen. the record was not change at all. i have followed > closely the code-snippet that was given by Mr Stig Venaas at: > http://marc.theaimsgroup.com/?l=php-general&m=100949195224325&w=2 But you're not doing what I wrote... > // we want to transfer user roger from Civil Engineering to Credit section in > Finance > $r=ldap_rename($ds, > "uid=roger,ou=People,ou=Civil,o=Engineering,dc=mydomain,dc=net", > "uid=roger,ou=People,ou=Credit,o=Finance,dc=mydomain,dc=net", > "dc=mydomain,dc=net",TRUE); The third parameter should be the new rdn (which is the same as the old), and the fourth should be new parent. So it should look like this: $r=ldap_rename($ds, "uid=roger,ou=People,ou=Civil,o=Engineering,dc=mydomain,dc=net", "uid=roger", "ou=People,ou=Credit,o=Finance,dc=mydomain,dc=net", TRUE); Stig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ldap_rename refused to work
built: php-4.2.2 with openldap 2.0.25 i tried using the ldap_rename function to modify the dn of my ldap db but nothing seems to happen. the record was not change at all. i have followed closely the code-snippet that was given by Mr Stig Venaas at: http://marc.theaimsgroup.com/?l=php-general&m=100949195224325&w=2 following is my short code to do this: "; exit(); } if (!ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) { echo "Failed to set protocol version"; exit; } //we bind to ldap server AFTER the ldap_set_option is successfull //this is an authenticated bind $r=ldap_bind($ds,"cn=admin,o=Administrators,dc=mydomain,dc=net", "secret"); if (!$r) { echo "LDAP bind failed"; exit(); } // we want to transfer user roger from Civil Engineering to Credit section in Finance $r=ldap_rename($ds, "uid=roger,ou=People,ou=Civil,o=Engineering,dc=mydomain,dc=net", "uid=roger,ou=People,ou=Credit,o=Finance,dc=mydomain,dc=net", "dc=mydomain,dc=net",TRUE); //Close the LDAP connection. ldap_close($ds); print "modification done"; ?> please advise. -- roger __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ldap_rename
Hello all, Does anyone out there have ldap_rename working? I've tried resetting the LDAP version to 3 (which gives a protocol error) and 2 (which gives an unsupported call return). However, the command line ldapmodrdn command works, as does some Perl&C code that I tossed togther to test renaming DN's. But everything I try in PHP comes back as a failed command. It seems from debugging that the server does not understand a rename from PHP, possibly just due to the platform? (I am running OpenLDAP 2.0.18, PHP 4.1.0(Apache 1.3.22) on Solaris). Other than this, I have to say the LDAP implementation in PHP is amazing! -- Greg Ulyatt REDNET Ltd. UNIX Systems Administrator High Wycombe, Bucks, UK -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]