summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 90f26d0)
raw | patch | inline | side by side (parent: 90f26d0)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 16 Oct 2007 07:04:38 +0000 (07:04 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 16 Oct 2007 07:04:38 +0000 (07:04 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7562 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_log.inc | patch | blob | history |
diff --git a/include/class_log.inc b/include/class_log.inc
index d9c3565f0df6f1c8a21b4823a4ccfbe2351f4a27..c321b201411435bddf7bc85dc203b3bbf8d01ccb 100644 (file)
--- a/include/class_log.inc
+++ b/include/class_log.inc
$this->log_into_syslog($entry);
}
if(isset($this->config->current['LOGGING']) && preg_match("/(^|,)mysql(,|$)/i",$this->config->current['LOGGING'])){
- $this->log_into_db($entry);
+ $res = $this->log_into_db($entry);
+
+ if(!$res){
+ global $config;
+ $config->current['LOGGING'] = preg_replace("/(^|,)mysql(,|$)/",",",$config->current['LOGGING']);
+ msg_dialog::display(_("Logging to MySQL disabled"),_("The logging to a MySQL database is now disabled for this session of GOsa, due to communication errors with the specified logging database."), INFO_DIALOG);
+ }
}
}
}
$con = @mysql_pconnect($server_name,$server['USER'],$server['PWD']);
if(!$con){
print_red(sprintf(_("Could not connect to logging server %s."),$server_name));
+ return(FALSE);
}else{
$db = mysql_select_db($server['DB'],$con);
if(!$db){
print_red(sprintf(_("Could not select database %s on server %s. Server says :%s"),$server['DB'],$server['SERVER'],mysql_error($con)));
+ return(FALSE);
}else{
/* Create mysql syntax */
$res = mysql_query($query,$con);
if(!$res){
print_red(sprintf(_("Could not query database %s on server %s. Server ssys :%s"),$server['DB'],$server['SERVER'],mysql_error($con)));
-
+ return(FALSE);
}
}
mysql_close($con);
}
}
+ return(TRUE);
}
}