1. I believe so but need to know where to check services (location and name).
2. Yes
3. Yes
What's odd is I only lost access to the webpage after I enabled the AD integration. It appears that you lose the ability to login with a local username after the change.
Here is a snippet of the configuration files.
-config.php-
// LDAP settings
define('USE_LDAP', '1');
define('LDAP_HOST', 'walesdc.hoodview.fcu');
define('LDAP_PORT', '389');
define('LDAP_DN', 'DC=hoodview,DC=fcu');
define('LDAP_USER', '
efa@hoodview.fcu');
define('LDAP_PASS', 'hoodview');
define('LDAP_SITE', 'Wales');
-functions.php-
ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
function ldap_authenticate($USER,$PASS) {
$USER = strtolower ($USER);
if ($USER != "" && $PASS != "") {
$ds = ldap_connect (LDAP_HOST,LDAP_PORT) or die ("Could not connect to ".LDAP_HOST);
ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_bind ($ds, LDAP_USER, LDAP_PASS);
if (strpos ($USER, '@')){
# $r = ldap_search ($ds, LDAP_DN, "proxyaddresses=SMTP:$USER") or die ("Could not search");
$r = ldap_search ($ds, LDAP_DN, "mail=$USER") or die ("Could not search");
} else {
$r = ldap_search ($ds, LDAP_DN, "sAMAccountName=$USER") or die ("Could not search");
}
if ($r) {
$result = ldap_get_entries ($ds, $r) or die ("Could not get entries");
if ($result[0]) {
$USER = $result[0]['userprincipalname']['0'];
if (ldap_bind ($ds, $USER, "$PASS")) {
# if (isset ($result[0]['proxyaddresses'])) {
# foreach ($result[0]['proxyaddresses'] as $email) {
if (isset ($result[0]['mail'])) {
foreach ($result[0]['mail'] as $email) {
if (substr ($email, 0, 4) == "SMTP") {
$email = strtolower (substr ($email, 5));
break;
}
}
}
$sql = sprintf ("SELECT username from users where username = %s", quote_smart($email));
$sth = dbquery ($sql);
if (mysql_num_rows ($sth) == 0) {
$sql = sprintf ("REPLACE into users (username, fullname, type, password) VALUES (%s, %s,'U',NULL)", quote_smart($email), quote_smart($result[0]['cn'][0]));
$sth = dbquery ($sql);
}
return $email;