Commit 1c4c93d0 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Fixes #4217 the reset password system should look for supannMailPerso if the...

Fixes #4217 the reset password system should look for supannMailPerso if the supann plugin is installed
parent 3252cf54
......@@ -419,11 +419,14 @@ class passwordRecovery {
/* Retrieve dn from the ldap */
$ldap = $this->config->get_ldap_link();
$objectClasses = array('gosaMailAccount');
if (class_available('personalInfo') && ($this->config->get_cfg_value('privateEmailPasswordRecovery', 'FALSE') == 'TRUE')) {
$filter = '(&(|(objectClass=gosaMailAccount)(objectClass=fdPersonalInfo))(uid='.$this->uid.'))';
} else {
$filter = '(&(objectClass=gosaMailAccount)(uid='.$this->uid.'))';
$objectClasses[] = 'fdPersonalInfo';
}
if (class_available('supannAccount') && ($this->config->get_cfg_value('supannPasswordRecovery', 'TRUE') == 'TRUE')) {
$objectClasses[] = 'supannPerson';
}
$filter = '(&(|(objectClass='.join(')(objectClass=', $objectClasses).'))(uid='.$this->uid.'))';
$ldap->cd($this->config->current['BASE']);
$ldap->search($filter, array('dn'));
......@@ -458,6 +461,9 @@ class passwordRecovery {
if (class_available('personalInfo') && ($this->config->get_cfg_value('privateEmailPasswordRecovery', 'FALSE') == 'TRUE')) {
$filter = '(|'.$filter.'(&(objectClass=fdPersonalInfo)(fdPrivateMail='.$this->email_address.')))';
}
if (class_available('supannAccount') && ($this->config->get_cfg_value('supannPasswordRecovery', 'TRUE') == 'TRUE')) {
$filter = '(|'.$filter.'(&(objectClass=supannPerson)(supannMailPerso='.$this->email_address.')))';
}
$uids = get_list( $filter, "",
$this->config->current['BASE'], array("uid"),
GL_SUBSEARCH | GL_NO_ACL_CHECK);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment