diff --git a/gosa-core/include/class_CopyPasteHandler.inc b/gosa-core/include/class_CopyPasteHandler.inc
index 610e6a70888662ae6f41a18a086a026abd9dba1a..a7fdee4589b49899b9d8cb8fc268caf8d0c430bd 100644 (file)
if(!is_dir(LDAP_DUMP_PATH)){
@mkdir(LDAP_DUMP_PATH);
}
+
+ /* Update folder permissions */
+ if(!@chmod(LDAP_DUMP_PATH,0700)){
+ $msg= sprintf(_("Cannot cleanup copy & paste queue: setting permissions for '%s' failed!"),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)){
return(FALSE);
}
+ /* Update folder permissions */
+ if(!@chmod(LDAP_DUMP_PATH,0700)){
+ $msg= sprintf(_("Cannot save LDAP dump: setting permissions for '%s' failed!"),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(unserialize($data));
}else{
- print_red(sprintf(_("Could not load dumped file '%s', from hard disk drive."),$filename));
- new log("copy","all/all",$dn,array(),
- sprintf(sprintf("Could not load dumped file '%s', from hard disk drive.",$filename)));
+ $msg= sprintf(_("Cannot load dumped file '%s'!"),$filename);
+ msg_dialog::display(_("Internal error"), $msg, ERROR_DIALOG);
+ new log("copy","all/all",$dn,array(), $msg);
return(FALSE);
}
}
/* Check permissions */
if(!preg_match("/((c|w)|(w|c))/",$acl)){
- print_red(sprintf(_("You are not allowed to cut and paste the following object '%s'."),$this->current['dn']));
+ msg_dialog::display(_("Error"), sprintf(_("You have no permission to save object '%s'."), $this->current['dn']), ERROR_DIALOG);
}elseif(count ($msgs) ){
foreach( $msgs as $msg){
- print_red($msg);
+ msg_dialog::display(_("Error"), $msg, ERROR_DIALOG);
}
}else{
/* Check permissions */
if(!preg_match("/((c|w)|(w|c))/",$acl)){
- print_red(sprintf(_("You are not allowed to copy and paste the following object '%s'."),$this->current['dn']));
+ msg_dialog::display(_("Error"), sprintf(_("You have no permission to copy and paste object '%s'!"),$this->current['dn']), ERROR_DIALOG);
}elseif(count ($msgs) ){
foreach( $msgs as $msg){
- print_red($msg);
+ msg_dialog::display(_("Error"), $msg, ERROR_DIALOG);
}
}else{
$this->current['object']->save();