From abba829aae3b6e121115d84e96fb6d1380778a03 Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Thu, 17 Nov 2016 21:46:25 +0300 Subject: [PATCH] Add. Increment number-alias and MWI account number when generates multiple extensions. (#2078) --- app/extensions/extension_edit.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php index 4210c1702c..2c2f01b943 100644 --- a/app/extensions/extension_edit.php +++ b/app/extensions/extension_edit.php @@ -241,7 +241,7 @@ break; } - //add the extension to the database + //add the user to the database $user_email = ''; if ($_SESSION["user"]["unique"]["text"] != "global") { if ($autogen_users == "true") { @@ -415,6 +415,17 @@ //increment the extension number if ($action != "update") { $extension++; + + if (strlen($number_alias) > 0) { + $number_alias++; + } + + if (strlen($mwi_account) > 0) { + $mwi_account_array = explode('@', $mwi_account); + $mwi_account_array[0]++; + $mwi_account = implode('@', $mwi_account_array); + unset($mwi_account_array); + } } }