Access Active Directory (of WINDOWS SERVER 2003) Via LDAP
I want to read user information from the microsoft windows 2003 server.
In the windows server 2003, i've create a domain, called "wissenskolleg".
I've assigned a password to it.
Now, i want get access to the Active Directory with PHP.
My code:
$ds=ldap_connect("wissenkolleg.com");
$r=ldap_bind($ds,"administrator","psword");
Always I've get the following error message: warning: ldap_bind(): For
Unable ton bind tons of servers I've found out, that $ds always return: Resource id #2 If i changed "wissenkolleg.com" in "whyitis", it is all the same, i've can only read: Resource id #2 and the same error with ldap_bind.
View Complete Forum Thread with Replies
Related Forum Messages:
Active Directory And LDAP
I have a php Intranet, and what I would like to do is hit the Active Directory and bring back the Username, FirstName and Lastname from Active Directory and set them to variables, so I can either display them or insert them into a database. A few things to consider, php is installed on the server, but I don't have access to the server to change any settings. This is just a side project and we are blowing up the existing intranet and going with a Content Management System, so the easier the better.
View Replies !
Ldap And Php4 With W2k Active Directory
I am trying to get ldap info from a W2K active directory. I have the authentication down, but I want to search on the aa0000000 to get the name associated with the login. Basically I am making a request form that will be used once a year, but need to be sure of the people signing up, use resources already setup, and have one login/pass. Code:
View Replies !
LDAP Connect To The Microsoft Active Directory
I have been trying to connect to the Microsoft Active Directory in order to access user and user group information form authentication on one of my websites. When I execute the code below, I am able to connect but cannot bind. <?php $conn=ldap_connect("localhost") or die("Couldn't connect"); echo "Connect result is " . $conn . "<br />"; ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION,3); ldap_set_option($conn, LDAP_OPT_REFERRALS,0); $bind=ldap_bind($conn,'sarfaraz','password') or die("Couldn't Bind"); echo "Bind result is " . $bind . "<br />"; ldap_close($ds); ?> RESULT: Connect result is Resource id #2 Couldn't Bind I am currently developing this website on my personal computer (xp home, apache 2, php 5, mysql 5). I enabled the LDAP module in the php.ini, added php to the windows PATH, added libeay32.dll and ssleay32.dll to the system32 folder and restarted apache and the computer.
View Replies !
Sorting Active Directory/LDAP Output (Lastname, Firstname)
My company has asked me to put a company directory on our intranet site and I'm trying to use php to extract the users from our active directory server. I've got everything working, however, when the list of users is shown in the output, it seems to display the users in the order their accounts were created, with Administrator obviously being first. What do you think would be the best way to get the list to be sorted by lastname (sn), based on the coding below. usort? ldap_sort? Not really too familiar with using php and ldap or active directory. <?php $ldap_server = "ldap://ourldap"; $auth_user = "user"; $auth_pass = "pass"; // Set the base dn to search the entire directory. $base_dn = "ou=staff, dc=ourldap, dc=com"; // Show People $filter = "(&(objectClass=user)(objectCategory=person)(cn=*))"; // connect to server if (!($connect=@ldap_connect($ldap_server))) { die("Could not connect to ldap server"); } // bind to server if (!($bind=@ldap_bind($connect, $auth_user, $auth_pass))) { die("Unable to bind to server"); }
View Replies !
Php And Windows Server 2003
I have a website(html)/eshop running on a 3rd party 'windows server 2003'. I want to include some rss feeds on a html page using a php script. is there a simple way to test a simple php script in that type of server - ie do i just insert the script & leave the page .html or do i have to change it to .php?
View Replies !
Php On Windows Server 2003
I work on a site with a friend of mine. Recently he transferred the site from being hosted on a Unix server to being hosted on his own server running Windows Advance Server 2003. He seems to know about as much about setting up servers as I do (which isn't much!), and although he's gotten PHP running, none of my PHP scripts that write files work. I've looked up answers and he's tried different things, but so far he hasn't been able to resolve the problem. Without being able to use fwrite() I will have to update several areas of the site by hand. Here's a sample error: Warning: fopen(file.txt): failed to open stream: Permission denied in G:modelsonline estswrite.php on line 11 Warning: fwrite(): supplied argument is not a valid stream resource in G:modelsonline estswrite.php on line 12 Warning: fclose(): supplied argument is not a valid stream resource in G:modelsonline estswrite.php on line 13 Can someone give me the dummies version of how to resolve this so I can explain it to him?
View Replies !
Windows 2003 Server
So here is my situation, I am running a Windows 2003 server (the full version) and have been happily using PHP 5 for a while, however it stopped working, I don't know exactly when as there are currently no critical applications using PHP. When I noticed this I did a little bit of research and decided it was probably a good idea to reinstall PHP 5.2, I consider myself quite knowledgeable with installing php as I have done it a fair few times, however to be safe I always follow the guide on php.net. Code:
View Replies !
IIS 6 On Windows 2003 Server
I figured that an easy way to check my progress was to just run them on IIS6. Well, troubleshooting time has gone up, and very little in the way of work has gotten done. hoping that someone here can steer me in the right direciton. I have installed PHP 4.3.8, and everytime I try and run a php file I receive this message: No input file specified.
View Replies !
Windows Server 2003
I'm an idiot, but I cannot figure out how to get PHP 5.0 and MySQL to work together. I've tried reading the "installation" files on PHP.net, but they only get me more confused. I am truly a beginner with PHP and MySQL, but i simply need to get PHP and MySQL talking so that some scripts I've purchased will work.
View Replies !
Authenticating Users From Windows Active Directory From PHP Code
I want to authenticate users (defined in an Active Directory Service running on a Windows 2000 Server machine) from PHP Code running under Linux (Fedora Core 3 with Kerberos 5 installed). I just want to find out whether a particular user (with a given username, password combination) exists or not. Then I will login that user into my intranet application (developed on PHP under Linux).
View Replies !
PHP Installation For Windows Server 2003
I'm having an issue installing PHP4 on my IIS 6.0 server. I am using the installer and am told that PHP 4.3.3 has been installed successfully but get the following error. "Due to missing OCX control on your systems, the installation Wizard is unable to configure your web server. However, PHP has been successfully installed, and all you need to do now is manually configure the web server as described in the install.txt file which can be found in your php installation directory." I manually configure for IIS 4.0 or greater and continue to get a "The page cannot be found - 404" error when accessing anything with a php extension? I have defined all the neccessary permissions for the dir. etc but still have an issue with the above error. I'm a first time installer on this platform so does anyone either (a) have a theory as to why this doesn't work or (b) have a solution that they have found.
View Replies !
Php.ini Not Found On Windows Server 2003 64 Bit
I have installed php 5.2 on 64 bit windows server 2003, and it is all working, except it will not read my php.ini file. In phpinfo it just says C:windows I have tried: Setting envt variable PHPRC to c:php Adding registry entry [HKEY_LOCAL_MACHINESOFTWAREPHP] "IniFilePath"="C:PHP" And also registry entry [HKEY_LOCAL_MACHINESOFTWAREWow6432NodePHP] "IniFilePath"="C:PHP" And also just copying my php.ini file to C:windows None of these seem to work. Has anyone set up PHP on 64 bit windows server 2003, and if so, how did you get it to read your php.ini file?
View Replies !
MySQL On Windows 2003 Server
I have installed PHP verr 4.x and MySQL 4.1 on a Windows 2003 Standard Server running IIS. I am trying to install phpadsnew an adserving program. However when I specify the username, password and table during installation it says Could not connect to database. Whereas the same thing installed without any error on a Windows XP Pro machine. Do I need to install MyODBC drivers or something similar.
View Replies !
PHP/MySQL On Windows 2003 Server 64bit
We're looking at getting a hosted dedicated web server to host our PHP4/MySQL4 websites. It needs to be a MS Windows server as we use .NET Web Services for a lot of background communications. We've found what appears to be a fantastic hosting package but it is on Windows 2003 Server **64 bit edition**. Are there any problems with PHP4/MySQL4 on 64 bit servers? Are these problems easy to overcome?
View Replies !
Send Mail() Thru A Windows 2003 Server
I'm stuck trying to convert my L.A.M.P. scripting over to a Windows 2003 Server with MySQL/PHP, because the powers that make the decisions didn't bother consulting with me first. It wasn't my choice of server, trust me. I've found various articles on the topic and worked out most of the configuration changes (.ini, etc.) necessary to make things work for the most part. I havn't been able to find a working solution for sending mail() thru PHP. I've tried setting the SMTP and sendmail_from settings in the PHP INI. ini_set('SMTP', 'smtp.domainname.com'); ini_set('sendmail_from', 'info@domainname.com');
View Replies !
Scheduling Scripts In Windows Server 2003
I am trying to create a scheduled task on a windows server. I have written a PHP script and tried to set up task scheduler to execute it for me. It doesn't seem to be working. Is it possible to use task scheduler with PHP scripts or is it just executables? If so, any advice?
View Replies !
Installing On IIS 6.0 (windows Server 2003, Enterprise Edition)
I am pretty new to IIS, as well as PHP. However, I had no problems installing PHP on XP Pro w/ IIS installed. However, Last night I installed Windows 2003 Server, enterprise Edition w/ IIS 6.0 installed. Downloaded PHP 4.3.2 (w/ the installer) and ran through the setup w/ no problems. It did say I had to manually configure the server however(due to some missing OSX Components.) All is well, I went in to the default web via IIS Manager, and added .php to the ISAPI mapping, w/ the executable pointing to my php.exe file. The install program put PHP.ini in c:windows so all is well. Yet still, when I attempt to access a .php file via web browser I get a 'HTTP Error 404 - File or directory not found.' However, when I reference the index.html file it works file, so my root directory is set correctly. So, I read on a website that to use PHP w/ IIS you have to turn off cgi.force_redirect = 1 in the php.ini file. (commented it out.) Still I get the page not found error. I am completely lost! I figured it was a permission issue. Yet, I went into IIS manager, and set the default permissions for that website as being, read, write, and script access. I also read on a website, that you have to give read, write access to IUR_MachineName(server-01 in my case, so IUSR_Server01.) Did that, still the 404 error. Please, any assistence into this would be VERY much appreciated!
View Replies !
Mail() Php Function Not Working In Windows Server 2003
I tried the mail() php function and it ends up with error message. I tried different tests with port configuration and Smtp server, though it ended up in error. Error: Code: Original - Code Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in c:program fileseasyphp1-7wwwmailerman.php on line 19 Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in c:program fileseasyphp1-7wwwmailerman.php on line 19.
View Replies !
No Cookie Sent When Starting A Session - Windows Server 2003
I got PHP installed and running via IIS. When I call a start_session(); I can see the session file created in the c:mp directory (specified in php.ini). However, no cookie is sent to the browser. php.ini is set to use session cookies. Cookies are for certain not being blocked by the brower. I am accessing the site via its own IP (i.e. http://23.64.18.112/test.php) The result is that every time I refresh the page, I get a new session data file in the temp directory because it is unable to associate the user with the session data since there is no session cookie on their system. Passing session IDs via URL is not an option. I need session cookies to work.
View Replies !
Mysql Access Denied On 2003 Server
I just install mysql,php and phpmyadmin on the server 2003. I tried to connect thorugh http://localhost/phpmyadmindirectory/index.php but I got #1045 access denied and I tried to connect to mysql using -u username but I also got the access denied message. my php is working coz I run test.php it shows me all the the info. I have done this before on windows xp and eveythings wa perfectly fine. is there something i should do because I am running under server 2003? I am scratching my head.
View Replies !
Installing Php 4.3.8 Onto Windows Server 2003 With IIS 6 & Multiple Websites Nightmare
I have various small html websites on my windows server 2003 pc, these function quite happily from directories under D:websites via ports 81, 8081, 8091, 8082 and of course there is the dafault web site on port 80. I have installed MySQL 5.0.0 and php 4.3.8, but i can't get them to work for another website on port 8090. If I use the command line and go to c:/php and run php -i, I can see the test_info file information, including the html. If I try to run it with http://80.177.100.48/test_info.php I get 'CGI error - The specified CGI application misbehaved by not returning a complete set of headers' When I try to run it via http://80.177.100.48:8090/test_info.php I get a page not found 404 error. That pc's name is 'webserver', and is connected to the internet via an internal ADSL card and networked to my main pc called 'whatever'. On 'whatever' I have a test installation of phpBB2 set up on http://80.177.100.48:9999/phpBB2/ which works fine and is quite happily routed via port 9999 through 'webserver' to the 'whatever' root directory under windows XP pro. When installing and testing is finished I would like to have this running on the 'webserver' pc.
View Replies !
LDAP For Windows Server?
I'm wondering if anyone has any clue where to get an ldap server for windows? I'm trying to avoid installing the resource hog Active Directory on my server with limited resources(diskspace/memory). Perhaps that anyone ever compiled sucessfully the OpenLDAP, an opensource distribution.
View Replies !
Active Directory / Exchange / Active Directory.
I'm creating an Intranet module for a client (Forum, files upload...etc...etc). This client already has a huge server running on WIN2000 + IIS 4 + Exchange + Microsoft Active directory + proxy and finally PHP 4.03 + MySql. Problem #1 : All passwords are changed every weeks, so I want to be able to import users/pass from Microsoft exchange .... Does anyone have an idea to do such thing with PHP ? Problem #2: I would like that the user logged from the firm's network do not have to log. again when connecting the module. So, is it possible to do such thing ?
View Replies !
IIS Vs Apache On Windows 2003
I would like to request more information for the installation and configuration of Apache in windows 2003 and I would like to know which is better IIS or apache in Windows 2003 Server
View Replies !
Forking PHP On Windows 2003.
We are attempting to fork a php script into a background php script and have the first scrip continue to completion. Is this even possible in the windows version of php? We have used the many code snippets floating around on the Internet claiming to fork on Windows, yet we never get it to work properly, sometimes ending up with hunderds of dead php.exe processes on the machine. Our environment is: Windows 2k3 server PHP 4.3.6 (cgi-fcgi) (built: Apr 14 2004 17:21:37) If there is any other info needed to determine the problem I'll gladly reply with it.
View Replies !
Installing On Windows 2003
I installed PHP, MySQL and Apache as normal as possible. However, when I go to check the install with phpinfo, it says I am forbidden to view the file. Also when I try to load the module in Apache it say's I can't find it.
View Replies !
Php Service On Windows 2003 IIS6
this is the setup: i have 2 computers at home. one of them has a registered domain name, and is acting as a web server (runs under windows 2003 iis6). my second machine has apache configured with php, perl, and mysql installed. i wanted to make my 2nd machine accessible from the internet, so i have created a virtual directory on my 1st machine, pointing to my htdocs directory on the 2nd machine. when i try to access a .html or .txt document (on my 2nd machine) through my 1st machine everything works. but when im trying to access a .php file, i get a 404 error. why does this happen? can anyone please help me? p.s. an example of urls are as follows: 1st machine -> http://www.machine1.com 2nd machine -> http://www.machine1.com/machine2 (machine2 being a virtual directory on the 1st one, pointing to htdocs on the 2nd)
View Replies !
Session Problem - IIS Windows 2003 & PHP 5
I am having trouble runnign sessions in php on windows and IIS 6. I have edited the php.ini file with a path to "c:program filesphpsessions" and gave full access to everyone on this. If I look in the folder it DOES actually store files, but still be sessions in PHP wont work. They work fine on another server with Apache et..
View Replies !
PHP5 And Access 2003
I can't seem to get my page to insert values into a table. I seem to connect to the database, and if I manually edit the tables, I can see the data on the webpage. No point going on with the language unless I can insert into a table!
View Replies !
PHP And Active Directory
Via a PHP script (running on a LAMP configuration - PHP with LDAP support), I run queries on the LDAP server of our office (users and arguments). Now, I want to put the result of this query (user information) in a Windows 2003 AD. I use PHP-ldap functions to connect with the domain controller: making connection is no problem, but binding (authenticated, I even tried Domain Administrator credentials) doesn't work... Does anyone has experience with this matter (PHP and AD connection/communucation)?
View Replies !
PHP And Active Directory 2K3
Note: I'm cross-posting the below to nyphp.org as well. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~ I've been struggling with an issue for a few months. I am attempting to search Active Directory 2003 via PHP, but am running into an issue searching from the base DN (i.e. 'cn=company,cn=com'). This seems to be somewhat of a known issue with AD2K3. A search at this level always returns: Warning: ldap_search() [function.ldap-search]: Search: Partial results and referral received If I change my base DN to 'ou=someOU,dc=company,dc=com', searches work properly. I was curious to see what would happen at the command line, so I used openldap's ldapsearch function against AD and sure enough I got a bunch of results that were truncated with ldap_result: Can't contact LDAP server Of note: I have a base php class that sets the following options whenever a bind is created (seems to be necessary for searching AD2K3 at all): ldap_set_option($this->_ldap, LDAP_OPT_REFERRALS, 0); ldap_set_option($this->_ldap, LDAP_OPT_PROTOCOL_VERSION, 3); Anyone have any feedback about how to search the base dn of AD2K3?
View Replies !
Active Directory And PHP
Is there anyway to work PHP with Active directory? My intention consist in developing an application that authenticates automatically PHP on W2k3 server.
View Replies !
Active Directory In PHP
I am attempting to create an internal application for my company and I am not part of the programming department but I do happen to be pretty decent at PHP. Anyways my current delima is that they use Windows 2000 Server Active Directory for User Authintication and attempting to re-enter all of this information in to a MySQL database would be a huge undertaking and something I just dont want to do. is there a way to get PHP to communicate with the Server to authenticate people useing Active Directory. I have searched the forums and I did not find anything regarding this already of course I could of been searching for the wrong criteria.
View Replies !
Active Directory
I'm trying to get it so visitors to our intranet site are able to log into the site with there normal login details. On a network using win2k3, active directory etc. Now my code at the moment seems to connect to AD but it fails when it trys to bind. Code:
View Replies !
Active Directory Authentication Via Php.
I'm in a bit of a pickle.. at the company where I recently started work, I discovered that the knowledge base we use sucks, and sucks bad (oh Lotus Notes, how I loathe thee, let me count the ways) So for kicks and giggles, I found a nice "personal notebook" solution on the net called: http://www.tiddlywiki.com/ When this had ballooned into a big, nice knowledge base, I discovered that there's a server-side version of it called cctiddly : So as a test I found a free apache/php/sql solution: - copied the cctiddly into it, and the thing worked! As you can see, up until now, no real programming has been undertaken by me, at this point, I've just been at most playing around with installing plugins into my tiddlywiki. Of course, also, now I'm faced with the ultimate question... what's the best way to authenticate people who want access to the wiki? I've researched a bit, and discovered that you can enable LDAP access via php, so theoretically you can authenticate people through AD... which is excellent! People can just use their usual username and password, no need to remember yet another user/pass, and no need for admin to have to control yet another admin control thingum. So I've been testing this out, browsing through information, and as a test I created this: ------ echo "<h3>LDAP query test #1</h3>"; echo "Connecting ..."; $ldap_host = "localhost"; $ldap_user = "user@domain.is"; $ldap_pass = "password"; $connect = ldap_connect($ldap_host) or die ("No Connection to LDAP server"); // must be a valid LDAP server! echo "connect result is " . $connect . "<br />"; if (ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) { echo "Using LDAPv3 <br />"; } else { echo "Failed to set protocol version to 3 <br />"; } if ($connect) { echo "Binding to server..."; $bind=ldap_bind($connect, $ldap_user, $ldap_pass); echo "Bind result is " . $bind . "<br />"; } ---- - Now this works.. if I remove the $ldap_pass in the "$bind=ldap_bind($connect, $ldap_user, $ldap_pass); " line, because then I'm connecting anonymously to the LDAP server... But when I try to authenticate to the server with the password I get this error: "Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Strong(er) authentication required in C:Program Filesxampphtdocs wikiadtest.php on line 21" - which made me go, whu? Now I can't change the settings on the domain controller, as I'm not the sysadmin.. so I need to somehow create a stronger authentication to the server.. now how the hell do I do that? I can't install an SSL certificate, because there isn't one on the server, is there some way for me to make the password meet the bare minimum requirements for a stronger authentication without having to use SSL? An administratoir I know recommended to try to figure out how to use either NTLM or KERBEROS... which is at least perhaps something.
View Replies !
Active Directory Token
My environment is setup like this: Windows Server 2003 Active Directory 2003 IIS 6.0 PHP 5.1.6 When a user tries to hit my system they are prompted for an Active Directory username / password combination. If their information is correct they get to the application. I need to modify the application code to check if the users password is about to expire. IIS can be configured to pass a token to the application. How would I use PHP to read the contents of this token so I can query AD?
View Replies !
Authentification On Active Directory
I want to use the users of our active directory in the intranet for a portal page. i dont know how to authenticate? $server = "xxx-xx.de.xx.com"; $connectid = @ldap_connect($server); is ok. $binding = @ldap_bind($connectid) or die("Error"); echo "ok";
View Replies !
How Can I Connect From Php To Active Directory?
i already have a CMS that has its own user table in MySQL. A customer wants me to use their own Active Directory user list in order to login to the php system. So, now i have to connect the app to the Active Directory. 1) What are the neccesary steps? 2) How can i connect from php to active directory in order to check user/password consistency?
View Replies !
Controlling Active Directory?
I need to make a php script cable of creating/editing users in windows active directory. To make it even harder php is installed as a module on Apache running on windows, same computer that runs MS exchange and thus needs active directory to manage all email accounts. Why? Because I could not find anything open source for windows to do what MS exchange does, and I am not talking about all of that calendar and contacts staff, what I need are simple IMAP and POP3, is it so hard to ask? Well to sum it up I need either help with php and a point to the right direction to manage active directory, or a good reliable open source email server that would run on windows XP+ ( I would not use 2003 server if I can find that email server ) and be flexible enough to be controlled from PHP.
View Replies !
PHP And LDAP On Windows
Anyone have recommendations as to the easiest LDAP libraries to install on Windows for PHP? Building them from source on Windows is not an option and we can't locate anything pre-built from UMich or OpenLDAP - someone suggested the Novell and Mozilla SDKs but I have no idea where to put the DLLs .. PHP 5.0.4 under Windows XP
View Replies !
Creating Active Directory User
does anyone already tried to create a user into active directory through php_ldap ? i tried something like this but still don't work :-/ $adduserAD["cn"][0] = "phpldapuser"; $adduserAD["samaccountname"][0] = "guguseli"; $adduserAD["objectclass"][0] = "top"; $adduserAD["objectclass"][1] = "person"; $adduserAD["objectclass"][2] = "organizationalPerson"; $adduserAD["givenname"][0] = "thomas"; $adduserAD["name"][0] = "tester"; $adduserAD["sn"][0] = "btester"; $adduserAD["description"][0] = "TEST-Account ldap"; $adduserAD["title"][0] = "Programm Manager"; ldap_add($ad, "ou=test, dc=my,dc=domain", $adduserAD) or die("error!");
View Replies !
Creating Active Directory Accounts
I need to add a feature to a php form that allows you to create Active Directory accounts (from the form). I read around that you needed something called ldap to do something like this, is that true.
View Replies !
Windows Binary With LDAP
I'm using a PHP-based CMS and I want to use LDAP to hook in an active directory (WAMP setup). But LDAP isn't turned on in the default binary for Windows. I'm in the process of trying to compile it but I'm not optimistic as far as getting every little detail right. Is there no PHP precompiled to work with Active Directory? (I saw the snapshot PHP seems to be but it's not supposed to be for production, right?) Any advice?
View Replies !
PHP And Server 2003
I am using this script: <? $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; mail( "sales@barcoderesale.com", "Feedback Form Results", $message, "From: $email" ); header( "Location: http://www.barcoderesale.com/thankyou.html" ); ?> I was using this on 2000Pro and it worked fine. I then put this same one on Server 2003 and the thankyou.html comes up after submitting but no email is sent. I am using this server only as a web server.
View Replies !
LDAP Problem With Windows - Module?
I am attempting to use LDAP to authenticate. I happily dropped in my functions and viola! -NO LDAP on the machine! So I researched it, and come to find out LDAP was not enabled when PHP was compiled on our machine at work. So I began looking for a module that I could install to allow for LDAP support. And after about an hour of searching, I have figured that there is no module for LDAP suuport for PHP. Of course this is an assumption, but I can't find anything. Does anyone know what I can do (short of uninstalling php and reinstalling it) to get LDAP support for a windows machine?
View Replies !
Ldap_bind With Active Directory Working With Invalid Passwords
I have been trying to find an answer to this for some time now and cannot find anything on my own. I am trying to set up Active Directory authentication for some applications I am developing. I got the setup to initially work, but notice that it will work if I use an invalid password or even a blank password. I am not sure what I need to change in my code (listed below) $ldaprdn = $_POST["username"]; $ldappass = $_POST["password"]; $host = "ad1.mysite.edu"; $basedn = "DC=ad1,DC=mysite,DC=edu"; $ds = ldap_connect ("ldap://" . $host); ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); if ($ds) { $r = ldap_bind($ds, $user . "@mysite.edu", $pass); if ($r) { session_start(); ldap_close($ds); $_SESSION["username"] = $ldaprdn; $_SESSION["login"] = true; header ("Location: options.php"); } else { ldap_close($ds); header ("Location: index.php"); } } If it authenitcates, it should go to the options.php page. I can put a check to see if the password given is null or blank, but that doesn't solve the binding with an invalid password. The one major thing I don't understand with the script are the DC= and what they do, and maybe its something in there that is the issue.
View Replies !
|