Code

Fixed Translation Strings.
[gosa.git] / plugins / admin / systems / class_goNtpServer.inc
index dbfc1401dd323b3fb2673d3cf160651526484451..f7a9ea42ea0f881685aab9fed452154794fdd9c3 100644 (file)
@@ -8,7 +8,7 @@ class goNtpServer extends plugin{
 
   /* This plugin only writes its objectClass */
   var $objectclasses    = array("goNtpServer");
-  var $attributes       = array("goTimeSource","goNtpServerStatus");
+  var $attributes       = array("goTimeSource");
   var $StatusFlag       = "goNtpServerStatus";
 
   /* This class can't be assigned twice so it conflicts with itsself */
@@ -64,6 +64,7 @@ class goNtpServer extends plugin{
 
   function getListEntry()
   {
+    $this->updateStatusState();
     $flag = $this->StatusFlag;
     $fields['Status']      = $this->$flag;
     $fields['Message']    = _("NTP service");
@@ -184,6 +185,26 @@ class goNtpServer extends plugin{
     }
   }
 
+
+  /* Get updates for status flag */
+  function updateStatusState()
+  {
+    if(empty($this->StatusFlag)) return;
+
+    $attrs = array();
+    $flag = $this->StatusFlag;
+    $ldap = $this->config->get_ldap_link();
+    $ldap->cd($this->cn);
+    $ldap->cat($this->dn,array($flag));
+    if($ldap->count()){
+      $attrs = $ldap->fetch();
+    }
+    if(isset($attrs[$flag][0])){
+      $this->$flag = $attrs[$flag][0];
+    }
+  }
+
+
   function check(){ return array();}
 
   function save_object(){;}