index 022d2fe6281b41c2c3bdc8ca9575eb192fa16bf5..4f7376e513c4cda66efaf74cf808609f403753bb 100644 (file)
$entry['user']= "unkown";
}else{
- $this->config = &$_SESSION['config'];
+ $this->config = session::get('config');
$ui = get_userinfo();
$entry['user']= @$ui->dn;
}
if(count($msgs)){
foreach($msgs as $msg){
trigger_error("Logging failed, reason was: ".$msg);
- print_red("Logging failed, reason was: ".$msg);
+ msg_dialog::display(_("Internal error"), sprintf(_("Logging failed: %s"), $msg), ERROR_DIALOG);
}
}else{
$msgs = array();
if(!isset($entry['action']) || !in_array($entry['action'],array("modify","create","remove","copy","snapshot","view","security","debug"))){
- $msgs[] = "Invalid option specified '".$entry['action']."'";
+ $msgs[] = sprintf(_("Invalid option '%s' specified."), $entry['action']);
}
if(!isset($entry['objecttype']) || empty($entry['objecttype'])){
- $msgs[] = "Specified objectType is empty or invalid.";
+ $msgs[] = _("Specified objectType is empty or invalid");
}
return($msgs);
if(isset($this->config->data['SERVERS']['LOGGING'])){
$servers = $this->config->data['SERVERS']['LOGGING'];
}else{
- print_red(_("You have enabled the logging into mysql databse, but there are no logging servers available."));
+ msg_dialog::display(_("Error"), _("You have enabled the logging into mysql database, but there are no logging servers available."), ERROR_DIALOG);
return(FALSE);
}
$con = @mysql_pconnect($server_name,$server['USER'],$server['PWD']);
if(!$con){
- print_red(sprintf(_("Could not connect to logging server %s."),$server_name));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot connect to logging server '%s'."),$server_name), ERROR_DIALOG);
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)));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot select database '%s' on server '%s': %s"),$server['DB'],$server['SERVER'], mysql_error($con)), ERROR_DIALOG);
return(FALSE);
}else{
";
$res = mysql_query($query,$con);
if(!$res){
- print_red(sprintf(_("Could not query database %s on server %s. Server says :%s"),$server['DB'],$server['SERVER'],mysql_error($con)));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot query database '%s' on server '%s': %s"),$server['DB'],$server['SERVER'], mysql_error($con)), ERROR_DIALOG);
return(FALSE);
}
}