Dan Freed sent me an e-mail with a list of links, books, and source code
from his LDAP presentation. Here it is, for everyone out there on the
MAD-SAGE list:
Links
<http://www.openldap.org>
<http://www.padl.com/Contents/OpenSourceSoftware.html>
<http://www.iplanet.com>
<http://www.mjwilcox.com/ldap/index.htm>
<http://devedge.netscape.com>
<http://www.sourceforge.net/projects/rolodap/>
mod_auth_ldap :
<http://www.muquit.com/muquit/software/mod_auth_ldap/mod_auth_ldap.html#req>
Books
Implementing LDAP - Mark Wilcox
Ldap: Programming Directory-Enabled Applications With Lightweight Directory
Access Protocol (MacMillan Technology Series) -- Tim Howes, Mark Smith
Understanding and Deploying Ldap Directory Services
<http://www.amazon.com/exec/obidos/ASIN/1578700701/qid=1029351726/sr=1-10/re
f=sr_1_10/102-0615106-7854553>-- Tim Howes
PHP SourceCode:
<?php
# Produce the form
if (! $HTTP_POST_VARS["submit"])
{
display_form ();
} else
{
auth_form_sub ($HTTP_POST_VARS);
}
function auth_form_sub ($postVars) {
# Connect to the LDAP server
$ldapID = @ldap_connect ("localhost");
if (!$ldapID) {
print ("<b>Authentication failure:</b> Unable to connect to LDAP
server.\n<p>\n");
return;
}
if (!@ldap_bind ($ldapID,
"uid=".$postVars["login"].",ou=users,o=company.net", $postVars["passwd"])) {
print ("<b>Authentication failure:</b> Failed to bind to LDAP
server.\n<p>\n");
display_form ();
return;
}
# At this point, we have an authenticated user.
print ("Authentication successful!\n<p>\n");
# Update this session's entry in the database
}
function display_form () {
////////////////////////////////////////////////////////////////
?>
<FORM action="logindemo.php" method="post">
Your LDAP login name:
<br>
<INPUT TYPE="text" NAME="login" SIZE=20 MAXLENGTH=19>
<p>
Your LDAP password:
<br>
<INPUT TYPE="password" NAME="passwd" SIZE=20 MAXLENGTH=19>
<p>
<INPUT TYPE="submit" NAME="submit" VALUE="LogIn">
<INPUT TYPE="reset" NAME="Start over">
</FORM>
<?php
}
?>
// Brian Ruppert
// brian@xxxxxxxxxxxx
|