[devices] Use the default settings only when adding a device (#6061)

When a device is being updated then we want to persist the old values
This commit is contained in:
agree 2021-10-14 02:26:54 -04:00 committed by GitHub
parent d51a940d0f
commit 08bf6ad86f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 4 deletions

View File

@ -332,20 +332,26 @@
$array['devices'][0]['device_lines'][$y]['sip_port'] = $row["sip_port"];
}
else {
if ($action == "add") {
$array['devices'][0]['device_lines'][$y]['sip_port'] = $_SESSION['provision']['line_sip_port']['numeric'];
}
}
if (permission_exists('device_line_transport')) {
$array['devices'][0]['device_lines'][$y]['sip_transport'] = $row["sip_transport"];
}
else {
if ($action == "add") {
$array['devices'][0]['device_lines'][$y]['sip_transport'] = $_SESSION['provision']['line_sip_transport']['text'];
}
}
if (permission_exists('device_line_register_expires')) {
$array['devices'][0]['device_lines'][$y]['register_expires'] = $row["register_expires"];
}
else {
if ($action == "add") {
$array['devices'][0]['device_lines'][$y]['register_expires'] = $_SESSION['provision']['line_register_expires']['numeric'];
}
}
$y++;
}
}