Code

Updated logview to display the target object too.
[gosa.git] / include / class_CopyPasteHandler.inc
index c11849e2fffc857f8a0864a6ef65bb3b1f239f4b..1d6a1f04ac07b87f3308f9074ec63a0eea69e489 100644 (file)
@@ -18,9 +18,9 @@ class CopyPasteHandler {
 
 
   /* Create CP handler  */
-  function CopyPasteHandler($config)
+  function CopyPasteHandler(&$config)
   {
-    $this->config = $config;   
+    $this->config = &$config;  
     $this->current= NULL;
     $this->queue  = array();
     $this->setvar_array = array();
@@ -80,6 +80,19 @@ class CopyPasteHandler {
       unset($this->queue[$key]);
     }
 
+    /* Create patch if it doesn't exists */
+    if(!is_dir(LDAP_DUMP_PATH)){
+      @mkdir(LDAP_DUMP_PATH);
+    }    
+    
+    /* check if we are able to create a new file the given directory */
+    if(!is_writeable(LDAP_DUMP_PATH)){
+      print_red(sprintf(_("Could not cleanup copy & paste queue. We are not allowed to save ldap dump to '%s', please check permissions."),LDAP_DUMP_PATH));
+      new log("copy","all/all","copy & paste, event queue.",array(),
+          sprintf("Could not cleanup copy & paste queue. We are not allowed to save ldap dump to '%s', please check permissions.",LDAP_DUMP_PATH));
+      return(FALSE);
+    }
+
     /* Remove entries from hdd that are older than24 hours */
     $fp = opendir(LDAP_DUMP_PATH);
     while($file = readdir($fp)){