Code

Execute parents execute() method child classes of plugin
[gosa.git] / gosa-plugins / goto / addons / goto / class_gotoLogView.inc
index 4193a586c6f686979cd5a03ac5babc4ebede683b..12937512cab55acd559ab13410dc3a005e42788a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class goto_log_view extends plugin
+class gotoLogView extends plugin
 {
   
   var $mac;
@@ -53,7 +53,7 @@ class goto_log_view extends plugin
     /* Query for log files
      */
     $res = $this->o_queue->get_log_info_for_mac($this->mac);
-    if($this->o_queue->is_error()){
+    if($this->o_queue->is_configured() && $this->o_queue->is_error()){
       msg_dialog::display(_("Error"), $this->o_queue->get_error(), ERROR_DIALOG);
     }
 
@@ -65,11 +65,14 @@ class goto_log_view extends plugin
       $this->selected_date = key($res[$this->mac]);
       $this->logs = $res;
     }
+
   }
 
 
   function execute()
   {
+    plugin::execute();
+
     $smarty = get_smarty();
     $smarty->assign("logs",$this->logs);   
     $smarty->assign("logs_available", isset($this->logs[$this->mac]));
@@ -161,6 +164,7 @@ class goto_log_view extends plugin
       $divlist->AddEntry($entry);
     }
 
+    $smarty->assign("ACL",preg_match("/r/",$this->getacl("")));
     $smarty->assign("divlist",$divlist->DrawList());
     return($smarty->fetch(get_template_path('log_view.tpl', TRUE,dirname(__FILE__))));
   }
@@ -169,7 +173,7 @@ class goto_log_view extends plugin
   function get_log($mac,$date,$file)
   {
     $res = $this->o_queue->get_log_file($mac,$date,$file);
-    if($this->o_queue->is_error()){
+    if($this->o_queue->is_configured() && $this->o_queue->is_error()){
       msg_dialog::display(_("Error"), $this->o_queue->get_error(), ERROR_DIALOG);
     }
     $res = nl2br(htmlentities($res));
@@ -191,6 +195,23 @@ class goto_log_view extends plugin
       $this->sort_by = $_GET['sort_by'];
     }
   }
+
+
+  /* Return plugin informations for acl handling */
+  static function plInfo()
+  {
+    return (array(
+          "plShortName"   => _("Log view"),
+          "plDescription" => _("GOto log view"),
+          "plSelfModify"  => FALSE,
+          "plDepends"     => array(),
+          "plPriority"    => 30,
+          "plSection"     => array("administration"),
+          "plCategory"    => array("workstation","server"),
+
+          "plProvidedAcls"=> array()
+            ));
+  }
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>