diff --git a/app/extensions/app_config.php b/app/extensions/app_config.php index 1f7bee03d4..9b4983c84b 100644 --- a/app/extensions/app_config.php +++ b/app/extensions/app_config.php @@ -212,6 +212,9 @@ $apps[$x]['permissions'][$y]['groups'][] = "admin"; $apps[$x]['permissions'][$y]['groups'][] = "user"; $y++; + $apps[$x]['permissions'][$y]['name'] = "extension_max_registrations"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $y++; $apps[$x]['permissions'][$y]['name'] = "extension_limit"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $apps[$x]['permissions'][$y]['groups'][] = "admin"; @@ -435,6 +438,10 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "max_registrations"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "limit_max"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; diff --git a/app/extensions/app_languages.php b/app/extensions/app_languages.php index 5b4801b597..cf253fc310 100644 --- a/app/extensions/app_languages.php +++ b/app/extensions/app_languages.php @@ -1100,6 +1100,27 @@ $text['label-line']['ru-ru'] = "Линия"; $text['label-line']['sv-se'] = "Linje"; $text['label-line']['uk-ua'] = ""; +$text['label-max_registrations']['en-us'] = "Max Registrations"; +$text['label-max_registrations']['en-gb'] = "Max Registrations"; +$text['label-max_registrations']['ar-eg'] = "Max Registrations"; +$text['label-max_registrations']['de-at'] = "Max Registrations"; +$text['label-max_registrations']['de-ch'] = "Max Registrations"; +$text['label-max_registrations']['de-de'] = "Max Registrations"; +$text['label-max_registrations']['es-cl'] = "Max Registrations"; +$text['label-max_registrations']['es-mx'] = "Max Registrations"; +$text['label-max_registrations']['fr-ca'] = "Max Registrations"; +$text['label-max_registrations']['fr-fr'] = "Max Registrations"; +$text['label-max_registrations']['he-il'] = "Max Registrations"; +$text['label-max_registrations']['it-it'] = "Max Registrations"; +$text['label-max_registrations']['nl-nl'] = "Max Registrations"; +$text['label-max_registrations']['pl-pl'] = "Max Registrations"; +$text['label-max_registrations']['pt-br'] = "Max Registrations"; +$text['label-max_registrations']['pt-pt'] = "Max Registrations"; +$text['label-max_registrations']['ro-ro'] = "Max Registrations"; +$text['label-max_registrations']['ru-ru'] = "Max Registrations"; +$text['label-max_registrations']['sv-se'] = "Max Registrations"; +$text['label-max_registrations']['uk-ua'] = "Max Registrations"; + $text['label-limit_max']['en-us'] = "Limit Max"; $text['label-limit_max']['en-gb'] = "Limit Max"; $text['label-limit_max']['ar-eg'] = ""; @@ -2410,6 +2431,27 @@ $text['description-missed_call']['ru-ru'] = "Выберите тип уведо $text['description-missed_call']['sv-se'] = "Välj typ anmälan, och ange lämplig destination."; $text['description-missed_call']['uk-ua'] = "Виберіть тип повідомлення, і ввести відповідний пункт призначення."; +$text['description-max_registrations']['en-us'] = "Enter the maximum registration allowed for this user"; +$text['description-max_registrations']['en-gb'] = "Enter the maximum registration allowed for this user"; +$text['description-max_registrations']['ar-eg'] = "Enter the maximum registration allowed for this user"; +$text['description-max_registrations']['de-at'] = "Enter the maximum registration allowed for this user"; +$text['description-max_registrations']['de-ch'] = "Enter the maximum registration allowed for this user"; +$text['description-max_registrations']['de-de'] = "Enter the maximum registration allowed for this user"; +$text['description-max_registrations']['es-cl'] = "Enter the maximum registration allowed for this user"; +$text['description-max_registrations']['es-mx'] = "Enter the maximum registration allowed for this user"; +$text['description-max_registrations']['fr-ca'] = "Enter the maximum registration allowed for this user"; +$text['description-max_registrations']['fr-fr'] = "Enter the maximum registration allowed for this user"; +$text['description-max_registrations']['he-il'] = "Enter the maximum registration allowed for this user"; +$text['description-max_registrations']['it-it'] = "Enter the maximum registration allowed for this user"; +$text['description-max_registrations']['nl-nl'] = "Enter the maximum registration allowed for this user"; +$text['description-max_registrations']['pl-pl'] = "Enter the maximum registration allowed for this user"; +$text['description-max_registrations']['pt-br'] = "Enter the maximum registration allowed for this user"; +$text['description-max_registrations']['pt-pt'] = "Enter the maximum registration allowed for this user"; +$text['description-max_registrations']['ro-ro'] = "Enter the maximum registration allowed for this user"; +$text['description-max_registrations']['ru-ru'] = "Enter the maximum registration allowed for this user"; +$text['description-max_registrations']['sv-se'] = "Enter the maximum registration allowed for this user"; +$text['description-max_registrations']['uk-ua'] = "Enter the maximum registration allowed for this user"; + $text['description-limit_max']['en-us'] = "Enter the max number of outgoing calls for this user."; $text['description-limit_max']['en-gb'] = "Enter the max number of outgoing calls for this user."; $text['description-limit_max']['ar-eg'] = ""; diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php index 89a6319d1f..1198e81c25 100644 --- a/app/extensions/extension_edit.php +++ b/app/extensions/extension_edit.php @@ -102,6 +102,7 @@ $directory_last_name = $_POST["directory_last_name"]; $directory_visible = $_POST["directory_visible"]; $directory_exten_visible = $_POST["directory_exten_visible"]; + $max_registrations = $_POST["max_registrations"]; $limit_max = $_POST["limit_max"]; $limit_destination = $_POST["limit_destination"]; //$device_uuid = $_POST["device_uuid"]; @@ -420,6 +421,10 @@ $array["extensions"][$i]["directory_visible"] = $directory_visible; $array["extensions"][$i]["directory_exten_visible"] = $directory_exten_visible; } + if (!permission_exists("extension_max_registrations") && $action == "add") { + $max_registrations = $_SESSION['extension']['max_registrations']['numeric']; + } + $array["extensions"][$i]["max_registrations"] = $max_registrations; if (permission_exists("extension_limit")) { $array["extensions"][$i]["limit_max"] = $limit_max; $array["extensions"][$i]["limit_destination"] = $limit_destination; @@ -717,6 +722,7 @@ $directory_last_name = $row["directory_last_name"]; $directory_visible = $row["directory_visible"]; $directory_exten_visible = $row["directory_exten_visible"]; + $max_registrations = $row["max_registrations"]; $limit_max = $row["limit_max"]; $limit_destination = $row["limit_destination"]; $user_context = $row["user_context"]; @@ -867,6 +873,7 @@ //set the defaults if (strlen($user_context) == 0) { $user_context = $_SESSION['domain_name']; } + if (strlen($max_registrations) == 0) { $max_registrations = $_SESSION['extension']['max_registrations']['numeric']; } if (strlen($limit_max) == 0) { $limit_max = '5'; } if (strlen($limit_destination) == 0) { $limit_destination = 'error/user_busy'; } if (strlen($call_timeout) == 0) { $call_timeout = '30'; } @@ -1563,6 +1570,19 @@ echo "\n"; } + if (permission_exists("extension_max_registrations")) { + echo "\n"; + echo "\n"; + echo " ".$text['label-max_registrations']."\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-max_registrations']."\n"; + echo "\n"; + echo "\n"; + } + if (permission_exists("extension_limit")) { echo "\n"; echo "\n"; diff --git a/app/scripts/resources/scripts/app/xml_handler/resources/scripts/directory/directory.lua b/app/scripts/resources/scripts/app/xml_handler/resources/scripts/directory/directory.lua index 89a5b3d044..1c46cec82d 100644 --- a/app/scripts/resources/scripts/app/xml_handler/resources/scripts/directory/directory.lua +++ b/app/scripts/resources/scripts/app/xml_handler/resources/scripts/directory/directory.lua @@ -337,6 +337,7 @@ directory_exten_visible = row.directory_exten_visible; limit_max = row.limit_max; call_timeout = row.call_timeout; + max_registrations = row.max_registrations; limit_destination = row.limit_destination; sip_force_contact = row.sip_force_contact; sip_force_expires = row.sip_force_expires; @@ -530,6 +531,7 @@ table.insert(xml, [[ ]]); table.insert(xml, [[ ]]); table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); for key,row in pairs(extension_settings) do if (row.extension_setting_type == 'param') then table.insert(xml, [[ ]]);