diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-09-14 19:30:12 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-09-14 19:30:12 +0000 |
commit | 8affb1daf6f8915fc9b014d776c693d6748a23c6 (patch) | |
tree | 956808c5264be0fcbfc927a1e396b8732101c1f8 /usr/local/www/system_advanced.php | |
parent | 466e9af85dfeb1e2ce53b65ac65132ea8a5a2986 (diff) | |
download | pfsense-8affb1daf6f8915fc9b014d776c693d6748a23c6.zip pfsense-8affb1daf6f8915fc9b014d776c693d6748a23c6.tar.gz |
Do not disable console in rc.initial. We are changing the behavior to turn off autologin.
In-discussion-with: cmb
Provoked-by: Yet another complaint about old behavior
Diffstat (limited to 'usr/local/www/system_advanced.php')
-rwxr-xr-x | usr/local/www/system_advanced.php | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/usr/local/www/system_advanced.php b/usr/local/www/system_advanced.php index e29bf1a..0504885 100755 --- a/usr/local/www/system_advanced.php +++ b/usr/local/www/system_advanced.php @@ -135,10 +135,13 @@ if ($_POST) { $oldkey = $config['system']['webgui']['private-key']; $config['system']['webgui']['certificate'] = base64_encode($_POST['cert']); $config['system']['webgui']['private-key'] = base64_encode($_POST['key']); - if($_POST['disableconsolemenu'] == "yes") + if($_POST['disableconsolemenu'] == "yes") { $config['system']['disableconsolemenu'] = true; - else + auto_login(true); + } else { unset($config['system']['disableconsolemenu']); + auto_login(false); + } unset($config['system']['webgui']['expanddiags']); $config['system']['optimization'] = $_POST['optimization']; @@ -561,5 +564,28 @@ include("head.inc"); <?php include("fend.inc"); ?> +<?php + +function auto_login($status) { + $gettytab = file_get_contents("/etc/gettyab"); + $getty_split = split("\n", $gettytab); + conf_mount_rw(); + $fd = fopen("/etc/gettytab", "w"); + foreach($getty_split as $gs) { + if(stristr($gs, "cb:ce:ck:lc") == true) { + if($status == true) { + fwrite($fd, "::cb:ce:ck:lc:fd#1000:im=\r\n%s/%m (%h) (%t)\r\n\r\n:sp#1200:\\n"); + } else { + fwrite($fd, ":al=root:cb:ce:ck:lc:fd#1000:im=\r\n%s/%m (%h) (%t)\r\n\r\n:sp#1200:\\n"); + } + } else { + fwrite($fd, "{$gs}\n"); + } + } + fclose($fd); + conf_mount_ro(); +} + +?> </body> </html> |