summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c318ceb)
raw | patch | inline | side by side (parent: c318ceb)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 7 Mar 2008 14:19:47 +0000 (14:19 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 7 Mar 2008 14:19:47 +0000 (14:19 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9439 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/log/addons/logview/class_gosa_logview.inc | patch | blob | history | |
gosa-plugins/log/addons/logview/class_logview.inc | patch | blob | history |
diff --git a/gosa-plugins/log/addons/logview/class_gosa_logview.inc b/gosa-plugins/log/addons/logview/class_gosa_logview.inc
index e8d5ece4f18f68cfd5a16ee271e8d4b911e10bf0..ed148d1a1054e27d2e9cb1308716aaa9f5176672 100644 (file)
/* Log view */
if(!$this->view_logged){
$this->view_logged = TRUE;
- new log("view","logview/".get_class($this),$this->dn);
+ new log("view","gosa_logging/".get_class($this),$this->dn);
}
/* Time interval */
$link = @mysql_pconnect($this->server, $cfg['USER'], $cfg['PWD']);
if ($link === FALSE){
msg_dialog::display(_("Error"), msgPool::dbconnect($this->server,@mysql_error(),"GOsa LOG"), ERROR_DIALOG);
- new log("debug","logview","dbconnect",array(),@mysql_error());
+ new log("debug","gosa_logging","dbconnect",array(),@mysql_error());
return ($smarty->fetch (get_template_path('gosa_log_contents.tpl', TRUE)));
}
/* check if log database is available */
if (! @mysql_select_db($cfg['DB'])){
msg_dialog::display(_("Error"), msgPool::dbselect($cfg['DB'],@mysql_error(), "GOsa LOG"), ERROR_DIALOG);
- new log("debug","logview","selectdb",array(),@mysql_error());
+ new log("debug","gosa_logging","selectdb",array(),@mysql_error());
return ($smarty->fetch (get_template_path('gosa_log_contents.tpl', TRUE)));
}
$query= "SELECT COUNT(`user`) ".$query_base.";";
$result = mysql_query($query);
if(!$result){
- new log("debug","logview","",array(),@mysql_error());
+ new log("debug","gosa_logging","",array(),@mysql_error());
}
$line= mysql_fetch_array($result, MYSQL_ASSOC);
$count= $line['COUNT(`user`)'];
$result = @mysql_query($query);
if(!$result){
msg_dialog::display(_("Error"), msgPool::dbquery("gosa_log",@mysql_error(), "GOsa LOG"), ERROR_DIALOG);
- new log("debug","logview","querydb",array(),@mysql_error());
+ new log("debug","gosa_logging","querydb",array(),@mysql_error());
return ($smarty->fetch (get_template_path('gosa_log_contents.tpl', TRUE)));
}
diff --git a/gosa-plugins/log/addons/logview/class_logview.inc b/gosa-plugins/log/addons/logview/class_logview.inc
index 3349a69fac2d479ff7f00365526437742d230eba..ffb775cdd7204072edfbce9b6de53656eb514592 100644 (file)
}elseif(!is_callable("mysql_connect")){
msg_dialog::display(_("Configuration error"), sprintf(_("Missing %s PHP extension!"), "mysql"), WARNING_DIALOG);
+ new log("debug","logview","Missing MYSQL extension.");
return ($smarty->fetch (get_template_path('contents.tpl', TRUE)));
}else{
/* Open link to database and check if it is valid */
$link = @mysql_pconnect($cfg['SERVER'], $cfg['LOGIN'], $cfg['PASSWORD']);
if ($link === FALSE){
- msg_dialog::display(_("Error"), sprintf(_("Cannot connect to %s database!"), "syslog"), ERROR_DIALOG);
- new log("debug","logview","",array(),@mysql_error());
+ msg_dialog::display(_("Error"), msgPool::dbconnect($cfg['SERVER'],@mysql_error(),"Log view"), ERROR_DIALOG);
+ new log("debug","log view","dbconnect",array(),@mysql_error());
return ($smarty->fetch (get_template_path('contents.tpl', TRUE)));
}
/* check of log database is available */
if (! @mysql_select_db("gomon")){
- msg_dialog::display(_("Error"), sprintf(_("Cannot select %s database!"), "syslog"), ERROR_DIALOG);
- new log("debug","logview","",array(),@mysql_error());
+ msg_dialog::display(_("Error"), msgPool::dbselect("gomon",@mysql_error(),"Log view"), ERROR_DIALOG);
+ new log("debug","log view","dbselect",array(),@mysql_error());
return ($smarty->fetch (get_template_path('contents.tpl', TRUE)));
}
@DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__, $query, "Database query");
$result = @mysql_query($query);
if ($result === false){
- msg_dialog::display(_("Error"), _("Cannot obtain host list from syslog database!"), ERROR_DIALOG);
- new log("debug","logview","",array(),@mysql_error());
+ msg_dialog::display(_("Error"), msgPool::dbquery("golog",@mysql_error(),"Log view"), ERROR_DIALOG);
+ new log("debug","log view","dbquery",array(),@mysql_error());
return ($smarty->fetch (get_template_path('contents.tpl', TRUE)));
}
@DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__, $query, "Database query");
$result = @mysql_query($query);
if ($result === false){
- new log("debug","logview","",array(),@mysql_error());
- msg_dialog::display(_("Error"), _("Database query failed!"), ERROR_DIALOG);
+ msg_dialog::display(_("Error"), msgPool::dbquery("golog",@mysql_error(),"Log view"), ERROR_DIALOG);
+ new log("debug","log view","dbquery",array(),@mysql_error());
return ($smarty->fetch (get_template_path('contents.tpl', TRUE)));
}
if(count($tmp_cat_bases) == 0 || !preg_match("/r/",$all_acls)){
$res = "<tr>
<td colspan=4>
- "._("You have insufficient permissions to view syslog entries.")."
+ ".msgPool::permView()."
</td>
</tr>";
/* Test connection object && create up query string */
if ($link === FALSE){
- msg_dialog::display(_("Error"), sprintf(_("Cannot connect to %s database!"), "syslog"), ERROR_DIALOG);
- new log("debug","logview","",array(),@mysql_error());
+ msg_dialog::display(_("Error"), msgPool::dbconnect($cfg['SERVER'],@mysql_error(),"Log view"), ERROR_DIALOG);
+ new log("debug","log view","dbconnect",array(),@mysql_error());
+ return ($smarty->fetch (get_template_path('contents.tpl', TRUE)));
} else {
if (! @mysql_select_db("gomon")){
- msg_dialog::display(_("Error"), sprintf(_("Cannot select %s database!"), "syslog"), ERROR_DIALOG);
- new log("debug","logview","",array(),@mysql_error());
+ msg_dialog::display(_("Error"), msgPool::dbselect("gomon",@mysql_error(),"Log view"), ERROR_DIALOG);
+ new log("debug","log view","dbselect",array(),@mysql_error());
+ return ($smarty->fetch (get_template_path('contents.tpl', TRUE)));
} else {
/* Assemble time query */
$query= "SELECT COUNT(*)".$query_base.";";
$result = @mysql_query($query);
if(!$result){
- new log("debug","logview","",array(),@mysql_error());
+ msg_dialog::display(_("Error"), msgPool::dbquery("golog",@mysql_error(),"Log view"), ERROR_DIALOG);
+ new log("debug","log view","dbquery",array(),@mysql_error());
+ return ($smarty->fetch (get_template_path('contents.tpl', TRUE)));
}
$line= mysql_fetch_array($result, MYSQL_ASSOC);
$count= $line['COUNT(*)'];
@DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__, $query, "Database query");
$result = @mysql_query($query);
if(!$result){
- new log("debug","logview","",array(),@mysql_error());
+ msg_dialog::display(_("Error"), msgPool::dbquery("golog",@mysql_error(),"Log view"), ERROR_DIALOG);
+ new log("debug","log view","dbquery",array(),@mysql_error());
+ return ($smarty->fetch (get_template_path('contents.tpl', TRUE)));
}
/* Display results */
$mod= 0;