diff --git a/gosa-core/include/class_CopyPasteHandler.inc b/gosa-core/include/class_CopyPasteHandler.inc
index 4ceb83a1f76507f088b7a39adcbf07711acce1d8..d9e8948c23a60a748c8e5a76f05cadb9c514c8f4 100644 (file)
/* Create patch if it doesn't exists */
if(!is_dir(LDAP_DUMP_PATH)){
@mkdir(LDAP_DUMP_PATH);
+
+ /* Update folder permissions */
+ if(!@chmod(LDAP_DUMP_PATH,0700)){
+ $msg= sprintf(_("Copy and paste failed!")."<br><br>"._("Error").": <i>"._("Cannot set permission for '%s'")."</i>" ,LDAP_DUMP_PATH);
+ msg_dialog::display(_("Configuration error"), $msg, ERROR_DIALOG);
+ new log("copy","all/all","copy & paste, event queue.",array(), $msg);
+ return(FALSE);
+ }
}
-
- /* Update folder permissions */
- if(!@chmod(LDAP_DUMP_PATH,0700)){
- $msg= sprintf(_("Copy and paste failed!")."<br><br>"._("Error").": <i>"._("Cannot set permission for '%s'")."</i>" ,LDAP_DUMP_PATH);
- msg_dialog::display(_("Configuration error"), $msg, ERROR_DIALOG);
- new log("copy","all/all","copy & paste, event queue.",array(), $msg);
- return(FALSE);
- }
/* check if we are able to create a new file the given directory */
if(!is_writeable(LDAP_DUMP_PATH)){
- $msg= _("Copy and paste failed!")."<br><br>"._("Error").": <i>".msgPool::cannotWrite(LDAP_DUMP_PATH)."</i>";
+ $msg= _("Copy and paste failed!")."<br><br>"._("Error").": <i>".msgPool::cannotWriteFile(LDAP_DUMP_PATH)."</i>";
msg_dialog::display(_("Configuration error"), $msg, ERROR_DIALOG);
new log("copy","all/all","copy & paste, event queue.",array(), $msg);
return(FALSE);
return(FALSE);
}
- /* Update folder permissions */
- if(!@chmod(LDAP_DUMP_PATH,0700)){
- $msg= sprintf(_("Copy and paste failed!")."<br><br>"._("Error").": <i>"._("Cannot set permission for '%s'"),LDAP_DUMP_PATH);
- msg_dialog::display(_("Configuration error"), $msg, ERROR_DIALOG);
- new log("copy","all/all","copy & paste, event queue.",array(), $msg);
- return(FALSE);
- }
-
/* Create file handle */
$fp = @fopen($path."/".$filename,"w+");
if(!$fp){
return(FALSE);
}
+ /* Update folder permissions */
+ if(!@chmod($path."/".$filename,0700)){
+ $msg= sprintf(_("Copy and paste failed!")."<br><br>"._("Error").": <i>"._("Cannot set permission for '%s'"),LDAP_DUMP_PATH);
+ msg_dialog::display(_("Configuration error"), $msg, ERROR_DIALOG);
+ new log("copy","all/all","copy & paste, event queue.",array(), $msg);
+ return(FALSE);
+ }
+
$data = serialize($ldap->fetch());
fwrite($fp,$data,strlen($data));
fclose($fp);
/* Load next queue entry */
if(!count($msgs)){
- $this->lastdn = $this->current['object']->dn;
$this->current['object']->save();
+ $this->lastdn = $this->current['object']->dn;
$this->current = FALSE;
}else{
foreach( $msgs as $msg){