Code

Display warnings if database is not reachable when removing conference from ldap
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 9 Jan 2007 04:23:13 +0000 (04:23 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 9 Jan 2007 04:23:13 +0000 (04:23 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5482 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/gofon/conference/class_phoneConferenceGeneric.inc

index 464b061aa914bdfb0dced9788d0956ed653d6c8a..acbb64090c008778323390436efa8af6787e34cf 100644 (file)
@@ -217,11 +217,19 @@ class conference extends plugin
 
   function remove_from_parent()
   {
-    $str = $this->SQL_remove_me(true); 
-    if($str){
-      print_red($str);
+    /* Check if 'old' home server is available in gosa FON server configuration 
+     * Try to remove this entry from database and display errors.  
+     */
+    if(isset($this->goFonHomeServers[$this->goFonHomeServer])){
+      $str = $this->SQL_remove_me(true); 
+      if($str){
+        print_red($str);
+      }
+    }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."));
     }
 
+    /* Remove ldap entry */
     $ldap= $this->config->get_ldap_link();
     $ldap->cd ($this->dn);
     $ldap->recursive_remove();
@@ -259,7 +267,7 @@ class conference extends plugin
      * Check currently selected home server 
      ********************/
 
-    $cfg_Current  = $this->goFonHomeServers[$this->goFonHomeServer] ;
+    $cfg_Current  = $this->goFonHomeServers[$this->goFonHomeServer];
     $r_current    =  @mysql_pconnect($cfg_Current['SERVER'],$cfg_Current['LOGIN'],$cfg_Current['PASSWORD']);
     if(!$r_current){
       gosa_log(@mysql_error($r_current));