Hello,
This is my first post, and apologies if I posted in the incorrect forum.
I have developed an application for inter University communication, and as it stands currently, it is sitting unprotected on the network. There are a few 'remove/delete' features I want to enable, but am waiting until I get a login working.
I spoke with our IT department about authentication with Active Directory (so I don't have to maintain my own DB of user/passwords). After giving me a script in VB.net, they let me know I am on my own with the php stuff.
Here is what they have given me:
Code: Select all
For asp login pages, we supply the following:
strADsPath = "LDAP://domain"
Set oLDAP = GetObject("LDAP:")
Set oUser = oLDAP.OpenDSObject(strADsPath, strKey, strPassword, 1)
This is what I have thus far:
Code: Select all
<?php
$adServer = "LDAP://domain";
$ldapconn = ldap_connect($adServer)
or die("Could not connect to LDAP server.");
$ldaprdn = $adServer . "\\" . $_REQUEST['email'];
$ldapbind = ldap_bind($ldapconn, $ldaprdn, $_REQUEST['password']);
if ($ldapbind) {
$msg = "Successfully Authenticated";
} else {
$msg = "Invalid email address / password";
}
echo $msg;
?>
I would appreciate some guidance.
Thanks in advance.
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: