summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cfdcc28)
raw | patch | inline | side by side (parent: cfdcc28)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 14 Jun 2007 13:20:58 +0000 (13:20 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 14 Jun 2007 13:20:58 +0000 (13:20 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6594 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_CopyPasteHandler.inc | patch | blob | history | |
include/class_log.inc | patch | blob | history |
index c11849e2fffc857f8a0864a6ef65bb3b1f239f4b..2650fc9c98242c151cec5a7ae8e7da4938847e3b 100644 (file)
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)){
diff --git a/include/class_log.inc b/include/class_log.inc
index de8154fe46d9a3f4fef51e09a7a311e4b8d79b94..462be2892e3b53566e64def61b51400c6afe14ca 100644 (file)
--- a/include/class_log.inc
+++ b/include/class_log.inc
*/
function log($action,$objecttype,$object,$changes_array = array(),$result = TRUE)
{
+ if(!is_array($changes_array)){
+ trigger_error("log(string,string,string,array(),bool). Forth parameter must be an array.");
+ $changes_array = array();
+ }
+
$entry = array();
if(!isset($_SESSION['config'])){
$entry['user']= "unkown";
}
foreach($servers as $server_name => $server){
-
- $con = mysql_pconnect($server_name,$server['USER'],$server['PWD']);
+
+ $con = @mysql_pconnect($server_name,$server['USER'],$server['PWD']);
if(!$con){
- print_red(sprintf(_("Could not connect to logging server %s."),$server['SERVER']));
+ print_red(sprintf(_("Could not connect to logging server %s."),$server_name));
}else{
$db = mysql_select_db($server['DB'],$con);
if(!$db){
}
}
+ mysql_close($con);
}
}
}