getRole() !== 0) { if (session_id()) session_destroy(); header('Location: ' . WEB_ROOT . 'error.html'); exit; } $db = Persistens::getInstance(DBDRIVER); if (count($_POST) > 0) { $config = array( (isset($_POST['enable']) && $_POST['enable'] == 'on') ? 1 : 0, $_POST['dns'], (isset($_POST['tls']) && $_POST['tls'] == 'on') ? 1 : 0, $_POST['base_dn'], $_POST['user_attr'] ); if (($res = $db->setLdapConfig($config)) === true) $pageView = "

LDAP configuration was successfully updated

"; else $pageView = "

$res

"; } else { $config = $db->getLdapConfig(); if (! is_array($config) && $config) { if (session_id()) session_destroy(); header('Location: ' . WEB_ROOT . 'error.html'); exit; } $enable = ($config['enable']) ? ' checked="checked"' : ''; $tls = ($config['tls']) ? ' checked="checked"' : ''; $dns = $config['dns']; $base_dn = $config['base_dn']; $user_attr = $config['user_attr']; $pageView = <<< __EOF
SettingCurrent
LDAP enabled
URL
Use TLS
Base DN
User ATTR

After enabling LDAP users will be authenticated by LDAP and when a user logs on for the first time an account will automatically be created using the username provided by LDAP. If the user account is removed from LDAP the account will be deactivated but remain in webcal until deleted by the admin user.

If your LDAP server is located here: ldap.foo.tld on either port 389 or 636 then URL is:
Without SSL (389): ldap://ldap.foo.tld
With SSL (636): ldaps://ldap.foo.tld
With TLS (389): ldap://ldap.foo.tld and check "Use TLS"
If your LDAP server is listen on 8389 then this port number must be added to the URL like ldap://ldap.foo.tld:8389

If your Bind DN is the following: uid=username,ou=people,dc=foo, dc=tld then "Base DN" and "User ATTR" has to look like this:
Base DN: ou=people,dc=foo,dc=tld
User ATTR: uid
If your Bind DN is the following: cn=username,dc=foo,dc=tld then "Base DN" and "User ATTR" has to look like this:
Base DN: dc=foo,dc=tld
User ATTR: cn

__EOF; } include TOP_FOLDER.'/include/header.inc.php'; include TOP_FOLDER.'/include/menu.inc.php'; print "
$pageView
"; include TOP_FOLDER.'/include/footer.inc.php'; ?>