summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6ad55d3)
raw | patch | inline | side by side (parent: 6ad55d3)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 16 Jan 2008 13:14:19 +0000 (13:14 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 16 Jan 2008 13:14:19 +0000 (13:14 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8386 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-core/plugins/addons/addressbook/class_addressbook.inc b/gosa-core/plugins/addons/addressbook/class_addressbook.inc
index b1821bcd08f480413ca9f0315f59d2cb9d15baee..eddfcdf2c6eca741c0104194c963b49976272927 100644 (file)
return($smarty->fetch(get_template_path('dial.tpl', TRUE)));
return;
} else {
- print_red (_("You have no personal phone number set. Please change that in order to perform direct dials."));
+ msg_dialog::display(_("Error"), _("You need to set your personal phone number in order to perform direct dials."), ERROR_DIALOG);
}
}
/* Normally this shouldn't be reached, send some extra
logs to notify the administrator */
- print_red (_("You are not allowed to delete this entry!"));
+ msg_dialog::display(_("Permission error"), _("You have no permission to delete this entry!"), ERROR_DIALOG);
new log("remove","addressbook/".get_class($this),$this->dn,array(),"Warning: '".$this->ui->uid."' tried to trick address book deletion.");
}
/* Obviously the user isn't allowed to delete. Show message and
clean session. */
- print_red (_("You are not allowed to delete this entry!"));
+ msg_dialog::display(_("Permission error"), _("You have no permission to delete this entry!"), ERROR_DIALOG);
}
}
session::set('show_info',"ADD");
diff --git a/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc b/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc
index d34a7364176b893d032d94b75ff42063a3125e1a..b40fdc1b8b0f4776bda861519eef614ec83951fe 100644 (file)
default : trigger_error("Undefined priority setting used.");
}
if($this->o_queue->is_error()){
- print_red($this->o_queue->get_error());
+ msg_dialog::display(_("Error"), $this->o_queue->get_error(), ERROR_DIALOG);
}
}
if($s_action == "remove_multiple" || $s_action == "remove"){
if(!$this->acl_is_removeable()){
- print_red(_("You are not allowed to remove a task."));
+ msg_dialog::display(_("Permission error"), _("You have no permission to delete this entry!"), ERROR_DIALOG);
}else{
if($s_action == "remove"){
$msgs = $this->dialog->check();
if(count($msgs)){
foreach($msgs as $msg){
- print_red($msg);
+ msg_dialog::display(_("Error"), $msg, ERROR_DIALOG);
}
}else{
$tmp2[] = $tmp;
}
if(!$this->o_queue->add_multiple($tmp2)){
- print_red($this->o_queue->get_error());
+ msg_dialog::display(_("Error"), $this->o_queue->get_error(), ERROR_DIALOG);
}
}
if(!isset($_POST['apply_goto_task'])){
function get_queue_entries()
{
if(!$this->o_queue->load()){
- print_red(sprintf(_("An error occurred while requesting queue entries. Error was '%s'."),$this->o_queue->get_error()));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot load queue entries: %s"), "<br><br>".$this->o_queue->get_error()), ERROR_DIALOG);
return(array());
}
$tasks = array();
diff --git a/gosa-core/plugins/addons/gotomasses/class_target_list.inc b/gosa-core/plugins/addons/gotomasses/class_target_list.inc
index 15d3fb1aed4554956a82cc09da552a0aa439a063..2cf1a24e17865d4098dcda558b23d711006507e0 100644 (file)
if($this->IPMatch){
if(!tests::is_ip($IP_start)){
- print_red(_("Please specify a valid IP range."));
+ msg_dialog::display(_("Error"), _("IP range is invalid!"), ERROR_DIALOG);
return;
}
if(!tests::is_ip($IP_end)){
- print_red(_("Please specify a valid IP range."));
+ msg_dialog::display(_("Error"), _("IP range is invalid!"), ERROR_DIALOG);
return;
}
}
diff --git a/gosa-core/plugins/addons/ldapmanager/class_csvimport.inc b/gosa-core/plugins/addons/ldapmanager/class_csvimport.inc
index 66131ca2162830500a40c195eb5e02fe38785250..bd84fa82e5ba6ad767291fa6f1330a7419e267b6 100644 (file)
$acl = $this->ui->get_permissions($this->config->current['BASE'],"all/all");
if(!preg_match("/w/",$acl)){
if(isset($_POST['userfile']) || isset($_POST['sorted']) || isset($_POST['fileup'])){
- print_red(_("You've no permission to do CSV imports."));
+ msg_dialog::display(_("Permission error"), _("You've no permission to import CSV files."), ERROR_DIALOG);
}
return ($smarty->fetch (get_template_path('contentcsv.tpl', TRUE)));
}
(!isset($dat['sn']))||(!isset($dat['givenName']))||(!isset($dat['uid']))){
/* Output Error */
-
- print_red (_("Need 'sn','givenName' and 'uid' to create user."));
+ msg_dialog::display(_("Error"), _("Need at least 'sn', 'givenName' and 'uid' to create users."), ERROR_DIALOG);
} else {
/* Register usertab to trigger edit dialog */
/* Error? */
if ($failing){
- print_red(sprintf(_("An Error Occured while inserting entry %s - process aborted"), $failing));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot insert entry '%s'!"), $failing), ERROR_DIALOG);
}
$smarty->assign("error",$failing);
$smarty->assign("tpl",$arrtemplates[$tplid]);
- print_red (_("Nothing to import!"));
+ msg_dialog::display(_("Information"), _("Nothing to import!"), INFO_DIALOG);
}
/* If theres a File uploaded */
if((!isset($_FILES['userfile']['name']))||(!isset($_POST['fileup'])))
{
- print_red(_("There is no file uploaded."));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot read uploaded file: %s"), _("file not found")), ERROR_DIALOG);
$smarty->assign("LDIFError",TRUE);
}
elseif(!$_FILES['userfile']['size'] > 0 )
{
- print_red(_("The specified file is empty."));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot read uploaded file: %s"), _("file is empty")), ERROR_DIALOG);
$smarty->assign("LDIFError",TRUE);
}
/* Is there a tmp file, which we can use ? */
elseif(!file_exists($_FILES['userfile']['tmp_name']))
{
- print_red(_("There is no file uploaded."));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot read uploaded file: %s"), _("file not found")), ERROR_DIALOG);
$smarty->assign("LDIFError",TRUE);
}
elseif(!$handle = @fopen($_FILES['userfile']['tmp_name'],"r"))
{
- print_red(_("There is no file uploaded."));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot read uploaded file: %s"), _("file not readable")), ERROR_DIALOG);
$smarty->assign("LDIFError",TRUE);
}
else
$smarty->assign("tpl",$this->csvinfo['attr'][$_POST['template']]);
$smarty->assign("LDIFError",TRUE);
$smarty->assign("fileup",FALSE);
- print_red(_("The selected file does not contain any CSV Data..."));
+ msg_dialog::display(_("Error"), _("Cannot find CSV data in the selected file!"), ERROR_DIALOG);
}
}
}
diff --git a/gosa-core/plugins/addons/ldapmanager/class_export.inc b/gosa-core/plugins/addons/ldapmanager/class_export.inc
index aa988a31209d04b612dafd4e6d44d2bfa919b427..41ae7212cea7a1212ca1dbfcbf5f6561139e36e5 100644 (file)
{
if(!($ldap->dn_exists($dn) && $dn != "")){
$smarty->assign("LDIFError",TRUE);
- print_red (_("Error while exporting the requested entries!"));
+ msg_dialog::display(_("Error"), _("Cannot export selected entries!"), ERROR_DIALOG);
}
}
if((!preg_match("/r/",$acls)) && (isset($dn))){
/* Show error msg */
- print_red(sprintf(_("You are not allowed to export the given ldap entry (%s)"),@LDAP::fix($dn)));
+ msg_dialog::display(_("Permission error"), sprintf(_("You have no permission to export '%s'!"),@LDAP::fix($dn)), ERROR_DIALOG);
/* Show main page */
$smarty->assign("LDIFError",TRUE);
diff --git a/gosa-core/plugins/addons/ldapmanager/class_exportxls.inc b/gosa-core/plugins/addons/ldapmanager/class_exportxls.inc
index 90bab709acfa37ee7fea5f7c859ccb4359628b61..c9917dd8cebf1b57dd542cf7187b1fcc72911e08 100644 (file)
<?php
-
class xlsexport extends plugin
{
/* Definitions */
{
if(!($ldap->dn_exists($dn) && $dn != "")){
$smarty->assign("LDIFError",TRUE);
- print_red (_("Error while exporting the requested entries!"));
+ msg_dialog::display(_("Error"), _("Cannot export selected entries!"), ERROR_DIALOG);
}
}
if(!preg_match("/r/",$acls) && (isset($_POST['sfrmgetsingle']) || isset($_POST['sfrmgetfull']) || isset($_POST['sfrmgetivbb']))){
/* Show error msg */
- print_red(sprintf(_("You are not allowed to export the given ldap entry (%s)"),@LDAP::fix($dn)));
+ msg_dialog::display(_("Error"), sprintf(_("You have no permission to export '%s'!"),@LDAP::fix($dn)), ERROR_DIALOG);
/* Show main page */
$smarty->assign("LDIFError",TRUE);
diff --git a/gosa-core/plugins/addons/ldapmanager/class_import.inc b/gosa-core/plugins/addons/ldapmanager/class_import.inc
index 71edbb2a2da5a557445379299c9d4882d369e505..ac2a81085f8f349a78a922fe518220862332dfde 100644 (file)
/* Check acls */
if(!preg_match("/w/",$acl)){
- print_red(_("You need full access to all objects, to execute the import command."));
+ msg_dialog::display(_("Permission error"), _("You need full write access to the LDAP tree to import data!"), ERROR_DIALOG);
}else{
$smarty->assign("type","importfile");
// Check if there is a file submitted
if(!$_FILES['userfile']['size'] > 0 )
{
- print_red(_("The specified file is empty."));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot read uploaded file: %s"), _("file is empty")), ERROR_DIALOG);
$smarty->assign("LDIFError",TRUE);
}
// Is there a tmp file, which we can use ?
elseif(!file_exists($_FILES['userfile']['tmp_name']))
{
- print_red(_("There is no file uploaded."));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot read uploaded file: %s"), _("file not found")), ERROR_DIALOG);
$smarty->assign("LDIFError",TRUE);
}
// Can we open the tmp file, for reading
elseif(!$handle = @fopen($_FILES['userfile']['tmp_name'],"r"))
{
- print_red(_("There is no file uploaded."));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot read uploaded file: %s"), _("file not readable")), ERROR_DIALOG);
$smarty->assign("LDIFError",TRUE);
}
else
$ErrorStr="";
$check = $ldap->import_complete_ldif($str,$ErrorStr,$overwrite,$cleanup);
- if($check == INSERT_OK )
+ if($check == INSERT_OK ){
$smarty->assign("LDIFError",FALSE);
- else
+ } else {
$smarty->assign("LDIFError",TRUE);
+ }
switch($check)
{
- case INSERT_OK : break;
- case ALREADY_EXISTING_ENTRY : print_red($ErrorStr); break;
- case UNKNOWN_TOKEN_IN_LDIF_FILE : print_red($ErrorStr);break;
+ case INSERT_OK:
+ break;
- default : print_red(_("Unknown Error"));break;
+ case ALREADY_EXISTING_ENTRY:
+ msg_dialog::display(_("LDAP error"), $ErrorStr, ERROR_DIALOG);
+ break;
+
+ case UNKNOWN_TOKEN_IN_LDIF_FILE:
+ msg_dialog::display(_("LDAP error"), $ErrorStr, ERROR_DIALOG);
+ break;
+
+ default:
+ msg_dialog::display(_("Internal error"), sprintf(_("Undefined flag '%s'!"), $check), ERROR_DIALOG);
+ break;
}
}
}
diff --git a/gosa-core/plugins/addons/logview/class_gosa_logview.inc b/gosa-core/plugins/addons/logview/class_gosa_logview.inc
index 5d8c62277760fb624f7e2d7c899bf82bc08e409a..9079abe39444abd65e05a903f0069a4d500fd783 100644 (file)
* and mysql extension
****/
if (!isset($this->config->data['SERVERS']['LOGGING']) || !count($this->config->data['SERVERS']['LOGGING'])){
- print_red (_("No GOsa LOG servers defined!"));
+ msg_dialog::display(_("Warning"), sprintf(_("No %s servers defined!"), "GOsa log"), WARNING_DIALOG);
return ($smarty->fetch (get_template_path('gosa_log_contents.tpl', TRUE)));
}
if(!is_callable("mysql_connect")){
- print_red(_("There is no mysql extension available, please check your php setup."));
+ msg_dialog::display(_("Configuration error"), sprintf(_("Missing %s PHP extension!"), "mysql"), WARNING_DIALOG);
return ($smarty->fetch (get_template_path('gosa_log_contents.tpl', TRUE)));
}
$cfg = $list_of_servers[$this->server];
$link = @mysql_pconnect($this->server, $cfg['USER'], $cfg['PWD']);
if ($link === FALSE){
- print_red(_("Can't connect to log database, no logs can be shown!"));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot connect to %s database!"), "GOsa LOG"), ERROR_DIALOG);
new log("debug","logview","",array(),@mysql_error());
return ($smarty->fetch (get_template_path('gosa_log_contents.tpl', TRUE)));
}
/* check of log database is available */
if (! @mysql_select_db($cfg['DB'])){
- print_red(_("Can't select log database for log generation!"));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot select %s database!"), "GOsa LOG"), ERROR_DIALOG);
new log("debug","logview","",array(),@mysql_error());
return ($smarty->fetch (get_template_path('gosa_log_contents.tpl', TRUE)));
}
/* Test connection object && create up query string */
if ($link === FALSE){
- print_red(_("Can't connect to log database, no logs can be shown!"));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot connect to %s database!"), "GOsa LOG"), ERROR_DIALOG);
new log("debug","logview","",array(),@mysql_error());
} else {
if (! @mysql_select_db($cfg['DB'])){
- print_red(_("Can't select log database for log generation!"));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot select %s database!"), "GOsa LOG"), ERROR_DIALOG);
new log("debug","logview","",array(),@mysql_error());
} else {
diff --git a/gosa-core/plugins/addons/logview/class_logview.inc b/gosa-core/plugins/addons/logview/class_logview.inc
index df0f667bed690bc5be212ef0041bbaedbc95d5e7..3349a69fac2d479ff7f00365526437742d230eba 100644 (file)
/* Test connection to log database */
if (!isset($this->config->data['SERVERS']['LOG'])){
- print_red (_("No LOG servers defined!"));
+ msg_dialog::display(_("Warning"), sprintf(_("No %s servers defined!"), "syslog"), WARNING_DIALOG);
return ($smarty->fetch (get_template_path('contents.tpl', TRUE)));
}elseif(!is_callable("mysql_connect")){
- print_red(_("There is no mysql extension available, please check your php setup."));
+ msg_dialog::display(_("Configuration error"), sprintf(_("Missing %s PHP extension!"), "mysql"), WARNING_DIALOG);
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){
- print_red(_("Can't connect to log database, no logs can be shown!"));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot connect to %s database!"), "syslog"), ERROR_DIALOG);
new log("debug","logview","",array(),@mysql_error());
return ($smarty->fetch (get_template_path('contents.tpl', TRUE)));
}
/* check of log database is available */
if (! @mysql_select_db("gomon")){
- print_red(_("Can't select log database for log generation!"));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot select %s database!"), "syslog"), ERROR_DIALOG);
new log("debug","logview","",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){
- print_red(_("Query for log database failed!. Requesting host names failed."));
+ msg_dialog::display(_("Error"), _("Cannot obtain host list from syslog database!"), ERROR_DIALOG);
new log("debug","logview","",array(),@mysql_error());
return ($smarty->fetch (get_template_path('contents.tpl', TRUE)));
}
$result = @mysql_query($query);
if ($result === false){
new log("debug","logview","",array(),@mysql_error());
- print_red(_("Query for log database failed!"));
+ msg_dialog::display(_("Error"), _("Database query failed!"), ERROR_DIALOG);
return ($smarty->fetch (get_template_path('contents.tpl', TRUE)));
}
/* Test connection object && create up query string */
if ($link === FALSE){
- print_red(_("Can't connect to log database, no logs can be shown!"));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot connect to %s database!"), "syslog"), ERROR_DIALOG);
new log("debug","logview","",array(),@mysql_error());
} else {
if (! @mysql_select_db("gomon")){
- print_red(_("Can't select log database for log generation!"));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot select %s database!"), "syslog"), ERROR_DIALOG);
new log("debug","logview","",array(),@mysql_error());
} else {
diff --git a/gosa-core/plugins/addons/mailqueue/class_mailqueue.inc b/gosa-core/plugins/addons/mailqueue/class_mailqueue.inc
index 6b1e6e46e5ee8925b48dd0f2cd1c7e89b6dd9e4f..fd890dfa47cce4be091f4ca5f70327162dcea995 100644 (file)
function pass_cmd($str)
{
-// print_red($str);
return(shell_exec($str));
}
$error =false;
if(empty($this->mailQueueScript)){
- print_red(_("Please check your 'gosa.conf', there is no 'MAILQUEUESCRIPTPATH' specified."));
+ msg_dialog::display(_("Configuration error"), sprintf(_("Missing '%s' directive in configuration!"), "mailqueuescriptpath"), ERROR_DIALOG);
$error = true;
}else{
if((preg_match("/".$attr."/",$name))&&($only_once)){
if(!$this->acl_is_readable($attr)){
$only_once = false;
- print_red(sprintf(_("You do not have permission to execute the command '%s' on the mailqueue."),$attr));
+ msg_dialog::display(_("Permission error"), sprintf(_("You have no permission to submit a '%s' command!"), $attr), ERROR_DIALOG);
}else{
$only_once = false;
$act = preg_replace("/_.*$/i","",$attr);
$r_cmd = preg_replace("/%server/" , $se_str ,$r_cmd);
$r_cmd = preg_replace("/%id/" , "ALL" ,$r_cmd);
if($this->pass_cmd($r_cmd)==false){
- print_red(sprintf(_("Please check your 'gosa.conf' the given '%s' can't be executed."),$r_cmd));
+ msg_dialog::display(_("Configuration error"), sprintf(_("'%s' defined for the '%s' directive cannot be executed!"), $r_cmd, "mailqueuescriptpath"), ERROR_DIALOG);
}
}
}
$only_once = false;
if(!$this->acl_is_readable($opt)){
- print_red(sprintf(_("You do not have permission to execute the command '%s' on the mailqueue."),$opt));
+ msg_dialog::display(_("Permission error"), sprintf(_("You have no permission to submit a '%s' command!"), $opt), ERROR_DIALOG);
}else{
/* Create cmd */
$r_cmd = preg_replace("/%action/" , $opt ,$this->mailQueueScript);
/* Execute cmd */
if(!$str = $this->pass_cmd($r_cmd)){
- print_red(sprintf(_("Please check your 'gosa.conf' the given '%s' can't be executed."),$r_cmd));
+ msg_dialog::display(_("Configuration error"), sprintf(_("'%s' defined for the '%s' directive cannot be executed!"), $r_cmd, "mailqueuescriptpath"), ERROR_DIALOG);
}else{
/* Special handling for option='header' */
$q_cmd = preg_replace("/%id/" ,"all" ,$q_cmd);
if(!$this->acl_is_readable("query")){
- print_red(sprintf(_("You do not have permission to execute the command '%s' on the mailqueue."),"query"));
+ msg_dialog::display(_("Permission error"), sprintf(_("You have no permission to submit a '%s' command!"), "query"), ERROR_DIALOG);
$mailQueueParser = new parseMailQueue("",$this->Server);
}else{
$mailQueueParser = new parseMailQueue($str,$this->Server);
}else{
/* On error/ no return value / false return value */
- print_red(sprintf(_("Please check your 'gosa.conf' the given '%s' can't be executed."),$q_cmd));
+ msg_dialog::display(_("Configuration error"), sprintf(_("'%s' defined for the '%s' directive cannot be executed!"), $q_cmd, "mailqueuescriptpath"), ERROR_DIALOG);
$error = true;
}
}
if(!$this->acl_is_readable("query")){
- print_red(sprintf(_("You do not have permission to execute the command '%s' on the mailqueue."),"query"));
+ msg_dialog::display(_("Permission error"), sprintf(_("You have no permission to submit a '%s' command!"), "query"), ERROR_DIALOG);
$mailQueueParser = new parseMailQueue("",$this->Server);
}else{
}
/* On error/ no return value / false return value */
}else{
- print_red(sprintf(_("Please check your 'gosa.conf' the given '%s' can't be executed."),$q_cmd));
+ msg_dialog::display(_("Configuration error"), sprintf(_("'%s' defined for the '%s' directive cannot be executed!"), $q_cmd, "mailqueuescriptpath"), ERROR_DIALOG);
$error = true;
}
}
Else display error */
$server = $this->getServer();
if((count($server) == 1 ) && (isset($server['all']))){
- print_red(_("There are no mail server specified."));
+ msg_dialog::display(_("Configuration error"), _("No mail servers sepcified!"), ERROR_DIALOG);
$error = true;
}