first validation request now resets the box

change action "box_purge" to "do_purge"
This commit is contained in:
lars 2005-10-25 10:36:05 +00:00
parent d4dbcba4f3
commit e2cef6c3dc
4 changed files with 9 additions and 10 deletions

View File

@ -481,7 +481,6 @@ case "$ACTION" in
$0 crypto-down
$0 config-down
box_purge
$0 diskinfo
;;
poweroff )
is_crypto_mounted && umount_crypto

View File

@ -615,20 +615,18 @@ if ( ! &check_ssl()) {
$pagedata->setValue('Data.Redirect.Delay', "60");
}
################### box_purge #######################
# TODO test this code
# if we find an existing config partition, then read the adminpw
# and ask the user (validationscript or webfrontend) for it
} elsif ($action eq 'box_purge') {
# if we find an existing config partition, then check the adminpw
} elsif ($action eq 'do_purge') {
if ( &check_config()) {
# TODO old config found, read the admin passwd
my $current_admin_pw = &get_admin_pw;
if ($current_admin_pw ne $query->param('current_admin_password')) {
if ($current_admin_pw ne '' && $current_admin_pw ne $query->param('current_admin_password')) {
$pagedata->setValue('Data.Warning', 'WrongAdminPassword');
$pagedata->setValue('Data.Action', 'form_config');
} else {
&box_purge;
&box_purge;
$pagedata->setValue('Data.Action', 'form_init');
}
}
}
################### unknown #########################
} else {
$pagedata->setValue('Data.Error', 'UnknownAction');

View File

@ -1 +1 @@
show the main page
purge the box

View File

@ -1,2 +1,4 @@
url https://_HOST_IP_DEFAULT_/cryptobox
data weblang=_IFACE_LANG_
data action=do_purge
data current_admin_password=