Code

Added conflict with kolab
[gosa.git] / plugins / admin / systems / class_goImapServer.inc
index 1ae6556b9ebff97b2895ef02a8f850cdd6d1be22..c1571e64fd349168ba9929d1ac93474f31066fe4 100644 (file)
@@ -10,7 +10,6 @@ class goImapServer extends plugin{
   var $objectclasses    = array("goImapServer");
   
   /* This class can't be assigned twice so it conflicts with itsself */
-  var $conflicts        = array("goImapServer");
 
   var $DisplayName      = "";
   var $dn               = NULL;
@@ -20,7 +19,7 @@ class goImapServer extends plugin{
                                 "goImapSieveServer","goImapSievePort",
                                 "cyrusImap","cyrusImapSSL","cyrusPop3","cyrusPop3SSL");
 
-  var $cn;
+  var $cn                   = "";
 
   var $goImapName           = "";
   var $goImapConnect        = "";
@@ -40,7 +39,8 @@ class goImapServer extends plugin{
 
   var $acl; 
 
-  var $Actions              = array();
+  var $Actions              = array();  
+  var $conflicts            = array("goImapServer","kolab");
  
   function goImapServer($config,$dn)
   {
@@ -217,6 +217,16 @@ class goImapServer extends plugin{
       foreach ($add_attrs as $name => $value){
         $command= preg_replace("/%$name/", $value, $command);
       }
+
+      /* If there are still some %.. in our command, try to fill these with some other class vars */
+      if(preg_match("/%/",$command)){
+        $attrs = get_object_vars($this);
+        foreach($attrs as $name => $value){
+          if(!is_string($value)) continue;
+          $command= preg_replace("/%$name/", $value, $command);
+        }
+      }
+
       if (check_command($command)){
         @DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__,
             $command, "Execute");