Code

Fixed Translation Strings.
[gosa.git] / plugins / admin / systems / class_goFaxServer.inc
index 55a76a56a2bef7bf54f17146d93e5b4b1fee0270..53e8ad3076cd137ffb72aac8e646cb5d0d84c3cf 100644 (file)
@@ -8,7 +8,7 @@ class goFaxServer extends plugin{
 
   /* This plugin only writes its objectClass */
   var $objectclasses    = array("goFaxServer");
-  var $attributes       = array("goFaxServerStatus","goFaxAdmin", "goFaxPassword");
+  var $attributes       = array("goFaxAdmin", "goFaxPassword");
   var $StatusFlag       = "goFaxServerStatus";
  
   /* This class can't be assigned twice so it conflicts with itsself */
@@ -21,7 +21,7 @@ class goFaxServer extends plugin{
   var $goFaxAdmin         = "";
   var $goFaxPassword      = "";
   var $goFaxServerStatus  = "";
-  var $cn;
+  var $cn                 = "";
  
   function goFaxServer($config,$dn)
   {
@@ -43,6 +43,7 @@ class goFaxServer extends plugin{
 
   function getListEntry()
   {
+    $this->updateStatusState();
     $flag = $this->StatusFlag;
     $fields['Status']      = $this->$flag;
     $fields['Message']    = _("FAX database configuration");
@@ -179,7 +180,24 @@ class goFaxServer 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];
+    }
+  }
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>