From 167c950535b54103c41bf89af59484bd37d8bb7b Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 14 Sep 2005 08:35:43 +0000 Subject: [PATCH] Added check for existence of goFonServer to Macros git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1356 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/gofon/macro/class_gofonMacro.inc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/gofon/macro/class_gofonMacro.inc b/plugins/gofon/macro/class_gofonMacro.inc index a44a48995..c4965f1a6 100755 --- a/plugins/gofon/macro/class_gofonMacro.inc +++ b/plugins/gofon/macro/class_gofonMacro.inc @@ -52,6 +52,8 @@ class macro extends plugin { plugin::plugin ($config, $dn); + unset($_SESSION['config']->data['SERVERS']['FON']); + $ldap= $config->get_ldap_link(); $this->dn = $dn; @@ -85,6 +87,10 @@ class macro extends plugin $tmp = array(); $number = 0; + if(!isset($_SESSION['config']->data['SERVERS']['FON'])){ + print_red(_("There is currently no asterisk server defined. Possibly you are missing a server that handles the asterisk management (goFonServer). \n Your Settings can't be saved to asterisk Database. ")); + } + /* Do we represent a valid group? */ if (!$this->is_account && $this->parent == NULL){ $display= "\"\" ". @@ -170,6 +176,10 @@ class macro extends plugin // Generate MySQL Syntax function generate_mysql_entension_entries($save = false,$delete_only=false,$remove_old_macroname=false){ + if(!isset($_SESSION['config']->data['SERVERS']['FON'])){ + return(true); + } + // Get Configuration for Mysql database Server $a_SETUP = $_SESSION['config']->data['SERVERS']['FON']; -- 2.30.2