LDAPAuthPHP - PHP的LDAP认证


Apache
跨平台
PHP

软件简介

LDAPAuthPHP 用来在 PHP 程序中执行 LDAP 身份验证。

示例代码:

session_name(‘MYAPP’);
session_start();
if (!isset($_SESSION[“user”])) {
include(“LdapAuth.inc.php”);
$ldap=new LdapAuth();
$ldap->setSessionAttr(“user”,”uid”);
$ldap->setSessionName(“MYAPP”);
$ldap->setRedirectPage($pageURL); //page where we get redirected after login
(in this case self)
include(“LdapStandalonePageProtector.inc.php”);
}
else {
echo “Logged In As: “.$_SESSION[“user”].”“;
//paste here the old page code (or write the new page to protect)
}