From 3bc93fa06ab47efebe22f1b27dfb894df47a152c Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 9 Jan 2007 03:52:44 +0000 Subject: [PATCH] Added some more checks to avoid saving with empty home server git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5480 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/gofon/phoneaccount/class_phoneAccount.inc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc index 9dc1c40ee..8f1f2869a 100644 --- a/plugins/gofon/phoneaccount/class_phoneAccount.inc +++ b/plugins/gofon/phoneaccount/class_phoneAccount.inc @@ -123,6 +123,10 @@ class phoneAccount extends plugin } } + /* Check if previously selected server is still available */ + if($this->is_account && !isset($this->goFonHomeServers[$this->goFonHomeServer])){ + print_red(sprintf(_("The previously selected asterisk home server (%s) is no longer available."),preg_replace("/,/",", ",$this->goFonHomeServer))); + } /* Get available phone hardware * Search for all available phone hardware @@ -1093,6 +1097,14 @@ class phoneAccount extends plugin /* Call common method to give check the hook */ $message= plugin::check(); + if(!count($this->goFonHomeServers)){ + $message[] = _("There must be at least one server with an asterisk database to create a phone account."); + } + + if(empty($this->goFonHomeServer)){ + $message[] = _("Please select a valid goFonHomeServer."); + } + if((strlen($this->goFonVoicemailPIN)==0)||(strlen($this->goFonVoicemailPIN)>4)){ $message[]=(_("Voicemail PIN must be between 1-4 characters.")); }else{ -- 2.30.2