ipsec: make hash selection selectpicker in both phases #1852

This commit is contained in:
Franco Fichtner 2018-09-12 15:35:19 +00:00
parent 037a92f2ca
commit 844aa19112
2 changed files with 11 additions and 10 deletions

View File

@ -329,7 +329,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
if (empty($pconfig['hash-algorithm'])) {
$input_errors[] = gettext('Hash algorithm selection cannot be empty.');
$input_errors[] = gettext("At least one hashing algorithm needs to be selected.");
$pconfig['hash-algorithm'] = array();
}
@ -926,8 +926,8 @@ endforeach; ?>
);
foreach ($p1_halgos as $algo => $algoname) :
?>
<option value="<?=$algo;?>" <?= in_array($algo, $pconfig['hash-algorithm']) ? 'selected="selected"' : '' ?>>
<?=$algoname;?>
<option value="<?= html_safe($algo) ?>" <?= in_array($algo, $pconfig['hash-algorithm']) ? 'selected="selected"' : '' ?>>
<?= html_safe($algoname) ?>
</option>
<?php endforeach;
?>

View File

@ -337,6 +337,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
break;
}
}
$pconfig['hash-algorithm-option'] = array();
}
}
}
@ -657,13 +658,13 @@ endif; ?>
<tr>
<td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Hash algorithms"); ?></td>
<td style="width:78%" class="vtable">
<?php
foreach ($p2_halgos as $algo => $algoname) :?>
<input type="checkbox" name="hash-algorithm-option[]" value="<?=$algo;?>" <?= isset($pconfig['hash-algorithm-option']) && in_array($algo, $pconfig['hash-algorithm-option']) ? 'checked="checked"' : '';?>/>
<?=$algoname;?>
</br>
<?php
endforeach; ?>
<select name="hash-algorithm-option[]" class="selectpicker" multiple="multiple">
<?php foreach ($p2_halgos as $algo => $algoname): ?>
<option value="<?= html_safe($algo) ?>" <?= in_array($algo, $pconfig['hash-algorithm-option']) ? 'selected="selected"' : '' ?>>
<?= html_safe($algoname) ?>
</option>
<?php endforeach ?>
</select>
</td>
</tr>
<tr>