Code

Added logging to addons
[gosa.git] / plugins / addons / ldapmanager / class_exportxls.inc
index ae27875db37ad070f01d5397be9291c71403eec9..6a3302a8175cc1baab82eef13c74de52a183390c 100644 (file)
@@ -12,6 +12,7 @@ class xlsexport extends plugin
   var $attributes= array();
   var $objectclasses= array();
   var $ui;
+  var $view_logged = FALSE;
 
   function xlsexport ($config, $dn= NULL)
   {
@@ -26,12 +27,20 @@ class xlsexport extends plugin
        /* Call parent execute */
        plugin::execute();
 
+    /* Log view */
+    if(!$this->view_logged){
+      $this->view_logged = TRUE;
+      @log::log("view","all/".get_class($this),$this->dn);
+    }
+
     /* Set government mode */
     $smarty= get_smarty();
 
     $smarty->assign("type",FALSE);
     $smarty->assign("depselectivbb","");
     
+    if(!isset($_POST['selfull'])) $_POST['selfull'] = "Somehow not posted";
+
     /* Check permissions for export */
     // fill in old vars in the Export form
     if((isset($_POST['single']))&&(isset($_POST['sfrmgetsingle']))){
@@ -58,7 +67,7 @@ class xlsexport extends plugin
 
     // Set values for optionlist in form
     $bases      = array();
-    $acl_bases  = $this->ui->get_module_departments("ldapmanager");
+    $acl_bases  = $this->ui->get_module_departments("all");
     foreach($this->config->idepartments as $base_dn => $name){
       if(in_array_ics($base_dn,$acl_bases)){
         $bases[$base_dn] = $name;
@@ -93,10 +102,10 @@ class xlsexport extends plugin
     /* check alcs for given dn */
     $acls ="";
     if(isset($dn)){
-      $acls = $this->ui->get_permissions($dn,"ldapmanager/xlsexport");
+      $acls = $this->ui->get_permissions($dn,"all/all");
     }
  
-    if((!preg_match("/r/",$acls)) && isset($dn)){
+    if(!preg_match("/r/",$acls)){
 
       /* Show error msg */      
       print_red(sprintf(_("You are not allowed to export the given ldap entry (%s)"),@LDAP::fix($dn)));
@@ -125,22 +134,6 @@ class xlsexport extends plugin
     return ($smarty->fetch (get_template_path('contentexportxls.tpl', TRUE)));
   }
 
-  /* Return plugin informations for acl handling
-     #FIXME You can only read attributes within this report plugin */
-  function plInfo()
-  {
-    return (array(
-        "plShortName"   => _("Export XLS"),
-        "plDescription" => _("Export XLS"),
-        "plSelfModify"  => FALSE,
-        "plDepends"     => array(),
-        "plPriority"    => 2,
-        "plSection"     => array("addon"),
-        "plCategory"    => array("ldapmanager"),
-
-        "plProvidedAcls" => array()
-        ));
-  }
 }