[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:
parent
d51a940d0f
commit
08bf6ad86f
|
|
@ -332,19 +332,25 @@
|
||||||
$array['devices'][0]['device_lines'][$y]['sip_port'] = $row["sip_port"];
|
$array['devices'][0]['device_lines'][$y]['sip_port'] = $row["sip_port"];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$array['devices'][0]['device_lines'][$y]['sip_port'] = $_SESSION['provision']['line_sip_port']['numeric'];
|
if ($action == "add") {
|
||||||
|
$array['devices'][0]['device_lines'][$y]['sip_port'] = $_SESSION['provision']['line_sip_port']['numeric'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (permission_exists('device_line_transport')) {
|
if (permission_exists('device_line_transport')) {
|
||||||
$array['devices'][0]['device_lines'][$y]['sip_transport'] = $row["sip_transport"];
|
$array['devices'][0]['device_lines'][$y]['sip_transport'] = $row["sip_transport"];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$array['devices'][0]['device_lines'][$y]['sip_transport'] = $_SESSION['provision']['line_sip_transport']['text'];
|
if ($action == "add") {
|
||||||
|
$array['devices'][0]['device_lines'][$y]['sip_transport'] = $_SESSION['provision']['line_sip_transport']['text'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (permission_exists('device_line_register_expires')) {
|
if (permission_exists('device_line_register_expires')) {
|
||||||
$array['devices'][0]['device_lines'][$y]['register_expires'] = $row["register_expires"];
|
$array['devices'][0]['device_lines'][$y]['register_expires'] = $row["register_expires"];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$array['devices'][0]['device_lines'][$y]['register_expires'] = $_SESSION['provision']['line_register_expires']['numeric'];
|
if ($action == "add") {
|
||||||
|
$array['devices'][0]['device_lines'][$y]['register_expires'] = $_SESSION['provision']['line_register_expires']['numeric'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$y++;
|
$y++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue