Devices: Fix default values (#7545)

* Devices: Fix default values

* Update device_profile_edit.php

* Update device_vendor_edit.php

* Update device_vendor_function_edit.php

* Email Template Edit: Fix enabled default value

* Update email_template_edit.php

* Update email_template_edit.php
This commit is contained in:
Alex
2025-10-03 14:56:41 -07:00
committed by GitHub
parent 57f6927119
commit 3a0c26d694
5 changed files with 16 additions and 4 deletions

View File

@@ -544,6 +544,9 @@
$domains = $database->select($sql, null, 'all');
unset($sql, $parameters);
//set the defaults
if ($device_enabled === null) { $device_enabled = true; }
//use the device address to get the vendor
if (empty($device_vendor)) {
//get the device vendor using the device address
@@ -593,7 +596,7 @@
$device_lines[$x]['auth_id'] = '';
$device_lines[$x]['password'] = '';
$device_lines[$x]['shared_line'] = '';
$device_lines[$x]['enabled'] = false;
$device_lines[$x]['enabled'] = true;
$device_lines[$x]['sip_port'] = $settings->get('provision', 'line_sip_port', '5060');
$device_lines[$x]['sip_transport'] = $settings->get('provision', 'line_sip_transport', 'tcp');
$device_lines[$x]['register_expires'] = $settings->get('provision', 'line_register_expires', '120');
@@ -681,7 +684,7 @@
for ($x = 0; $x < $rows; $x++) {
$device_settings[$id]['device_setting_name'] = '';
$device_settings[$id]['device_setting_value'] = '';
$device_settings[$id]['device_setting_enabled'] = false;
$device_settings[$id]['device_setting_enabled'] = true;
$device_settings[$id]['device_setting_description'] = '';
$id++;
}

View File

@@ -334,7 +334,7 @@
$device_profile_keys[$id]['profile_key_line'] = '';
$device_profile_keys[$id]['profile_key_value'] = '';
$device_profile_keys[$id]['profile_key_extension'] = '';
$device_profile_keys[$id]['profile_key_protected'] = '';
$device_profile_keys[$id]['profile_key_protected'] = false;
$device_profile_keys[$id]['profile_key_label'] = '';
$device_profile_keys[$id]['profile_key_icon'] = '';
$id++;
@@ -372,6 +372,9 @@
$device_profile_uuid = null;
}
//set the defaults
if ($device_profile_enabled === null) { $device_profile_enabled = true; }
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);

View File

@@ -136,6 +136,9 @@
unset($sql, $parameters, $row);
}
//set the defaults
if ($enabled === null) { $enabled = true; }
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);

View File

@@ -272,6 +272,9 @@
$groups = $database->select($sql, $parameters ?? null, 'all');
unset($sql, $parameters, $sql_where, $index);
//set the defaults
if ($enabled === null) { $enabled = true; }
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);