summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e09b376)
raw | patch | inline | side by side (parent: e09b376)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 7 Mar 2008 15:26:29 +0000 (15:26 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 7 Mar 2008 15:26:29 +0000 (15:26 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9448 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc | patch | blob | history |
diff --git a/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc b/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc
index 2bd29cbdf089343aefd177d30867f1b2a8fef16c..963e595d98ad0d71d93924d265f580373652d67c 100644 (file)
$a_New = $this->goFonHomeServers[$this->goFonHomeServer]; // DB Configuration
$new_connection = @mysql_pconnect($a_New['SERVER'],$a_New['LOGIN'],$a_New['PASSWORD']);
if(!$new_connection){
- $this->generate_error = sprintf(
- _("The MySQL Server '%s' isn't reachable as user '%s'. Abort saving entries to keep the database consistent, check GOsa log for mysql error."),
- $a_New['SERVER'],$a_New['LOGIN']);
+ $this->generate_error = msgPool::dbconnect($a_New['SERVER'],@mysql_error($new_connection),
+ _("Abort saving entries to keep the database consistent."));
new log("debug","gofonreport/".get_class($this),"",array(),@mysql_error($new_connection));
return false;
}
$new_database = @mysql_select_db($a_New['DB'],$new_connection);
if(!$new_database){
- $this->generate_error = sprintf(
- _("Can't select database %s on %s. Abort saving entries to keep the database consistent, check GOsa log for mysql error."),
- $a_New['DB'],$a_New['SERVER']);
+ $this->generate_error = msgPool::dbselect($a_New['DB'],@mysql_error($new_connection),
+ _("Abort saving entries to keep the database consistent."));
new log("debug","gofonreport/".get_class($this),"",array(),@mysql_error($new_connection));
return false;
}
*/
$old_connection = @mysql_pconnect($a_Remove['SERVER'],$a_Remove['LOGIN'],$a_Remove['PASSWORD']);
if(!$old_connection){
- $this->generate_error = sprintf(
- _("The old MySQL home server '%s' isn't reachable as user '%s'. Abort saving entries to keep the database consistent, check GOsa log for mysql error."),
- $a_Remove['SERVER'],$a_Remove['LOGIN']);
+ $this->generate_error = msgPool::dbconnect($a_Remove['SERVER'],@mysql_error($old_connection),
+ _("Abort saving entries to keep the database consistent."));
new log("debug","gofonreport/".get_class($this),"",array(),@mysql_error($old_connection));
return false;
}
$old_database = @mysql_select_db($a_Remove['DB'],$old_connection);
if(!$old_database){
- $this->generate_error = sprintf(
- _("Can't select database %s on %s. Abort saving entries to keep the database consistent, check GOsa log for mysql error."),
- $a_Remove['DB'],$a_Remove['SERVER']);
+ $this->generate_error = msgPool::dbselect($a_Remove['DB'],@mysql_error($old_connection),
+ _("Abort saving entries to keep the database consistent."));
new log("debug","gofonreport/".get_class($this),"",array(),@mysql_error($old_connection));
return false;
}
foreach($SQL_query_array as $query){
@DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Database query");
if(!@mysql_query($query,$new_connection)){
- msg_dialog::display(_("Error"), msgPool::dbquery("GOfon", mysql_error()), ERROR_DIALOG);
+ $this->generate_error = msgPool::dbquery("GOfon",@mysql_error($old_connection));
return false;
}
}
$this->phoneNumbers[$number]= $number;
$this->is_modified= TRUE;
} else {
- msg_dialog::display(_("Error"), _("Phone number is invalid!"), ERROR_DIALOG);
+ msg_dialog::display(_("Error"), msgPool::invalid("Phone number"), ERROR_DIALOG);
}
}
}
if(empty($this->goFonHomeServer)){
- $message[] = _("Please select a valid goFonHomeServer.");
+ $message[] = msgPool::invalid(_("Home server"));
}
if((strlen($this->goFonVoicemailPIN)==0)||(strlen($this->goFonVoicemailPIN)>4)){
- $message[]=(_("Voicemail PIN must be between 1-4 characters."));
+ $message[]= msgPool::invalid(_("Voicemail PIN"),"","",_("Between 1-4 charactes"));
}else{
if(preg_match("/[^0-9]/",$this->goFonVoicemailPIN)){
- $message[]=(_("The specified Voicemail PIN contains invalid characters, only numeric values are allowed here."));
+ $message[]= msgPool::invalid(_("Voicemail PIN"),preg_replace("/[0-9]/","X",$this->goFonVoicemailPIN),"/X/");
}
}
if(preg_match("/[^0-9a-z]/i",$this->goFonPIN)){
- $message[]=(_("The specified phone PIN contains invalid characters, only aphanumeric values are allowed here."));
+ $message[]= msgPool::invalid(_("Phone PIN"),preg_replace("/[0-9a-z]/i","X",$this->goFonPIN),"/X/");
}
if ($this->initially_was_account != $this->is_account || $this->is_modified){
/* We need at least one phone number */
if (count($this->phoneNumbers) == 0){
- $message[]= sprintf(_("You need to specify at least one phone number!"));
+ $message[]= msgPool::required("Phone number");
}
/* check for ! in any parameter setting*/
if(isset($this->macroarray[$this->macro])){
foreach($this->macroarray[$this->macro] as $val){
if((strstr($val['choosen'],"!"))||(strstr($val['choosen'],"#"))){
- $message[] = sprintf(_("The parameter %s contains invalid char. '!,#' is used as delimiter"),$val['name']);
+ $message[] = msgPool::invalid(sprintf(_("macro parameter %s"),$val['name']),$val['choosen'],"/[^\#]/");
}
}
}
// Check if we are connected correctly
if(!$r_con){
- msg_dialog::display(_("Error"), msgPool::dbconnect("GOfon", mysql_error()), ERROR_DIALOG);
+ msg_dialog::display(_("Error"), msgPool::dbconnect("GOfon",@mysql_error()), ERROR_DIALOG);
new log("debug","gofonreport/".get_class($this),"",array(),@mysql_error());
return false;
}
// Test if we have the database selected correctly
if(!$db){
- msg_dialog::display(_("Error"), msgPool::dbselect("GOfon", mysql_error()), ERROR_DIALOG);
+ msg_dialog::display(_("Error"), msgPool::dbselect("GOfon", @mysql_error()), ERROR_DIALOG);
new log("debug","gofonreport/".get_class($this),"",array(),@mysql_error());
return false;
}
foreach($SQL as $query){
@DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Database query");
if(!@mysql_query($query,$r_con)){
- msg_dialog::display(_("Error"), msgPool::dbquery("GOfon", mysql_error()), ERROR_DIALOG);
+ msg_dialog::display(_("Error"), msgPool::dbquery("GOfon",@mysql_error()), ERROR_DIALOG);
return false;
}
}