Code

Updated ldifExport for plugin ldapManager
[gosa.git] / gosa-plugins / ldapmanager / addons / ldapmanager / class_export.inc
index da15d57756dd7b8d8176d1935833ce6f87817ab0..ee057e6bc82ade87c2c39471389d7ba77beff74c 100644 (file)
@@ -15,6 +15,8 @@ class ldifexport extends plugin
 
     function ldifexport (&$config, $dn= NULL)
     {
+
+        $this->initTime = microtime(TRUE);
         /* Include config object */
         $this->config= &$config;
         $this->ui = get_userinfo();
@@ -23,6 +25,8 @@ class ldifexport extends plugin
         $this->baseSelector->setSubmitButton(false);
         $this->baseSelector->setHeight(300);
         $this->baseSelector->update(true);
+        stats::log('plugin', $class = get_class($this), $category = array($this->acl_category),  $action = 'open',
+                $amount = 1, $duration = (microtime(TRUE) - $this->initTime));
 
     }
 
@@ -49,19 +53,19 @@ class ldifexport extends plugin
 
         // Assign smarty values 
         $smarty= get_smarty();
-        $smarty->assign("usePrototype","true");
+
         $smarty->assign("single","");
         $smarty->assign("base", $this->baseSelector->render());
 
         // fill in old vars in the Export form
-        if(isset($_POST['single'])) $smarty->assign("single",$_POST['single']);
+        if(isset($_POST['single'])) $smarty->assign("single",set_post(get_post('single')));
 
         // Get the LDAP link, to generate the Export
         $ldap = $this->config->get_ldap_link();
         $dn = "";
         if(isset($_POST['sfrmgetsingle']))
         {  
-            $dn   = $_POST['single'];
+            $dn   = get_post('single');
             $scope= "base";
             $acls = $this->ui->get_permissions($dn,"ldapmanager/ldif");
             $name = "entryExport.ldif";
@@ -86,7 +90,7 @@ class ldifexport extends plugin
                         sprintf(_("You have no permission to export %s!"), bold(LDAP::fix($dn))),
                         ERROR_DIALOG);
             }else{
-                $data = $ldap->generateLdif(LDAP::fix($dn), 'objectClass=*',array(),$scope);
+                $data = $ldap->generateLdif(LDAP::fix($dn), 'objectClass=*',$scope);
                 send_binary_content($data,$name);
             }
         }