Unicode LDAP bind

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Unicode LDAP bind

Postby SiViN » 10. February 2012 12:38

Hello, sorry for my bad english :(

I have script :

=> it does not work:
Code: Select all
$ad = ldap_connect("server.loc");   
ldap_set_option($ad, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ad, LDAP_OPT_REFERRALS, 0);
$login = "user@server.loc";
$password = "Zeměščř1*";
$bd = ldap_bind($ad,$login, $password) or die("Couldn't bind to AD!");


=> if I change my password in the domain to:
$password = "Zemescr1*";
=> this works


I need the first script function.. (Zeměščř1*) -> Unicode solution?
If you use the original Apache on Linux and everything works. Xampp does not work. But I have to use Xampp.

Unfortunately, I do not know about that board :( someone help please?
SiViN
 
Posts: 3
Joined: 10. February 2012 10:42
XAMPP Version: 1.7.4
Operating System: CentOS release 5.4

Re: Unicode LDAP bind

Postby JonB » 10. February 2012 21:05

Did you save your code with an editor that supports UTF8 encoding???
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.7.4
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Unicode LDAP bind

Postby SiViN » 11. February 2012 03:25

Yes, i used UTF-8 encoding for file. I tested Windows-1250, ISO-8859-2, UTF-8 etc.
I also tried $password = iconv(someInputEnc, someInputDec, .......
Nothing works as well :(
SiViN
 
Posts: 3
Joined: 10. February 2012 10:42
XAMPP Version: 1.7.4
Operating System: CentOS release 5.4

Re: Unicode LDAP bind

Postby JonB » 11. February 2012 04:20

Check the page header info. (like with firebug)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.7.4
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Unicode LDAP bind

Postby Altrea » 11. February 2012 19:33

Hi SiViN,

i would use utf8_encode() in $user and $password.
AD v3 uses UTF-8 by default and ldap_bind can work with UTF-8 too.
So something must be missing in your implementation.

Do you close the ldap connection with ldap_close() if no connection can be established and at the end of your ldap functionality? If not, that can cause some difficult to debug errors.

best wishes,
Altrea
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
free software according to purpose of usage
XAMPP 1.8 for local development/testing only
Zend Server 6 (free) for production environments
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 4527
Joined: 17. August 2009 13:05
XAMPP Version: 1.8.0
Operating System: W7Ux64

Re: Unicode LDAP bind

Postby SiViN » 15. February 2012 09:42

utf8_encode($user, $password) not helped
Firebug says page header info = UTF8
File is in UTF-8 Encoding..
nothing works :(
SiViN
 
Posts: 3
Joined: 10. February 2012 10:42
XAMPP Version: 1.7.4
Operating System: CentOS release 5.4

Re: Unicode LDAP bind

Postby JonB » 15. February 2012 11:45

Try posting your question on StackOverflow:

http://stackoverflow.com/

Lots of server experts over there, not just a few like here.

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.7.4
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 1 guest