Revision ec5a5d65
Added by Scott Dale almost 18 years ago
usr/local/www/system.php | ||
---|---|---|
36 | 36 |
list($pconfig['dns1'],$pconfig['dns2']) = $config['system']['dnsserver']; |
37 | 37 |
|
38 | 38 |
$pconfig['dnsallowoverride'] = isset($config['system']['dnsallowoverride']); |
39 |
$pconfig['username'] = $config['system']['username']; |
|
40 |
if (!$pconfig['username']) |
|
41 |
$pconfig['username'] = "admin"; |
|
42 | 39 |
$pconfig['webguiproto'] = $config['system']['webgui']['protocol']; |
43 | 40 |
if (!$pconfig['webguiproto']) |
44 | 41 |
$pconfig['webguiproto'] = "http"; |
... | ... | |
85 | 82 |
$pconfig = $_POST; |
86 | 83 |
|
87 | 84 |
/* input validation */ |
88 |
$reqdfields = split(" ", "hostname domain username");
|
|
89 |
$reqdfieldsn = split(",", "Hostname,Domain,Username");
|
|
85 |
$reqdfields = split(" ", "hostname domain"); |
|
86 |
$reqdfieldsn = split(",", "Hostname,Domain"); |
|
90 | 87 |
|
91 | 88 |
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); |
92 | 89 |
|
... | ... | |
99 | 96 |
if (($_POST['dns1'] && !is_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2']))) { |
100 | 97 |
$input_errors[] = "A valid IP address must be specified for the primary/secondary DNS server."; |
101 | 98 |
} |
102 |
if ($_POST['username'] && !preg_match("/^[a-zA-Z0-9]*$/", $_POST['username'])) { |
|
103 |
$input_errors[] = "The username may only contain the characters a-z, A-Z and 0-9."; |
|
104 |
} |
|
105 | 99 |
if ($_POST['webguiport'] && (!is_numericint($_POST['webguiport']) || |
106 | 100 |
($_POST['webguiport'] < 1) || ($_POST['webguiport'] > 65535))) { |
107 | 101 |
$input_errors[] = "A valid TCP/IP port must be specified for the webGUI port."; |
... | ... | |
123 | 117 |
if (!$input_errors) { |
124 | 118 |
update_if_changed("hostname", $config['system']['hostname'], strtolower($_POST['hostname'])); |
125 | 119 |
update_if_changed("domain", $config['system']['domain'], strtolower($_POST['domain'])); |
126 |
update_if_changed("username", $config['system']['username'], $_POST['username']); |
|
127 | 120 |
|
128 | 121 |
if (update_if_changed("webgui protocol", $config['system']['webgui']['protocol'], $_POST['webguiproto'])) |
129 | 122 |
$restart_webgui = true; |
Also available in: Unified diff
We Do not validate username field anymore on this page. Has been removed for user manage.