|
|
|
@ -311,10 +311,12 @@ if ( ! &check_ssl()) {
|
|
|
|
|
$pagedata->setValue('Data.Action', 'init_form'); |
|
|
|
|
} elsif (&check_init_running()) { |
|
|
|
|
$pagedata->setValue('Data.Warning', 'InitNotFinished'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'mount_form'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'empty'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'config_form'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "30"); |
|
|
|
|
} elsif ( ! &check_mounted()) { |
|
|
|
|
$pagedata->setValue('Data.Warning', 'NotMounted'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'mount_form'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'empty'); |
|
|
|
|
} else { |
|
|
|
|
# unmounten |
|
|
|
|
&umount_vol(); |
|
|
|
@ -323,7 +325,9 @@ if ( ! &check_ssl()) {
|
|
|
|
|
$pagedata->setValue('Data.Action', 'umount_form'); |
|
|
|
|
} else { |
|
|
|
|
$pagedata->setValue('Data.Success', 'UmountDone'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'mount_form'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'status'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'status'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "60"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
################ mount_do ######################## |
|
|
|
@ -334,10 +338,14 @@ if ( ! &check_ssl()) {
|
|
|
|
|
$pagedata->setValue('Data.Action', 'init_form'); |
|
|
|
|
} elsif (&check_init_running()) { |
|
|
|
|
$pagedata->setValue('Data.Warning', 'InitNotFinished'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'mount_form'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'empty'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'config_form'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "30"); |
|
|
|
|
} elsif (&check_mounted()) { |
|
|
|
|
$pagedata->setValue('Data.Warning', 'IsMounted'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'umount_form'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'empty'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'status'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "30"); |
|
|
|
|
} elsif ($query->param('crypto_password') eq '') { |
|
|
|
|
# leeres Passwort |
|
|
|
|
$pagedata->setValue('Data.Warning', 'EmptyCryptoPassword'); |
|
|
|
@ -350,7 +358,9 @@ if ( ! &check_ssl()) {
|
|
|
|
|
$pagedata->setValue('Data.Action', 'mount_form'); |
|
|
|
|
} else { |
|
|
|
|
$pagedata->setValue('Data.Success', 'MountDone'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'umount_form'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'empty'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'status'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "30"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
################## mount_ask ####################### |
|
|
|
@ -360,10 +370,14 @@ if ( ! &check_ssl()) {
|
|
|
|
|
$pagedata->setValue('Data.Action', 'init_form'); |
|
|
|
|
} elsif (&check_init_running()) { |
|
|
|
|
$pagedata->setValue('Data.Warning', 'InitNotFinished'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'mount_form'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'empty'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'config_form'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "30"); |
|
|
|
|
} elsif (&check_mounted()) { |
|
|
|
|
$pagedata->setValue('Data.Warning', 'IsMounted'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'umount_form'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'empty'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'status'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "30"); |
|
|
|
|
} else { |
|
|
|
|
$pagedata->setValue('Data.Action', 'mount_form'); |
|
|
|
|
} |
|
|
|
@ -374,7 +388,9 @@ if ( ! &check_ssl()) {
|
|
|
|
|
$pagedata->setValue('Data.Action', 'init_form'); |
|
|
|
|
} elsif ( ! &check_mounted()) { |
|
|
|
|
$pagedata->setValue('Data.Warning', 'NotMounted'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'mount_form'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'empty'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'status'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "30"); |
|
|
|
|
} else { |
|
|
|
|
$pagedata->setValue('Data.Action', 'umount_form'); |
|
|
|
|
} |
|
|
|
@ -475,11 +491,9 @@ if ( ! &check_ssl()) {
|
|
|
|
|
} else { |
|
|
|
|
$pagedata->setValue('Data.Success', 'ConfigSaved'); |
|
|
|
|
} |
|
|
|
|
if (&check_mounted()) { |
|
|
|
|
$pagedata->setValue('Data.Action', 'umount_form'); |
|
|
|
|
} else { |
|
|
|
|
$pagedata->setValue('Data.Action', 'mount_form'); |
|
|
|
|
} |
|
|
|
|
$pagedata->setValue('Data.Action', 'status'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'status'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "30"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#################### show_log ####################### |
|
|
|
@ -502,12 +516,28 @@ if ( ! &check_ssl()) {
|
|
|
|
|
if ($query->param('type') eq 'reboot') { |
|
|
|
|
&system_reboot(); |
|
|
|
|
$pagedata->setValue('Data.Success', 'ReBoot'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'status'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "180"); |
|
|
|
|
} else { |
|
|
|
|
&system_poweroff(); |
|
|
|
|
$pagedata->setValue('Data.Success', 'PowerOff'); |
|
|
|
|
} |
|
|
|
|
$pagedata->setValue('Data.Doc.Page', 'CryptoBoxIntro'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'doc'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'empty'); |
|
|
|
|
#################### status ######################### |
|
|
|
|
} elsif ($action eq 'status') { |
|
|
|
|
if ( ! &check_config()) { |
|
|
|
|
$pagedata->setValue('Data.Warning', 'NotInitialized'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'init_form'); |
|
|
|
|
} elsif (&check_init_running()) { |
|
|
|
|
$pagedata->setValue('Data.Warning', 'InitNotFinished'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'empty'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'config_form'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "30"); |
|
|
|
|
} else { |
|
|
|
|
$pagedata->setValue('Data.Action', 'status'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'status'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "60"); |
|
|
|
|
} |
|
|
|
|
################### unknown ######################### |
|
|
|
|
} else { |
|
|
|
|
$pagedata->setValue('Data.Error', 'UnknownAction'); |
|
|
|
@ -515,14 +545,14 @@ if ( ! &check_ssl()) {
|
|
|
|
|
###################### default ########################## |
|
|
|
|
} else { |
|
|
|
|
if (&check_init_running()) { |
|
|
|
|
$pagedata->setValue('Data.Doc.Page', 'CryptoBoxIntro'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'doc'); |
|
|
|
|
$pagedata->setValue('Data.Warning', 'InitNotFinished'); |
|
|
|
|
$pagedata->setValue('Data.Action', 'empty'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'config_form'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "60"); |
|
|
|
|
} elsif (&check_config()) { |
|
|
|
|
if (&check_mounted()) { |
|
|
|
|
$pagedata->setValue('Data.Action', 'umount_form'); |
|
|
|
|
} else { |
|
|
|
|
$pagedata->setValue('Data.Action', 'mount_form'); |
|
|
|
|
} |
|
|
|
|
$pagedata->setValue('Data.Action', 'status'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'status'); |
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "60"); |
|
|
|
|
} else { |
|
|
|
|
$pagedata->setValue('Data.Action', 'init_form'); |
|
|
|
|
} |
|
|
|
|