Commit 832cd12f authored by Ad Schellevis's avatar Ad Schellevis

(legacy) system_authservers.php, empty server name not allowed. closes...

(legacy) system_authservers.php, empty server name not allowed. closes https://github.com/opnsense/core/issues/731
parent 08663618
...@@ -179,6 +179,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -179,6 +179,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (($pconfig['type'] == "radius") && isset($pconfig['radius_timeout']) && !empty($pconfig['radius_timeout']) && (!is_numeric($pconfig['radius_timeout']) || (is_numeric($pconfig['radius_timeout']) && ($pconfig['radius_timeout'] <= 0)))) { if (($pconfig['type'] == "radius") && isset($pconfig['radius_timeout']) && !empty($pconfig['radius_timeout']) && (!is_numeric($pconfig['radius_timeout']) || (is_numeric($pconfig['radius_timeout']) && ($pconfig['radius_timeout'] <= 0)))) {
$input_errors[] = gettext("RADIUS Timeout value must be numeric and positive."); $input_errors[] = gettext("RADIUS Timeout value must be numeric and positive.");
} }
if (empty($pconfig['name'])) {
$input_errors[] = gettext("A server name must be provided");
}
if (count($input_errors) == 0) { if (count($input_errors) == 0) {
$server = array(); $server = array();
$server['refid'] = uniqid(); $server['refid'] = uniqid();
...@@ -442,11 +446,13 @@ endif; ?> ...@@ -442,11 +446,13 @@ endif; ?>
<td> <td>
<?php if (!isset($id)) : <?php if (!isset($id)) :
?> ?>
<select name='type' id='type' class="formselect selectpicker" data-style="btn-default"> <select name='type' id='type' class="selectpicker" data-style="btn-default">
<?php <?php
foreach ($auth_server_types as $typename => $typedesc) : foreach ($auth_server_types as $typename => $typedesc) :
?> ?>
<option value="<?=$typename;?>"><?=$typedesc;?></option> <option value="<?=$typename;?>" <?=$pconfig['type'] == $typename ? "selected=\"selected\"" : "";?> >
<?=$typedesc;?>
</option>
<?php <?php
endforeach; ?> endforeach; ?>
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment