From: hickert Date: Tue, 4 Dec 2007 07:52:46 +0000 (+0000) Subject: Fixed phoneAccount. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e844d9861bba72807f18c2650cef1ceaec269b88;p=gosa.git Fixed phoneAccount. - If phonenumber is changed the old number(s) will be removed now. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7989 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc index 35b134d4f..b35d41960 100644 --- a/plugins/gofon/phoneaccount/class_phoneAccount.inc +++ b/plugins/gofon/phoneaccount/class_phoneAccount.inc @@ -477,7 +477,7 @@ class phoneAccount extends plugin **********************/ /* Check if there is an old entry - * If there is en old entry, get callerid and remove voicemail and extensions too + * If there is an old entry, get callerid and remove voicemail and extensions */ if($old_connection){ $query = "SELECT id,name,callerid FROM ".$a_Remove['SIP_TABLE']." WHERE name='".$this->uid."';"; @@ -496,7 +496,6 @@ class phoneAccount extends plugin foreach($query_a as $qry){ if(!mysql_query($qry,$old_connection)){ - echo $qry; echo mysql_error($old_connection); } } @@ -677,6 +676,9 @@ class phoneAccount extends plugin /* Remove old entries */ $query = array(); $query[]= "DELETE FROM ".$a_New['EXT_TABLE']." WHERE exten=\"".$this->uid."\";"; + foreach($oldnums as $s_telenums){ + $query[]= "DELETE FROM ".$a_New['EXT_TABLE']." WHERE exten=\"".$s_telenums."\";"; + } foreach($newnums as $s_telenums){ $query[]= "DELETE FROM ".$a_New['EXT_TABLE']." WHERE exten=\"".$s_telenums."\";"; }