Code

Added some more checks, to prevent saving without valid home server
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 9 Jan 2007 04:01:56 +0000 (04:01 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 9 Jan 2007 04:01:56 +0000 (04:01 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5481 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/gofon/conference/class_phoneConferenceGeneric.inc

index fe4c11cc8bc1a19871a40ae066b07dad96888a9e..464b061aa914bdfb0dced9788d0956ed653d6c8a 100644 (file)
@@ -78,6 +78,7 @@ class conference extends plugin
     if(array_key_exists('config',$_SESSION) &&
        array_key_exists('SERVERS',$_SESSION['config']->data) &&
        array_key_exists('FON',$_SESSION['config']->data['SERVERS']) &&
+       count($_SESSION['config']->data['SERVERS']['FON']) &&
        is_callable("mysql_connect")
        ) {
 
@@ -303,6 +304,12 @@ class conference extends plugin
       $message[] =  $this->is_number_used();
     }
 
+    /* Check if previously selected server is still available */
+    if($this->initially_was_account && !isset($this->goFonHomeServers[$this->goFonHomeServer])){
+      $message[]= sprintf(_("The previously selected asterisk home server (%s) is no longer available."),preg_replace("/,/",", ",$this->goFonHomeServer));
+      return($message);
+    }
+
     if((!empty($this->goFonPIN)||($this->goFonConferenceOption_P=="P"))&&($this->goFonConferenceOption_D=="d")){
       $message[] =_("You have specified a conference 'without PIN' ... please leave the PIN fields empty.");
     }