Commit ed2ded1c authored by Franco Fichtner's avatar Franco Fichtner

system: make vt/sc configurable; closes #1343

parent 56f7c3f8
......@@ -1715,6 +1715,7 @@ function system_login_configure($verbose = false)
$new_boot_config['comconsole_speed'] = null;
$new_boot_config['boot_multicons'] = null;
$new_boot_config['boot_serial'] = null;
$new_boot_config['kern.vty'] = 'vt';
$new_boot_config['console'] = null;
$console_types = system_console_types();
......@@ -1750,6 +1751,10 @@ function system_login_configure($verbose = false)
@unlink('/boot.config');
}
if (empty($config['system']['usevirtualterminal'])) {
$new_boot_config['kern.vty'] = 'sc';
}
/* reload static values from rc.loader.d */
mwexecf('/usr/local/etc/rc.loader');
......
autoboot_delay="3"
hw.usb.no_pf="1"
kern.vty="sc"
......@@ -46,6 +46,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
$pconfig['disablehttpredirect'] = isset($config['system']['webgui']['disablehttpredirect']);
$pconfig['disableconsolemenu'] = isset($config['system']['disableconsolemenu']);
$pconfig['usevirtualterminal'] = isset($config['system']['usevirtualterminal']);
$pconfig['disableintegratedauth'] = !empty($config['system']['disableintegratedauth']);
$pconfig['sudo_allow_wheel'] = $config['system']['sudo_allow_wheel'];
$pconfig['noantilockout'] = isset($config['system']['webgui']['noantilockout']);
......@@ -127,6 +128,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
unset($config['system']['disableconsolemenu']);
}
if (!empty($pconfig['usevirtualterminal'])) {
$config['system']['usevirtualterminal'] = true;
} elseif (isset($config['system']['usevirtualterminal'])) {
unset($config['system']['usevirtualterminal']);
}
if (!empty($pconfig['disableintegratedauth'])) {
$config['system']['disableintegratedauth'] = true;
} elseif (isset($config['system']['disableintegratedauth'])) {
......@@ -536,22 +543,6 @@ include("head.inc");
<tr>
<th colspan="2"><?=gettext("Console Options"); ?></th>
</tr>
<tr>
<td><a id="help_for_serialspeed" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Serial Speed")?></td>
<td>
<select name="serialspeed" id="serialspeed" class="formselect selectpicker">
<option value="115200" <?=$pconfig['serialspeed'] == "115200" ? 'selected="selected"' : '' ?>>115200</option>
<option value="57600" <?=$pconfig['serialspeed'] == "57600" ? 'selected="selected"' : '' ?>>57600</option>
<option value="38400" <?=$pconfig['serialspeed'] == "38400" ? 'selected="selected"' : '' ?>>38400</option>
<option value="19200" <?=$pconfig['serialspeed'] == "19200" ? 'selected="selected"' : '' ?>>19200</option>
<option value="14400" <?=$pconfig['serialspeed'] == "14400" ? 'selected="selected"' : '' ?>>14400</option>
<option value="9600" <?=$pconfig['serialspeed'] == "9600" ? 'selected="selected"' : '' ?>>9600</option>
</select>
<div class="hidden" for="help_for_serialspeed">
<?=gettext("Allows selection of different speeds for the serial console port."); ?>
</div>
</td>
</tr>
<tr>
<td><a id="help_for_primaryconsole" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Primary Console")?></td>
<td width="78%">
......@@ -581,6 +572,22 @@ include("head.inc");
</div>
</td>
</tr>
<tr>
<td><a id="help_for_serialspeed" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Serial Speed")?></td>
<td>
<select name="serialspeed" id="serialspeed" class="formselect selectpicker">
<option value="115200" <?=$pconfig['serialspeed'] == "115200" ? 'selected="selected"' : '' ?>>115200</option>
<option value="57600" <?=$pconfig['serialspeed'] == "57600" ? 'selected="selected"' : '' ?>>57600</option>
<option value="38400" <?=$pconfig['serialspeed'] == "38400" ? 'selected="selected"' : '' ?>>38400</option>
<option value="19200" <?=$pconfig['serialspeed'] == "19200" ? 'selected="selected"' : '' ?>>19200</option>
<option value="14400" <?=$pconfig['serialspeed'] == "14400" ? 'selected="selected"' : '' ?>>14400</option>
<option value="9600" <?=$pconfig['serialspeed'] == "9600" ? 'selected="selected"' : '' ?>>9600</option>
</select>
<div class="hidden" for="help_for_serialspeed">
<?=gettext("Allows selection of different speeds for the serial console port."); ?>
</div>
</td>
</tr>
<tr>
<td><i class="fa fa-info-circle text-muted"></i></a> <?= gettext("Console menu") ?></td>
<td width="78%">
......@@ -588,6 +595,13 @@ include("head.inc");
<strong><?=gettext("Password protect the console menu"); ?></strong>
</td>
</tr>
<tr>
<td><i class="fa fa-info-circle text-muted"></i></a> <?= gettext('Console driver') ?></td>
<td width="78%">
<input name="usevirtualterminal" type="checkbox" value="yes" <?= empty($pconfig['usevirtualterminal']) ? '' : 'checked="checked"' ?> />
<strong><?= gettext('Use the virtual terminal driver (vt)') ?></strong>
</td>
</tr>
<tr>
<td><a id="help_for_disableintegratedauth" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?= gettext("Integrated authentication") ?></td>
<td width="78%">
......
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