From: cajus Date: Wed, 25 Oct 2006 09:38:21 +0000 (+0000) Subject: Fixed problem with mail alternate addresses not beeing evaluated correctly in templates X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1c8d1abfb73eabb99e680ad97017bb8d77442616;p=gosa.git Fixed problem with mail alternate addresses not beeing evaluated correctly in templates git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4938 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/Changelog b/Changelog index 38deba0ad..27e138afb 100644 --- a/Changelog +++ b/Changelog @@ -19,6 +19,7 @@ GOsa2 changelog - Fixed a set of W3C problems - Fixed multiple savings in addressbook (Closes: #23) - Fixed shadow expire when using templates (Closes: #20) + - Made %uid, %sn, etc. available in templates using gosaMailAlternateAddress * gosa 2.5.4 - Included patch to choose the addressbook base diff --git a/plugins/personal/mail/class_mailAccount.inc b/plugins/personal/mail/class_mailAccount.inc index b288b1ec7..a99d89f09 100644 --- a/plugins/personal/mail/class_mailAccount.inc +++ b/plugins/personal/mail/class_mailAccount.inc @@ -373,7 +373,7 @@ class mailAccount extends plugin if ($valid && ($user= $this->addAlternate ($_POST['alternate_address'])) != ""){ $ui= get_userinfo(); - if ($user != $ui->username){ + if ($user != $ui->username && !$this->is_template){ print_red (_("The address you're trying to add is already used by user")." '$user'."); } } @@ -905,7 +905,7 @@ class mailAccount extends plugin /* Is this address already assigned in LDAP? */ $ldap->cd ($this->config->current['BASE']); - $ldap->search ("(&(objectClass=gosaMailAccount)(|(mail=$address)"."(gosaMailAlternateAddress=$address)))", array("uid")); + $ldap->search ("(&(!(objectClass=gosaUserTemplate))(objectClass=gosaMailAccount)(|(mail=$address)"."(gosaMailAlternateAddress=$address)))", array("uid")); if ($ldap->count() > 0){ $attrs= $ldap->fetch ();