Code

Fixed problem with mail alternate addresses not beeing evaluated correctly in templates
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 25 Oct 2006 09:38:21 +0000 (09:38 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 25 Oct 2006 09:38:21 +0000 (09:38 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4938 594d385d-05f5-0310-b6e9-bd551577e9d8

Changelog
plugins/personal/mail/class_mailAccount.inc

index 38deba0ad5dce21c4046461580945e5be6c44a5a..27e138afb1d41b7d998fc3bd4137a1e2dd85a26e 100644 (file)
--- 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
index b288b1ec77394405691ae7efd507f657b637c0f9..a99d89f09abb70358aa0cd7c6c60e73c0f94135a 100644 (file)
@@ -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 ();