Code

Updated workstation - Startup
[gosa.git] / plugins / admin / systems / class_goNtpServer.inc
index eaa885a7b6a0de6534d477c4e01f4bf239b727d9..5a4f40f8240d39131c15534c873e6e37114f40ca 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 
-require_once("class_goService.inc");
-
 class goNtpServer extends goService{
 
   var $cli_summary      = "This pluign is used within the ServerService Pluign \nand indicates that this server supports NTP service.";
@@ -22,11 +20,12 @@ class goNtpServer extends goService{
   var $goNtpServerStatus= "";
   var $acl;
   var $cn               = "";
+  var $view_logged  =FALSE;
 
-  function goNtpServer($config,$dn)
+  function goNtpServer(&$config,$dn)
   {
-    plugin::plugin($config,$dn);
-    $this->DisplayName = _("Time service");
+    goService::goService($config,$dn);
+    $this->DisplayName = _("Time service (NTP)");
 
     /* Load arrays */
     $tmp = array();
@@ -43,6 +42,11 @@ class goNtpServer extends goService{
   { 
     $smarty = get_smarty(); 
 
+    if($this->is_account && !$this->view_logged){
+      $this->view_logged = TRUE;
+      new log("view","server/".get_class($this),$this->dn);
+    }
+
     /* Here we add a new entry  */
     if(isset($_POST['NewNTPAdd']) && $_POST['NewNTPExport'] != "" && $this->acl_is_writeable("goTimeSource")) {
       $this->goTimeSource[$_POST['NewNTPExport']]= $_POST['NewNTPExport'];
@@ -67,7 +71,7 @@ class goNtpServer extends goService{
   function getListEntry()
   {
     $fields               = goService::getListEntry();
-    $fields['Message']    = _("NTP service");
+    $fields['Message']    = _("Time service (NTP)");
     $fields['AllowEdit']  = true;
     return($fields);
   }
@@ -93,8 +97,10 @@ class goNtpServer extends goService{
     show_ldap_error($ldap->get_error(), sprintf(_("Saving server services/goNtpServer with dn '%s' failed."),$this->dn));
     if($this->initially_was_account){
       $this->handle_post_events("modify");
+      new log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }else{
       $this->handle_post_events("add");
+      new log("create","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }
   }
 
@@ -103,11 +109,11 @@ class goNtpServer extends goService{
   function plInfo()
   {
     return (array(
-          "plShortName"   => _("NTP"),
-          "plDescription" => _("NTP service"),
+          "plShortName"   => _("Time service"),
+          "plDescription" => _("Time service - NTP")." ("._("Services").")",
           "plSelfModify"  => FALSE,
           "plDepends"     => array(),
-          "plPriority"    => 0,
+          "plPriority"    => 91,
           "plSection"     => array("administration"),
           "plCategory"    => array("server"),
 
@@ -116,6 +122,22 @@ class goNtpServer extends goService{
           ));
   }
 
+  
+  function PrepareForCopyPaste($source)
+  {
+    plugin::PrepareForCopyPaste($source);
+
+    /* Load arrays */
+    $tmp = array();
+    if (isset($source['goTimeSource'])){
+      for ($i= 0; $i<$source['goTimeSource']['count']; $i++){
+        $tmp[$source['goTimeSource'][$i]]= $source['goTimeSource'][$i];
+      }
+    }
+    $this->goTimeSource= $tmp;
+
+
+  }
 
   function check(){ return array();}