Code

Fixed problem with moving groups that have a mail account.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 15 Nov 2006 04:01:51 +0000 (04:01 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 15 Nov 2006 04:01:51 +0000 (04:01 +0000)
"Mail address already in use"

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5112 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/groups/class_groupMail.inc

index fd9df5eec1534820afd8a6baed5194933db0faab..2dbc991a13d73e98002e7ec39863fa1b54e92d3f 100644 (file)
@@ -9,6 +9,7 @@ class mailgroup extends plugin
 
   var $uid                        = "";       // User id 
   var $cn                         = "";       // cn
+  var $orig_cn                    = "";       // cn
 
   var $method                     = "mailMethod"; // Used Mail method 
   var $mmethod                    = "";           // Contains the gosa.conf MAILMETHOD
@@ -47,6 +48,9 @@ class mailgroup extends plugin
   var $indexed_acl= array();
   var $indexed_user= array();
 
+  /* Copy & paste */
+  var $CopyPasteVars          = array("quotaUsage");
+
   /* attribute list for save action */
   var $attributes= array( "mail",   "gosaMailServer", "gosaMailQuota", "gosaMailMaxSize",
       "gosaMailAlternateAddress", "gosaMailForwardingAddress",
@@ -62,6 +66,9 @@ class mailgroup extends plugin
      */
     plugin::plugin($config, $dn, $parent);
 
+    /* Save initial cn */
+    $this->orig_cn = $this->cn;
+
     /* Set mailMethod to the one defined in gosa.conf 
      */
     if (isset($this->config->current['MAILMETHOD'])){
@@ -836,7 +843,7 @@ I: Only insider delivery */
     }
     $ldap->cd($this->config->current['BASE']);
     $ldap->search ("(&(!(objectClass=gosaUserTemplate))(objectClass=gosaMailAccount)(|(mail=".$this->mail.")(gosaMailAlternateAddress=".
-        $this->mail."))(!(uid=".$this->cn."))(!(cn=".$this->cn.")))");
+        $this->mail."))(!(uid=".$this->orig_cn."))(!(cn=".$this->orig_cn.")))");
     if ($ldap->count() != 0){
       $message[]= _("The primary address you've entered is already in use.");
     }