summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a1c4d41)
raw | patch | inline | side by side (parent: a1c4d41)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 10 Aug 2005 07:15:47 +0000 (07:15 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 10 Aug 2005 07:15:47 +0000 (07:15 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1095 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/gofon/phoneaccount/class_phoneAccount.inc | patch | blob | history |
diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc
index 188dab5c6af3259056d58f8faed4b8ebf2ba39a0..3675bef6ad7dee39db1c9387b7ddefcba48d54f3 100644 (file)
$sip_entry = $sip_data_array;
reset($this->phoneNumbers);
-
$key = key($this->phoneNumbers);
$sip_entry['callerid'] =$this->phoneNumbers[$key];
$sip_entry['mailbox'] =$this->phoneNumbers[$key];
}
- $SQL[]= "DELETE FROM ".$a_SETUP['VOICE_TABLE']." WHERE customer_id='".$this->phoneNumbers[$key]."';";
- $SQL[]= "INSERT INTO ".$a_SETUP['VOICE_TABLE']."
- (`customer_id`,`context`,`mailbox`,`password`,`fullname`,`email`,`pager`)
- VALUES
- ('".$this->phoneNumbers[$key]."','default','".$this->phoneNumbers[$key]."','".$this->goFonPIN."','".$this->sn."','".$mail."','');";
+ $SQL[]= "DELETE FROM ".$a_SETUP['VOICE_TABLE']." WHERE customer_id=".$this->phoneNumbers[$key].";";
// Generate Strings with keys and values
$values = "";
$SQL[] ="INSERT INTO ".$a_SETUP['SIP_TABLE']." (".$keys.") VALUES (".$values.");";
// Delete old entries
+ $first_deleted =false;
foreach($this->a_old_telenums as $s_telenums){
$SQL[] = "DELETE FROM ".$a_SETUP['EXT_TABLE']." WHERE exten='".$s_telenums."';\n";
+ if(!$first_deleted){
+ $first_deleted=true;
+ $SQL[] = "DELETE FROM ".$a_SETUP['VOICE_TABLE']." WHERE customer_id=".$s_telenums.";";
+ }
}
+ reset($this->phoneNumbers);
+ $key = key($this->phoneNumbers);
+
+ $SQL[]= "INSERT INTO ".$a_SETUP['VOICE_TABLE']."
+ (`customer_id`,`context`,`mailbox`,`password`,`fullname`,`email`,`pager`)
+ VALUES
+ ('".$this->phoneNumbers[$key]."','default','".$this->phoneNumbers[$key]."','".$this->goFonPIN."','".$this->sn."','".$mail."','');";
+
$i_is_accounted=false;
// Entension entries Hint / Dial / Goto