From 8b65a5f7bc6d320249cfc199066ab3612bc074ab Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 21 Dec 2006 10:07:15 +0000 Subject: [PATCH] Fixed some error msgs git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5454 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../gofon/phoneaccount/class_phoneAccount.inc | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc index 099a16f5e..dd4bc090e 100644 --- a/plugins/gofon/phoneaccount/class_phoneAccount.inc +++ b/plugins/gofon/phoneaccount/class_phoneAccount.inc @@ -91,22 +91,28 @@ class phoneAccount extends plugin $this->init_HomeServer = $this->goFonHomeServer; /* get config */ + if(!isset($this->goFonHomeServers[$this->goFonHomeServer])){ + print_red(sprintf(_("The specified goFonHomeServer '%s' is not available in GOsa server configuration. Saving this account will create a new entry on the server '%s'. Use cancel if you do not want to create a new entry ignoring old accounts."),$this->goFonHomeServer, $this->goFonHomeServers[0]['DN'])); + + $this->goFonHomeServer = $this->goFonHomeServers[0]['DN']; + $this->init_HomeServer = $this->goFonHomeServers[0]['DN']; + } $cur_cfg = $this->goFonHomeServers[$this->goFonHomeServer]; $r_con = @mysql_pconnect($cur_cfg['SERVER'],$cur_cfg['LOGIN'],$cur_cfg['PASSWORD']); if(!$r_con){ - $this->generate_error = sprintf(_("The MySQL Server '%s' isn't reachable as user '%s', check GOsa log for mysql error."), - $cur_cfg['SERVER'],$cur_cfg['LOGIN']); + print_red( sprintf(_("The MySQL Server '%s' isn't reachable as user '%s', check GOsa log for mysql error."), + $cur_cfg['SERVER'],$cur_cfg['LOGIN'])); gosa_log(mysql_error()); return false; } $db = @mysql_select_db($cur_cfg['DB'],$r_con); if(!$db){ - $this->generate_error = sprintf(_("Can't select database %s on %s."),$cur_cfg['DB'],$cur_cfg['SERVER']); + print_red(sprintf(_("Can't select database %s on %s."),$cur_cfg['DB'],$cur_cfg['SERVER'])); gosa_log(mysql_error()); return false; } - + $first = false; foreach($this->phoneNumbers as $key => $val){ if(!$first){ @@ -416,7 +422,7 @@ class phoneAccount extends plugin $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']); - gosa_log(mysql_error($new_connection)); + gosa_log(@mysql_error($new_connection)); return false; } $new_database = @mysql_select_db($a_New['DB'],$new_connection); @@ -424,7 +430,7 @@ class phoneAccount extends plugin $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']); - gosa_log(mysql_error($new_connection)); + gosa_log( @mysql_error($new_connection)); return false; } @@ -443,7 +449,7 @@ class phoneAccount extends plugin $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']); - gosa_log(mysql_error($old_connection)); + gosa_log(@mysql_error($old_connection)); return false; } $old_database = @mysql_select_db($a_Remove['DB'],$old_connection); @@ -451,7 +457,7 @@ class phoneAccount extends plugin $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']); - gosa_log(mysql_error($old_connection)); + gosa_log(@mysql_error($old_connection)); return false; } } @@ -698,7 +704,6 @@ class phoneAccount extends plugin $EXT[$i]['exten'] = $s_telenums; $EXT[$i]['priority']= "Hint"; $EXT[$i]['app'] = 'SIP/'.$this->uid; - $EXT[$i]['appdata'] = ''; $i ++; /* SetCID */ //$EXT[$i]['context'] = 'GOsa'; -- 2.30.2