unified form header

persistent user-specific language setting fixed
This commit is contained in:
lars 2005-09-21 02:26:31 +00:00
parent 58a574ac84
commit b969e59157
7 changed files with 23 additions and 17 deletions

View File

@ -133,10 +133,6 @@ function create_crypto()
# Parameter: device # Parameter: device
{ {
local device="$1" local device="$1"
# flood the crypto partition with noise
# TODO: do we need "wipe"?
#$WIPE -kq -R /dev/urandom "${device}2"
# passphrase may be passed via command line # passphrase may be passed via command line
$CRYPTSETUP -h "$HASH" -c "$ALGO" create "`basename $CRYPTMAPPER_DEV`" "${device}2" $CRYPTSETUP -h "$HASH" -c "$ALGO" create "`basename $CRYPTMAPPER_DEV`" "${device}2"
} }
@ -145,6 +141,13 @@ function create_crypto()
function mkfs_crypto() function mkfs_crypto()
# split from create_crypto to allow background execution via web interface # split from create_crypto to allow background execution via web interface
{ {
local device=$(find_harddisk)
# flood the crypto partition with noise
# writing to the real partition is faster
# TODO: this takes _much_ too long - maybe add a "secure wipe" switch to the interface?
#dd if=/dev/urandom of="${device}2" bs=512
$MKFS_DATA "$CRYPTMAPPER_DEV" $MKFS_DATA "$CRYPTMAPPER_DEV"
} }

View File

@ -1,9 +1,7 @@
<div id="config"> <div id="config">
<h1><?cs var:Lang.Title.Config ?></h1> <h1><?cs var:Lang.Title.Config ?></h1>
<form action="<?cs call:getSelfURL('','') ?>" method="post" <?cs call:print_form_header() ?>
enctype="application/x-www-form-urlencoded">
<?cs if:Data.Config.AdminPasswordIsSet ?> <?cs if:Data.Config.AdminPasswordIsSet ?>
<p><label for="current_admin_password"><?cs call:help_popUp(Lang.Text.EnterCurrentAdminPassword,"prove_admin_pw") ?></label><br/> <p><label for="current_admin_password"><?cs call:help_popUp(Lang.Text.EnterCurrentAdminPassword,"prove_admin_pw") ?></label><br/>
<input type="password" id="current_admin_password" name="current_admin_password" size="20" tabindex="1" maxlength="40" /> </p> <input type="password" id="current_admin_password" name="current_admin_password" size="20" tabindex="1" maxlength="40" /> </p>

View File

@ -1,7 +1,7 @@
<h1><?cs var:Lang.Title.Init ?></h1> <h1><?cs var:Lang.Title.Init ?></h1>
<div class="init"> <div class="init">
<form action="<?cs call:getSelfURL('','') ?>" method="post" enctype="application/x-www-form-urlencoded"> <?cs call:print_form_header() ?>
<p class="note"><?cs var:Lang.Text.InitWarning ?></p> <p class="note"><?cs var:Lang.Text.InitWarning ?></p>
<?cs if:Data.Config.AdminPasswordIsSet ?> <?cs if:Data.Config.AdminPasswordIsSet ?>

View File

@ -62,7 +62,7 @@
set:tmp_concat='&' ?><?cs set:tmp_concat='&' ?><?cs
/if ?><?cs /if ?><?cs
/each ?><?cs /each ?><?cs
if:?append ?><?cs set:PostSuffix=PostSuffix + tmp_concat + append ?><?cs if:(append != '') ?><?cs set:PostSuffix=PostSuffix + tmp_concat + append ?><?cs
/if ?><?cs /if ?><?cs
var:ScriptName ?><?cs var:PostSuffix ?><?cs var:ScriptName ?><?cs var:PostSuffix ?><?cs
/def ?> /def ?>
@ -77,7 +77,15 @@
/def ?> /def ?>
<?cs def:help_popUp(text,filename) ?><?cs <?cs def:help_popUp(text,filename) ?><?cs #
var:text ?><?cs # TODO: remove this, if on-screen help will die :)
?><?cs var:text ?><?cs
/def ?> /def ?>
<?cs def:print_form_header() ?><?cs #
# the header of a form - including Data.PostData values as hidden fields
?><form action="<?cs var:ScriptName ?>" method="post" enctype="application/x-www-form-urlencoded">
<?cs each:item = Data.PostData
?><input type="hidden" name="<?cs name:item ?>" value="<?cs var:item ?>" /><?cs
/each ?><?cs
/def ?>

View File

@ -1,8 +1,7 @@
<h1><?cs var:Lang.Title.Mount ?></h1> <h1><?cs var:Lang.Title.Mount ?></h1>
<div align="center"> <div align="center">
<form action="<?cs call:getSelfURL('','') ?>" method="post" <?cs call:print_form_header() ?>
enctype="application/x-www-form-urlencoded">
<p><label for="crypto_passwort"><?cs var:Lang.Text.EnterCurrentCryptoPassword ?></label> <p><label for="crypto_passwort"><?cs var:Lang.Text.EnterCurrentCryptoPassword ?></label>
<input type="password" id="crypto_password" name="crypto_password" size="20" tabindex="0" maxlength="40" /></p> <input type="password" id="crypto_password" name="crypto_password" size="20" tabindex="0" maxlength="40" /></p>

View File

@ -1,8 +1,7 @@
<h1><?cs var:Lang.Title.ShutDown ?></h1> <h1><?cs var:Lang.Title.ShutDown ?></h1>
<div align="center"> <div align="center">
<form action="<?cs call:getSelfURL('','') ?>" method="post" <?cs call:print_form_header ?>
enctype="application/x-www-form-urlencoded">
<input type="hidden" name="action" value="shutdown_do" /> <input type="hidden" name="action" value="shutdown_do" />

View File

@ -1,8 +1,7 @@
<h1><?cs var:Lang.Title.Umount ?></h1> <h1><?cs var:Lang.Title.Umount ?></h1>
<div align="center"> <div align="center">
<form action="<?cs call:getSelfURL('','') ?>" method="post" <?cs call:print_form_header() ?>
enctype="application/x-www-form-urlencoded">
<button type="submit" name="action" <button type="submit" name="action"
value="umount_do"><?cs var:Lang.Button.Umount ?></button> value="umount_do"><?cs var:Lang.Button.Umount ?></button>