diff --git a/app/bridges/bridge_edit.php b/app/bridges/bridge_edit.php index e1539152c3..0620ecaf82 100644 --- a/app/bridges/bridge_edit.php +++ b/app/bridges/bridge_edit.php @@ -50,11 +50,11 @@ } //get http post variables and set them to php variables - if (is_array($_POST)) { + if (count($_POST) > 0) { $bridge_uuid = $_POST["bridge_uuid"]; $bridge_name = $_POST["bridge_name"]; $bridge_destination = $_POST["bridge_destination"]; - $bridge_enabled = $_POST["bridge_enabled"]; + $bridge_enabled = $_POST["bridge_enabled"] ?: 'false'; $bridge_description = $_POST["bridge_description"]; } @@ -162,6 +162,9 @@ unset($sql, $parameters, $row); } +//set the defaults + if (strlen($bridge_enabled) == 0) { $bridge_enabled = 'true'; } + //create token $object = new token; $token = $object->create($_SERVER['PHP_SELF']); diff --git a/app/call_block/call_block_edit.php b/app/call_block/call_block_edit.php index c9f1e4e545..7f9154049a 100644 --- a/app/call_block/call_block_edit.php +++ b/app/call_block/call_block_edit.php @@ -264,6 +264,9 @@ unset($sql, $parameters, $row); } +//set the defaults + if (strlen($call_block_enabled) == 0) { $call_block_enabled = 'true'; } + //get the extensions if (permission_exists('call_block_all') || permission_exists('call_block_extension')) { $sql = "select extension_uuid, extension, number_alias, user_context, description from v_extensions "; diff --git a/app/call_flows/call_flow_edit.php b/app/call_flows/call_flow_edit.php index 226851708f..de294f51c3 100644 --- a/app/call_flows/call_flow_edit.php +++ b/app/call_flows/call_flow_edit.php @@ -59,7 +59,7 @@ $destination = new destinations; //get http post variables and set them to php variables - if (is_array($_POST)) { + if (count($_POST) > 0) { //set the variables from the http values $call_flow_uuid = $_POST["call_flow_uuid"]; @@ -76,7 +76,7 @@ $call_flow_alternate_sound = $_POST["call_flow_alternate_sound"]; $call_flow_alternate_destination = $_POST["call_flow_alternate_destination"]; $call_flow_context = $_POST["call_flow_context"]; - $call_flow_enabled = $_POST["call_flow_enabled"]; + $call_flow_enabled = $_POST["call_flow_enabled"] ?: 'false'; $call_flow_description = $_POST["call_flow_description"]; //seperate the action and the param @@ -356,6 +356,9 @@ $call_flow_context = $_SESSION['domain_name']; } +//set the defaults + if (strlen($call_flow_enabled) == 0) { $call_flow_enabled = 'true'; } + //get the recordings $sql = "select recording_name, recording_filename from v_recordings "; $sql .= "where domain_uuid = :domain_uuid "; diff --git a/app/conference_controls/conference_control_detail_edit.php b/app/conference_controls/conference_control_detail_edit.php index 429b9ab9b1..c2ff10ae6b 100644 --- a/app/conference_controls/conference_control_detail_edit.php +++ b/app/conference_controls/conference_control_detail_edit.php @@ -130,6 +130,9 @@ unset($sql, $parameters, $row); } +//set the defaults + if (strlen($control_enabled) == 0) { $control_enabled = 'true'; } + //create token $object = new token; $token = $object->create($_SERVER['PHP_SELF']); diff --git a/app/conference_controls/conference_control_edit.php b/app/conference_controls/conference_control_edit.php index 90ddf34911..764785d7d2 100644 --- a/app/conference_controls/conference_control_edit.php +++ b/app/conference_controls/conference_control_edit.php @@ -31,9 +31,9 @@ } //get http post variables and set them to php variables - if (is_array($_POST)) { + if (count($_POST) > 0) { $control_name = $_POST["control_name"]; - $control_enabled = $_POST["control_enabled"]; + $control_enabled = $_POST["control_enabled"] ?: 'false'; $control_description = $_POST["control_description"]; } @@ -123,6 +123,9 @@ unset($sql, $parameters, $row); } +//set the defaults + if (strlen($control_enabled) == 0) { $control_enabled = 'true'; } + //create token $object = new token; $token = $object->create($_SERVER['PHP_SELF']); diff --git a/app/conference_profiles/conference_profile_edit.php b/app/conference_profiles/conference_profile_edit.php index 1cf6aba71c..d20f2aeaf2 100644 --- a/app/conference_profiles/conference_profile_edit.php +++ b/app/conference_profiles/conference_profile_edit.php @@ -33,7 +33,7 @@ //get http post variables and set them to php variables if (count($_POST) > 0) { $profile_name = $_POST["profile_name"]; - $profile_enabled = $_POST["profile_enabled"]; + $profile_enabled = $_POST["profile_enabled"] ?: 'false'; $profile_description = $_POST["profile_description"]; } //check to see if the http post exists @@ -120,6 +120,9 @@ unset($sql, $parameters); } +//set the defaults + if (strlen($profile_enabled) == 0) { $profile_enabled = 'true'; } + //create token $object = new token; $token = $object->create($_SERVER['PHP_SELF']); @@ -158,10 +161,18 @@ echo " ".$text['label-profile_enabled']."\n"; echo "\n"; echo "\n"; - echo " \n"; + if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { + echo " \n"; + } + else { + echo " \n"; + } echo "
\n"; echo $text['description-profile_enabled']."\n"; echo "\n"; diff --git a/app/conference_profiles/conference_profile_param_edit.php b/app/conference_profiles/conference_profile_param_edit.php index baf95f7df3..f371a3b5c0 100644 --- a/app/conference_profiles/conference_profile_param_edit.php +++ b/app/conference_profiles/conference_profile_param_edit.php @@ -128,6 +128,9 @@ unset($sql, $parameters); } +//set the defaults + if (strlen($profile_param_enabled) == 0) { $profile_param_enabled = 'true'; } + //create token $object = new token; $token = $object->create($_SERVER['PHP_SELF']); diff --git a/app/conferences/conference_edit.php b/app/conferences/conference_edit.php index 3641f7617f..b8993a31f7 100644 --- a/app/conferences/conference_edit.php +++ b/app/conferences/conference_edit.php @@ -296,6 +296,9 @@ unset($sql, $parameters, $row); } +//set the defaults + if (strlen($conference_enabled) == 0) { $conference_enabled = 'true'; } + //get the conference profiles $sql = "select * "; $sql .= "from v_conference_profiles "; diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index 7e54d0cd80..40f03cffd9 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -1127,6 +1127,7 @@ if (strlen($destination_order) == 0) { $destination_order = '100'; } if (strlen($destination_type) == 0) { $destination_type = 'inbound'; } if (strlen($destination_context) == 0) { $destination_context = 'public'; } + if (strlen($destination_enabled) == 0) { $destination_enabled = 'true'; } if ($destination_type =="outbound") { $destination_context = $_SESSION['domain_name']; } if ($destination_type =="local") { $destination_context = $_SESSION['domain_name']; } diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php index 8c92ab0546..1dc9edc576 100644 --- a/app/devices/device_edit.php +++ b/app/devices/device_edit.php @@ -527,6 +527,9 @@ unset($sql, $parameters, $row); } +//set the defaults + if (strlen($device_enabled) == 0) { $device_enabled = 'true'; } + //use the mac address to get the vendor if (strlen($device_vendor) == 0) { //get the device vendor using the mac address diff --git a/app/devices/device_profile_edit.php b/app/devices/device_profile_edit.php index 3653b48218..dfd7d66153 100644 --- a/app/devices/device_profile_edit.php +++ b/app/devices/device_profile_edit.php @@ -242,6 +242,9 @@ unset ($sql, $parameters); } +//set the defaults + if (strlen($device_profile_enabled) == 0) { $device_profile_enabled = 'true'; } + //get the child data if (strlen($device_profile_uuid) > 0) { $sql = "select * from v_device_profile_keys "; diff --git a/app/devices/device_vendor_edit.php b/app/devices/device_vendor_edit.php index 45df383066..113aa575fd 100644 --- a/app/devices/device_vendor_edit.php +++ b/app/devices/device_vendor_edit.php @@ -140,6 +140,9 @@ unset($sql, $parameters, $row); } +//set the defaults + if (strlen($enabled) == 0) { $enabled = true; } + //create token $object = new token; $token = $object->create($_SERVER['PHP_SELF']); diff --git a/app/email_templates/email_template_edit.php b/app/email_templates/email_template_edit.php index f28cea1dbe..b446cf155c 100644 --- a/app/email_templates/email_template_edit.php +++ b/app/email_templates/email_template_edit.php @@ -52,7 +52,7 @@ } //get http post variables and set them to php variables - if (is_array($_POST)) { + if (count($_POST) > 0) { $domain_uuid = $_POST["domain_uuid"]; $template_language = $_POST["template_language"]; $template_category = $_POST["template_category"]; @@ -60,7 +60,7 @@ $template_subject = $_POST["template_subject"]; $template_body = $_POST["template_body"]; $template_type = $_POST["template_type"]; - $template_enabled = $_POST["template_enabled"]; + $template_enabled = $_POST["template_enabled"] ?: 'false'; $template_description = $_POST["template_description"]; } @@ -168,6 +168,9 @@ unset($sql, $parameters, $row); } +//set the defaults + if (strlen($template_enabled) == 0) { $template_enabled = 'true'; } + //load editor preferences/defaults $setting_size = $_SESSION["editor"]["font_size"]["text"] != '' ? $_SESSION["editor"]["font_size"]["text"] : '12px'; $setting_theme = $_SESSION["editor"]["theme"]["text"] != '' ? $_SESSION["editor"]["theme"]["text"] : 'cobalt'; diff --git a/app/extension_settings/extension_setting_edit.php b/app/extension_settings/extension_setting_edit.php index 4c869d1b31..71dd53842e 100644 --- a/app/extension_settings/extension_setting_edit.php +++ b/app/extension_settings/extension_setting_edit.php @@ -61,12 +61,12 @@ } //get http post variables and set them to php variables - if (is_array($_POST)) { + if (count($_POST) > 0) { $domain_uuid = $_POST["domain_uuid"]; $extension_setting_type = $_POST["extension_setting_type"]; $extension_setting_name = $_POST["extension_setting_name"]; $extension_setting_value = $_POST["extension_setting_value"]; - $extension_setting_enabled = $_POST["extension_setting_enabled"]; + $extension_setting_enabled = $_POST["extension_setting_enabled"] ?: 'false'; $extension_setting_description = $_POST["extension_setting_description"]; } @@ -213,6 +213,9 @@ unset($sql, $parameters, $row); } +//set the defaults + if (strlen($extension_setting_enabled) == 0) { $extension_setting_enabled = 'true'; } + //create token $object = new token; $token = $object->create($_SERVER['PHP_SELF']); diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php index 8d9a86bd78..2a4469086c 100644 --- a/app/extensions/extension_edit.php +++ b/app/extensions/extension_edit.php @@ -136,7 +136,7 @@ $absolute_codec_string = $_POST["absolute_codec_string"]; $force_ping = $_POST["force_ping"]; $dial_string = $_POST["dial_string"]; - $enabled = $_POST["enabled"]; + $enabled = $_POST["enabled"] ?: 'false'; $description = $_POST["description"]; //outbound caller id number - only allow numeric and + @@ -1005,6 +1005,7 @@ if (strlen($user_record) == 0) { $user_record = $_SESSION['extension']['user_record_default']['text']; } if (strlen($voicemail_transcription_enabled) == 0) { $voicemail_transcription_enabled = $_SESSION['voicemail']['transcription_enabled_default']['boolean']; } if (strlen($voicemail_enabled) == 0) { $voicemail_enabled = $_SESSION['voicemail']['enabled_default']['boolean']; } + if (strlen($enabled) == 0) { $enabled = 'true'; } //create token $object = new token; diff --git a/app/modules/module_edit.php b/app/modules/module_edit.php index 8f19a0d81c..5e504182f1 100644 --- a/app/modules/module_edit.php +++ b/app/modules/module_edit.php @@ -163,6 +163,10 @@ unset($sql, $parameters, $row); } +//set the defaults + if (strlen($module_enabled) == 0) { $module_enabled = 'true'; } + if (strlen($module_default_enabled) == 0) { $module_default_enabled = 'true'; } + //create token $object = new token; $token = $object->create($_SERVER['PHP_SELF']); diff --git a/app/phrases/phrase_edit.php b/app/phrases/phrase_edit.php index ce67432dc1..ac6d89da3e 100644 --- a/app/phrases/phrase_edit.php +++ b/app/phrases/phrase_edit.php @@ -286,6 +286,9 @@ unset($sql, $parameters, $row); } +//set the defaults + if (strlen($phrase_enabled) == 0) { $phrase_enabled = 'true'; } + //get the phrase details if (is_uuid($phrase_uuid)) { $sql = "select * from v_phrase_details "; diff --git a/app/ring_groups/ring_group_edit.php b/app/ring_groups/ring_group_edit.php index 1c908b18a2..6605da8563 100644 --- a/app/ring_groups/ring_group_edit.php +++ b/app/ring_groups/ring_group_edit.php @@ -503,7 +503,7 @@ } } -//set the default +//set the defaults $destination_delay_max = $_SESSION['ring_group']['destination_delay_max']['numeric']; $destination_timeout_max = $_SESSION['ring_group']['destination_timeout_max']['numeric']; if (strlen($ring_group_ringback) == 0) { @@ -512,6 +512,7 @@ if (strlen($ring_group_call_timeout) == 0) { $ring_group_call_timeout = '30'; } + if (strlen($ring_group_enabled) == 0) { $ring_group_enabled = 'true'; } //get the ring group destination array if ($action == "add") { diff --git a/app/sip_profiles/sip_profile_edit.php b/app/sip_profiles/sip_profile_edit.php index d3f7520c70..bca03fd3f0 100644 --- a/app/sip_profiles/sip_profile_edit.php +++ b/app/sip_profiles/sip_profile_edit.php @@ -55,7 +55,7 @@ } //get http post variables and set them to php variables - if (is_array($_POST)) { + if (count($_POST) > 0) { //process the http post data by submitted action if ($_POST['action'] != '' && is_uuid($_POST['sip_profile_uuid'])) { @@ -259,6 +259,9 @@ unset($sql, $parameters, $row); } +//set the defaults + if (strlen($sip_profile_enabled) == 0) { $sip_profile_enabled = 'true'; } + //get the child data $sql = "select * from v_sip_profile_settings "; $sql .= "where sip_profile_uuid = :sip_profile_uuid "; diff --git a/app/sofia_global_settings/sofia_global_setting_edit.php b/app/sofia_global_settings/sofia_global_setting_edit.php index 3e51548e4f..2577df800c 100644 --- a/app/sofia_global_settings/sofia_global_setting_edit.php +++ b/app/sofia_global_settings/sofia_global_setting_edit.php @@ -156,6 +156,9 @@ unset($sql, $parameters, $row); } +//set the defaults + if (strlen($global_setting_enabled) == 0) { $global_setting_enabled = true; } + //create token $object = new token; $token = $object->create($_SERVER['PHP_SELF']); @@ -226,21 +229,18 @@ echo " ".$text['label-global_setting_enabled']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; + echo " \n"; } else { - echo " \n"; + echo " \n"; } - if ($global_setting_enabled == "false") { - echo " \n"; - } - else { - echo " \n"; - } - echo " \n"; echo "
\n"; echo $text['description-global_setting_enabled']."\n"; echo "\n"; @@ -267,4 +267,4 @@ //include the footer require_once "resources/footer.php"; -?> \ No newline at end of file +?> diff --git a/app/streams/stream_edit.php b/app/streams/stream_edit.php index eb65d5269d..054f896463 100644 --- a/app/streams/stream_edit.php +++ b/app/streams/stream_edit.php @@ -53,12 +53,12 @@ } //get http post variables and set them to php variables - if (is_array($_POST)) { + if (count($_POST) > 0) { $domain_uuid = $_POST['domain_uuid']; $stream_uuid = $_POST["stream_uuid"]; $stream_name = $_POST["stream_name"]; $stream_location = $_POST["stream_location"]; - $stream_enabled = $_POST["stream_enabled"]; + $stream_enabled = $_POST["stream_enabled"] ?: 'false'; $stream_description = $_POST["stream_description"]; } @@ -154,6 +154,9 @@ unset($sql, $parameters, $row); } +//set the defaults + if (strlen($stream_enabled) == 0) { $stream_enabled = 'true'; } + //need stream_all permission to edit a global stream if (!permission_exists('stream_all') && $domain_uuid == null) { header('Location: streams.php'); diff --git a/app/time_conditions/time_condition_edit.php b/app/time_conditions/time_condition_edit.php index 6f91546f03..d32f6aa583 100644 --- a/app/time_conditions/time_condition_edit.php +++ b/app/time_conditions/time_condition_edit.php @@ -664,6 +664,7 @@ //set the defaults if (strlen($dialplan_context) == 0) { $dialplan_context = $_SESSION['domain_name']; } + if (strlen($dialplan_enabled) == 0) { $dialplan_enabled = 'true'; } //create token $object = new token; diff --git a/app/vars/var_edit.php b/app/vars/var_edit.php index 25eeeb51e5..5245a6dbda 100644 --- a/app/vars/var_edit.php +++ b/app/vars/var_edit.php @@ -178,6 +178,9 @@ unset($sql, $parameters); } +//set the defaults + if (strlen($var_enabled) == 0) { $var_enabled = 'true'; } + //create token $object = new token; $token = $object->create($_SERVER['PHP_SELF']); diff --git a/app/voicemails/voicemail_edit.php b/app/voicemails/voicemail_edit.php index 5d67fdeb02..e12cf9c3d7 100644 --- a/app/voicemails/voicemail_edit.php +++ b/app/voicemails/voicemail_edit.php @@ -319,11 +319,11 @@ //remove the spaces $voicemail_mail_to = str_replace(" ", "", $voicemail_mail_to); -//set defaults - if (strlen($voicemail_local_after_email) == 0) { $voicemail_local_after_email = "true"; } - if (strlen($voicemail_enabled) == 0) { $voicemail_enabled = "true"; } +//set the defaults + if (strlen($voicemail_local_after_email) == 0) { $voicemail_local_after_email = 'true'; } + if (strlen($voicemail_enabled) == 0) { $voicemail_enabled = 'true'; } if (strlen($voicemail_transcription_enabled) == 0) { $voicemail_transcription_enabled = $_SESSION['voicemail']['transcription_enabled_default']['boolean']; } - if (strlen($voicemail_tutorial) == 0) { $voicemail_tutorial = "false"; } + if (strlen($voicemail_tutorial) == 0) { $voicemail_tutorial = 'false'; } //get the greetings list $sql = "select * from v_voicemail_greetings "; diff --git a/core/dashboard/dashboard_edit.php b/core/dashboard/dashboard_edit.php index 1ee117012c..126e6fa9b5 100644 --- a/core/dashboard/dashboard_edit.php +++ b/core/dashboard/dashboard_edit.php @@ -54,7 +54,7 @@ } //get http post variables and set them to php variables - if (is_array($_POST)) { + if (count($_REQUEST) > 0) { $dashboard_name = $_POST["dashboard_name"]; $dashboard_path = $_POST["dashboard_path"]; $dashboard_groups = $_POST["dashboard_groups"]; @@ -224,6 +224,9 @@ unset($sql, $parameters, $row); } +//set the defaults + if (strlen($dashboard_enabled) == 0) { $dashboard_enabled = true; } + //get the child data if (is_uuid($dashboard_uuid)) { $sql = "select "; @@ -477,8 +480,8 @@ } else { echo " \n"; } echo "
\n"; diff --git a/core/default_settings/default_setting_edit.php b/core/default_settings/default_setting_edit.php index 97f037975b..a28c958304 100644 --- a/core/default_settings/default_setting_edit.php +++ b/core/default_settings/default_setting_edit.php @@ -62,7 +62,7 @@ $default_setting_name = strtolower($_POST["default_setting_name"]); $default_setting_value = $_POST["default_setting_value"]; $default_setting_order = $_POST["default_setting_order"]; - $default_setting_enabled = $_POST["default_setting_enabled"]; + $default_setting_enabled = $_POST["default_setting_enabled"] ?: 'false'; $default_setting_description = $_POST["default_setting_description"]; } @@ -246,6 +246,9 @@ unset($sql, $parameters); } +//set the defaults + if (strlen($default_setting_enabled) == 0) { $default_setting_enabled = 'true'; } + //create token $object = new token; $token = $object->create($_SERVER['PHP_SELF']); diff --git a/core/domain_settings/domain_setting_edit.php b/core/domain_settings/domain_setting_edit.php index e46e946cc9..2f9ca5fea2 100644 --- a/core/domain_settings/domain_setting_edit.php +++ b/core/domain_settings/domain_setting_edit.php @@ -348,6 +348,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { unset($sql, $parameters); } +//set the defaults + if (strlen($domain_setting_enabled) == 0) { $domain_setting_enabled = 'true'; } + //create token $object = new token; $token = $object->create($_SERVER['PHP_SELF']); diff --git a/core/domains/domain_edit.php b/core/domains/domain_edit.php index 243d6e9514..e23469d83b 100644 --- a/core/domains/domain_edit.php +++ b/core/domains/domain_edit.php @@ -570,6 +570,9 @@ unset($sql, $parameters, $row); } +//set the defaults + if (strlen($domain_enabled) == 0) { $domain_enabled = 'true'; } + //create token $object = new token; $token = $object->create($_SERVER['PHP_SELF']); diff --git a/core/users/user_edit.php b/core/users/user_edit.php index 1eefa278f4..a3b35728db 100644 --- a/core/users/user_edit.php +++ b/core/users/user_edit.php @@ -137,7 +137,7 @@ $contact_name_family = $_POST["contact_name_family"]; } $group_uuid_name = $_POST["group_uuid_name"]; - $user_enabled = $_POST["user_enabled"]; + $user_enabled = $_POST["user_enabled"] ?: 'false'; if (permission_exists('api_key')) { $api_key = $_POST["api_key"]; } @@ -638,6 +638,9 @@ } } +//set the defaults + if (strlen($user_enabled) == 0) { $user_enabled = "true"; } + //create token $object = new token; $token = $object->create($_SERVER['PHP_SELF']);