summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f262610)
raw | patch | inline | side by side (parent: f262610)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 6 Nov 2008 11:32:23 +0000 (11:32 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 6 Nov 2008 11:32:23 +0000 (11:32 +0000) |
-Do not change owner of existing cache dir, only change the owner and permission of the created files.
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@12937 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@12937 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_CopyPasteHandler.inc | patch | blob | history |
diff --git a/gosa-core/include/class_CopyPasteHandler.inc b/gosa-core/include/class_CopyPasteHandler.inc
index 4ceb83a1f76507f088b7a39adcbf07711acce1d8..ee772bb300afcc345fba4ed46facca515865fde1 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);