381,8 → 381,12 |
break; |
case 'enable_lan_ssh': // Activate SSH on LAN |
if (isset($_POST['sshlan'])) { |
exec('sudo /usr/local/bin/alcasar-ssh.sh --on -l'); |
header('Location: '.$_SERVER['PHP_SELF']); |
exec('sudo /usr/local/bin/alcasar-ssh.sh --on -l -p'.escapeshellarg($_POST["ssh_port"]).' -i'.escapeshellarg($_POST["ssh_from"]),$output,$exitCode); |
if($exitCode === 1){ |
echo("<html><script>if(!alert(`$l_error_bad_ip_port`)){window.location.href = window.location.href;}</script></html>"); |
}else{ |
header('Location: '.$_SERVER['PHP_SELF']); |
} |
} else{ |
exec('sudo /usr/local/bin/alcasar-ssh.sh --off -l'); |
header('Location: '.$_SERVER['PHP_SELF']); |
1202,7 → 1206,19 |
<div class="panel-row"> |
<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>"> |
<input type="hidden" name="choix" value="enable_lan_ssh"> |
<input type="checkbox" name="sshlan" id="sshlan" <?= $conf['SSH_LAN'] === 'on' ? "checked": "" ?>> <b><?= $l_ssh_lan_activate ?></b><br><br> |
<input type="checkbox" name="sshlan" id="sshlan" <?= $conf['SSH_LAN'] !== '0' ? "checked": "" ?> onchange="document.getElementById('sshtablelan').style.display = this.checked ? 'block' : 'none';"> <b><?= $l_ssh_lan_activate ?></b><br><br> |
<div id="sshtablelan" style="display:<?= $conf['SSH_LAN'] !== '0'? "block": "none" ?>"> |
<table cellspacing="2" cellpadding="3" border="1"> |
<tr> |
<th><?= $l_ssh_port ?></th><th><?= $l_ssh_from ?></th> |
</tr> |
<tr> |
<td><input style="width:120px" type="text" id="ssh_port" name="ssh_port" value="<?= $conf['SSH_LAN'] !== '0' ? $conf['SSH_LAN']:22 ?>" /></td> |
<td><input style="width:120px" type="text" id="ssh_from" name="ssh_from" value="<?= explode('/',$conf['SSH_ADMIN_FROM'])[0] ?>" /></td> |
</tr> |
</table> |
<p>Activer sur tout le LAN : 0.0.0.0</p> |
</div> |
<input type="submit" onClick="document.getElementById('ldoverlay').style.display='block';" value="<?= $l_apply ?>"><br> |
</form> |
</div> |
1211,18 → 1227,18 |
<div class="panel-row"> |
<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>"> |
<input type="hidden" name="choix" value="enable_wan_ssh"> |
<input type="checkbox" name="togglessh" id="togglessh" <?= is_numeric($conf['SSH_WAN'])? "checked": "" ?> onchange="document.getElementById('sshtable').style.display = this.checked ? 'block' : 'none';"> <b><?= $l_ssh_wan_activate ?></b><br><br> |
<div id="sshtable" style="display:<?= is_numeric($conf['SSH_WAN'])? "block": "none" ?>"> |
<input type="checkbox" name="togglessh" id="togglessh" <?= $conf['SSH_WAN'] !== '0'? "checked": "" ?> onchange="document.getElementById('sshtablewan').style.display = this.checked ? 'block' : 'none';"> <b><?= $l_ssh_wan_activate ?></b><br><br> |
<div id="sshtablewan" style="display:<?= $conf['SSH_WAN'] !== '0'? "block": "none" ?>"> |
<table cellspacing="2" cellpadding="3" border="1"> |
<tr> |
<th><?= $l_ssh_port ?></th><th><?= $l_ssh_from ?></th> |
</tr> |
<tr> |
<td><input style="width:120px" type="text" id="ssh_port" name="ssh_port" value="<?= is_numeric($conf['SSH_WAN']) ? $conf['SSH_WAN']:22 ?>" /></td> |
<td><input style="width:120px" type="text" id="ssh_from" name="ssh_from" value="<?= $conf['SSH_ADMIN_FROM'] ?>" /></td> |
<td><input style="width:120px" type="text" id="ssh_port" name="ssh_port" value="<?= $conf['SSH_WAN'] !== '0' ? $conf['SSH_WAN']:22 ?>" /></td> |
<td><input style="width:120px" type="text" id="ssh_from" name="ssh_from" value="<?= explode('/',$conf['SSH_ADMIN_FROM'])[1] ?>" /></td> |
</tr> |
</table> |
<p>Activer sur tout réseau : 0.0.0.0/0</p> |
<p>Activer sur tout réseau : 0.0.0.0</p> |
</div> |
<input type="submit" onClick="document.getElementById('ldoverlay').style.display='block';" value="<?= $l_apply ?>"><br> |
</form> |