Commit 7f1c91f7 authored by Franco Fichtner's avatar Franco Fichtner

settings: fix old sshd reload trigger bug

parent 6dcbac7a
...@@ -93,18 +93,6 @@ if ($_POST) { ...@@ -93,18 +93,6 @@ if ($_POST) {
} }
} }
if ($_POST['passwordauth'] == 'yes') {
$config['system']['ssh']['passwordauth'] = 'enabled';
} elseif (isset($config['system']['ssh']['passwordauth'])) {
unset($config['system']['ssh']['passwordauth']);
}
if ($_POST['sshdpermitrootlogin'] == "yes") {
$config['system']['ssh']['permitrootlogin'] = "enabled";
} elseif (isset($config['system']['ssh']['permitrootlogin'])) {
unset($config['system']['ssh']['permitrootlogin']);
}
ob_flush(); ob_flush();
flush(); flush();
...@@ -213,14 +201,17 @@ if ($_POST) { ...@@ -213,14 +201,17 @@ if ($_POST) {
unset($config['system']['ssh']['port']); unset($config['system']['ssh']['port']);
} }
if (!isset($_POST['sshdpermitrootlogin']) && isset($config['system']['ssh']['permitrootlogin'])) { $sshd_permitrootlogin = isset($config['system']['ssh']['permitrootlogin']);
if ($_POST['sshdpermitrootlogin']) {
$config['system']['ssh']['permitrootlogin'] = true;
} elseif (isset($config['system']['ssh']['permitrootlogin'])) {
unset($config['system']['ssh']['permitrootlogin']); unset($config['system']['ssh']['permitrootlogin']);
} }
if (($sshd_enabled != $config['system']['ssh']['enabled']) || if (($sshd_enabled != $config['system']['ssh']['enabled']) ||
($sshd_passwordauth != $config['system']['ssh']['passwordauth']) || ($sshd_passwordauth != isset($config['system']['ssh']['passwordauth'])) ||
($sshd_port != $config['system']['ssh']['port']) || ($sshd_port != $config['system']['ssh']['port']) ||
($pconfig['system']['ssh']['permitrootlogin'] != isset($config['system']['ssh']['permitrootlogin'])) ) { ($sshd_permitrootlogin != isset($config['system']['ssh']['permitrootlogin']))) {
$restart_sshd = true; $restart_sshd = true;
} }
...@@ -522,8 +513,10 @@ endif; ?> ...@@ -522,8 +513,10 @@ endif; ?>
} ?> /> } ?> />
<strong><?=gettext("Permit root user login"); ?></strong> <strong><?=gettext("Permit root user login"); ?></strong>
<br /> <br />
<?=gettext("Root login is generally discouraged. It is advised "); ?> <?= gettext(
<?=gettext("to log in via another user and switch to root afterwards."); ?> 'Root login is generally discouraged. It is advised ' .
'to log in via another user and switch to root afterwards.'
) ?>
</td> </td>
</tr> </tr>
<tr> <tr>
......
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