mirror of https://github.com/aredn/aredn.git
bugfix: node description not saving properly (#101)
This commit is contained in:
parent
52a8b79f98
commit
560070d2d1
|
@ -30,3 +30,5 @@ dtdlink_ip=10.<DTDMAC>
|
|||
|
||||
time_zone = UTC
|
||||
ntp_server = us.pool.ntp.org
|
||||
|
||||
description_node =
|
||||
|
|
|
@ -32,3 +32,5 @@ dtdlink_ip=10.<DTDMAC>
|
|||
time_zone = UTC
|
||||
time_zone_name = UTC
|
||||
ntp_server = us.pool.ntp.org
|
||||
|
||||
description_node =
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
config 'system'
|
||||
option 'hostname' '<NODE>'
|
||||
option 'timezone' '<time_zone>'
|
||||
option 'description' '<description_node>'
|
||||
|
||||
config 'timeserver' 'ntp'
|
||||
list 'server' '<ntp_server>'
|
||||
|
|
|
@ -573,7 +573,7 @@ sub save_setup
|
|||
open(FILE, ">$_[0]") or return 0;
|
||||
foreach(sort keys %parms)
|
||||
{
|
||||
next unless /^(aprs|dhcp|dmz|lan|olsrd|wan|wifi|dtdlink|ntp|time)_/;
|
||||
next unless /^(aprs|dhcp|dmz|lan|olsrd|wan|wifi|dtdlink|ntp|time|description)_/;
|
||||
print FILE "$_ = $parms{$_}\n";
|
||||
}
|
||||
close(FILE);
|
||||
|
|
|
@ -433,17 +433,13 @@ if($parms{button_save})
|
|||
push (@errors, "OK") unless @errors;
|
||||
}
|
||||
|
||||
if($parms{nodedesc})
|
||||
if($description_node)
|
||||
{
|
||||
if($parms{nodedesc} =~ /<.*>|<\/.*>/) {
|
||||
if($description_node =~ /<.*>|<\/.*>/) {
|
||||
push(@errors, "Node description cannot contain html like tags")
|
||||
}
|
||||
else
|
||||
{
|
||||
$rc = &uci_set_indexed_option("system", "system", "0", "description", "$parms{nodedesc}");
|
||||
push(@errors, "unable to store node description. ($rc | $rc2") if($rc);
|
||||
}
|
||||
}
|
||||
|
||||
unless(@errors)
|
||||
{
|
||||
$parms{node} = $node;
|
||||
|
@ -469,7 +465,7 @@ reboot_page("/cgi-bin/status") if $parms{button_reboot};
|
|||
#
|
||||
# retrieve node description
|
||||
#
|
||||
$nodedesc = &uci_get_indexed_option("system", "system", 0, "description");
|
||||
$desc = &uci_get_indexed_option("system", "system", 0, "description");
|
||||
#
|
||||
# Retreive map url, css, and js locations
|
||||
#
|
||||
|
@ -646,7 +642,7 @@ print "
|
|||
</tr>
|
||||
<tr>
|
||||
<td>Node Description (optional)</td>
|
||||
<td><input type='text' size='50' name='nodedesc' value=\"$nodedesc\" tabindex='4'</input></td>";
|
||||
<td><input type='text' size='50' name='description_node' value=\"$description_node\" tabindex='4'</input></td>";
|
||||
push @hidden, "<input type=hidden name=config value='mesh'>";
|
||||
print "
|
||||
<td>Verify Password</td>
|
||||
|
|
Loading…
Reference in New Issue