Code

Added conflict with kolab
[gosa.git] / plugins / admin / systems / class_goNtpServer.inc
index 3f423dea7a7b84b892ccd4581c34957f7b7252f5..dbfc1401dd323b3fb2673d3cf160651526484451 100644 (file)
@@ -19,7 +19,7 @@ class goNtpServer extends plugin{
   var $goTimeSource     = array();
   var $goNtpServerStatus= "";
   var $acl;
-
+  var $cn               = "";
 
   function goNtpServer($config,$dn)
   {
@@ -90,6 +90,7 @@ class goNtpServer extends plugin{
       $ldap->add($this->attrs);
     }
     show_ldap_error($ldap->get_error());
+    $this->handle_post_events("remove");
   }
 
 
@@ -111,6 +112,11 @@ class goNtpServer extends plugin{
       $ldap->add($this->attrs);
     }
     show_ldap_error($ldap->get_error());
+    if($this->initially_was_account){
+      $this->handle_post_events("modify");
+    }else{
+      $this->handle_post_events("add");
+    }
   }
 
 
@@ -156,6 +162,16 @@ class goNtpServer 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");