From: hickert Date: Tue, 9 Jan 2007 05:22:23 +0000 (+0000) Subject: Skip account removing if database is not accessible X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7e478e9f4ef4a2b755495217821be2b7fbd8fccd;p=gosa.git Skip account removing if database is not accessible git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5487 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/gofon/conference/class_phoneConferenceGeneric.inc b/plugins/gofon/conference/class_phoneConferenceGeneric.inc index acbb64090..c4feeee8c 100644 --- a/plugins/gofon/conference/class_phoneConferenceGeneric.inc +++ b/plugins/gofon/conference/class_phoneConferenceGeneric.inc @@ -224,9 +224,11 @@ class conference extends plugin $str = $this->SQL_remove_me(true); if($str){ print_red($str); + return false; } }else{ - print_red(_("Could not remove the conference entry from database on home server (%s). Please check your asterisk database configurations and remove this entry from database manually, if necessary.")); + print_red(_("Could not remove the conference entry from database on home server (%s). Please check your asterisk database configuration.")); + return false; } /* Remove ldap entry */ diff --git a/plugins/gofon/macro/class_gofonMacro.inc b/plugins/gofon/macro/class_gofonMacro.inc index 85c011751..2d59b8189 100755 --- a/plugins/gofon/macro/class_gofonMacro.inc +++ b/plugins/gofon/macro/class_gofonMacro.inc @@ -442,9 +442,11 @@ class macro extends plugin $str = $this->remove_from_database(true); if($str){ print_red($str); + return false; } }else{ - print_red(_("Could not remove the macro entry from asterisk databases. Please check your asterisk database configurations and remove this entry from database manually, if necessary.")); + print_red(_("Could not remove the macro entry from asterisk databases. Please check your asterisk database configurations.")); + return false; } /* Remove phone macro */ diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc index 8f1f2869a..a3d5bc17b 100644 --- a/plugins/gofon/phoneaccount/class_phoneAccount.inc +++ b/plugins/gofon/phoneaccount/class_phoneAccount.inc @@ -123,11 +123,6 @@ 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 */ @@ -1393,6 +1388,15 @@ class phoneAccount extends plugin $this->goFonPIN = $_POST['goFonPIN']; } } + + + function allow_remove() + { + /* Check if previously selected server is still available */ + if($this->initially_was_account && !isset($this->goFonHomeServers[$this->goFonHomeServer])){ + return sprintf(_("The previously selected asterisk home server (%s) is no longer available. Remove aborted."),preg_replace("/,/",", ",$this->goFonHomeServer)); + } + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: