Code

Updated listing of FAI classes
[gosa.git] / gosa-plugins / goto / admin / systems / goto / class_terminalInfo.inc
index 314b5fe24ec417df6f18e4b2b66cc3fa10e32ee4..1736e2aa6e7edc2f05cce87f756b6d08ef4b08c4 100644 (file)
@@ -2,11 +2,6 @@
 
 class terminfo extends plugin
 {
-  /* CLI vars */
-  var $cli_summary= "Retrieve informations about terminals";
-  var $cli_description= "Some longer text\nfor help";
-  var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
-
   /* Generic terminal attributes */
   var $ghCpuType= "-";
   var $ghMemSize= "-";
@@ -69,21 +64,22 @@ class terminfo extends plugin
 
     /* Do we represent a valid terminal? */
     if (!$this->is_account && $this->parent === NULL){
-      echo "<img alt=\"\" src=\"images/stop.png\" align=middle>&nbsp;<b>".
-        _("This 'dn' has no terminal features.")."</b>";
-      return;
+      return("<img alt=\"\" src=\"images/small-error.png\" align=middle>&nbsp;<b>".
+        msgPool::noValidExtension(_("terminal"))."</b>");
     }
 
     $smarty= get_smarty();
     $display= "";
-    if(!is_callable("snmpget")){
-      print_red(_("There is no php snmp module installed, can't gather any informations."));
+    $smarty->assign("ACL",TRUE);
+    if(!preg_match("/r/",$this->getacl(""))){
+      $smarty->assign("ACL",FALSE);
+    }elseif(!is_callable("snmpget")){
 
       $smarty->assign("load", progressbar(0,100,15,true));
       $smarty->assign("mem", progressbar(0,100,15,true));
       $smarty->assign("swap", progressbar(0,100,15,true));
       foreach(array("uptime", "sshd", "X", "saned", "artsd", "cupsd","status","ghNetNic", "ghIdeDev", "ghScsiDev","FloppyDevice", "CdromDevice","active") as $val){
-        $smarty->assign("$val", "<i>"._("unknown status")."</i>");
+        $smarty->assign("$val", "<i>"._("unknown status, SNMP support missing")."</i>");
       }
 
 
@@ -97,7 +93,6 @@ class terminfo extends plugin
       } else {
 
         /* Get template object */
-        $smarty->assign("staticAddress", "");
 
         /* Prevent undefined variable .... */ 
         $smarty->assign("load", progressbar(0,100,15,true));
@@ -105,10 +100,7 @@ class terminfo extends plugin
         $smarty->assign("swap", progressbar(0,100,15,true));
 
         /* Check if terminal is online */
-        $query= "fping -q -r 1 -t 500 ".$this->cn;
-        exec ($query, $dummy, $retval);
-
-        if ($retval == 0){
+        if (gosaSupportDaemon::ping($this->macAddress)){
           $smarty->assign("status", _("online"));
           $smarty->assign("active", "true");
 
@@ -117,7 +109,7 @@ class terminfo extends plugin
 
           /* Use 'goto' as snmp community or the configured value from the config */
           $community= 'goto';
-          $str = search_config($this->config->data['TABS'],"terminfo","SNMPCOMMUNITY");
+         $str= $this->config->search("terminfo", "SNMPCOMMUNITY", array('tabs'));
           if(!empty($str)){
             $community = $str;
           }
@@ -249,6 +241,21 @@ class terminfo extends plugin
   {
   }
 
+
+  /* Return plugin informations for acl handling */
+  static function plInfo()
+  {
+    return (array(
+          "plShortName"   => _("System info"),
+          "plDescription" => _("System informations"),
+          "plSelfModify"  => FALSE,
+          "plDepends"     => array(),
+          "plPriority"    => 33,
+          "plSection"     => array("administration"),
+          "plCategory"    => array("workstation","server","terminal"),
+          "plProvidedAcls"=> array()
+            ));
+  }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: