1
Ideas / Re: Suggestion for reminders
« on: August 03, 2012, 06:10:57 am »
+1
I agree: per-user reminder is better
I agree: per-user reminder is better
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
# Fengoffice notifications
*/1 * * * * www-data php /var/www/fengoffice/cron.php
function isValidPasswordLdap($user, $password, $config) {
// Connecting using the configuration:
require_once "Net/LDAP2.php";
$ldap = Net_LDAP2::connect($config);
// Testing for connection error
if (PEAR::isError($ldap)) {
return false;
}
$filter = Net_LDAP2_Filter::create($config['uid'], 'equals', $user);
$search = $ldap->search(null, $filter, null);
if (Net_LDAP2::isError($search)) {
return false;
}
if ($search->count() != 1) {
return false;
}
// User exists so we may rebind to authenticate the password
$entries = $search->entries();
$bind_result = $ldap->bind($entries[0]->dn(), $password);
if (PEAR::isError($bind_result)) {
return false;
}
return true;
} // isValidPassword