|
List Info
Thread: Re: Maia authenticating against Exchange 2007?
|
|
| Re: Maia authenticating against
Exchange 2007? |
  United States |
2008-02-26 09:36:44 |
|
I use the LDAP login method and have modified it to work
better with AD. Basically I use the username/password from the person
attempting to login to bind to the AD and do a query, if all that works then
the user is valid in AD and therefore valid to login. Below is my modifications
to the auth_ldap function. The AD query I set in config.php is $auth_ldap_query
= "( userprincipalname=%25%25USER%25%25 DOMAIN.NAME">userprincipalname=%%USER%% DOMAIN.NAME)";
Obviously change all DOMAIN.NAME to your domain name.
/*
* auth_ldap(): Authenticate against an LDAP server.
* Code contributed by David Morton <osprey.net">mortonda osprey.net>.
* Modified by: Tad DeVries <gmail.com">taddevries gmail.com> on 01/28/2008
*/
function auth_ldap($user, $pass)
{
if ($user == "") { // Don't bother
authenticating an empty username
return false; // ticket #335
}
global $dbh;
global $lang;
global $auth_ldap_server;
global $auth_ldap_bind_dn;
global $auth_ldap_base_dn;
global $auth_ldap_password;
global $auth_ldap_query;
global $auth_ldap_attribute;
global $auth_ldap_version;
global $auth_ldap_opt_referrals;
$ldap_conn = ldap_connect($auth_ldap_server)
or
die($lang['error_ldap_connect']);
if(isset($auth_ldap_version)) {
ldap_set_option($ldap_conn,
LDAP_OPT_PROTOCOL_VERSION, $auth_ldap_version);
}
if(isset($auth_ldap_opt_referrals)) {
ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS,
$auth_ldap_opt_referrals);
}
if( ldap_bind($ldap_conn,
$user." DOMAIN.NAME", $pass) )
{
//at this point the user is already verified
//but I'm paranoid so I do a query to make
sure
$filter = $auth_ldap_query;
$filter = str_replace("%%USER%%",
$user, $filter);
$sr = ldap_search($ldap_conn,
$auth_ldap_base_dn, $filter,
array($auth_ldap_attribute,
"dn"));
if( ldap_count_entries( $ldap_conn, $sr ) ==
1 )
{ // found user
$entries = ldap_get_entries( $ldap_conn,
$sr );
$userdn =
$entries["0"]["dn"];
$routingaddress =
$entries["0"]["$auth_ldap_attribute"]["0"];
ldap_close( $ldap_conn );
return $routingaddress;
} else {
ldap_close( $ldap_conn );
return false;
}
} else { // could not bind, user/pass not valid
ldap_close($ldap_conn);
return false;
}
}
-----Original Message-----
From: maia-users-bounces renaissoft.com
[mailto:maia-users-bounces renaissoft.com] On Behalf Of Dirk Bonengel
Sent: Monday, February 25, 2008 22:41
To: maia-users renaissoft.com
Subject: [Maia-users] Maia authenticating against
Exchange 2007?
Hi, all,
I try to set up a Maia Mailguard box (more precise:
Maia's web
interface) to authenticate against a Server running M$
Exchange 2007.
There must have been changes here compared to Exchange
2003 as I can't get the 'exchange' method to work (or I do things fundamentally
wrong).
Anyone on the list having experience with this?
Thanks in advance
Dirk
_______________________________________________
Maia-users mailing list
Maia-users renaissoft.com">Maia-users renaissoft.com
http://www.renaissoft.com/mailman/listinfo/maia-users
|
[1]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|