diff --git a/cbox-tree.d/usr/share/cryptobox/templates/config_form.cs b/cbox-tree.d/usr/share/cryptobox/templates/config_form.cs index 6b6a256..a0485d8 100644 --- a/cbox-tree.d/usr/share/cryptobox/templates/config_form.cs +++ b/cbox-tree.d/usr/share/cryptobox/templates/config_form.cs @@ -4,15 +4,15 @@
-


+


-


+


-


+


-


+


-


diff --git a/cbox-tree.d/usr/share/cryptobox/templates/macros.cs b/cbox-tree.d/usr/share/cryptobox/templates/macros.cs index bc7c69d..a634c97 100644 --- a/cbox-tree.d/usr/share/cryptobox/templates/macros.cs +++ b/cbox-tree.d/usr/share/cryptobox/templates/macros.cs @@ -53,9 +53,8 @@ # e.g.: # - 'append' is 'weblang=de' # - 'exclude' is 'weblang' -# BEWARE: there is a bug (?) in clearsilver, that occours, if -# only one of the arguments is set (none or both are fine) -?> + + diff --git a/cbox-tree.d/usr/share/cryptobox/templates/main.cs b/cbox-tree.d/usr/share/cryptobox/templates/main.cs index 9a8e0fc..babbcb9 100644 --- a/cbox-tree.d/usr/share/cryptobox/templates/main.cs +++ b/cbox-tree.d/usr/share/cryptobox/templates/main.cs @@ -1,14 +1,14 @@ - - + + - + - + - + diff --git a/cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/confirm_text.html b/cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/confirm_text.html new file mode 100644 index 0000000..83747ea --- /dev/null +++ b/cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/confirm_text.html @@ -0,0 +1,2 @@ +

Confirmation text

+

Type the confirmation text exactly the way, it is said. This confirms, that you know, what you are doing.

diff --git a/cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/crypto_pw.html b/cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/crypto_pw.html new file mode 100644 index 0000000..6e0412d --- /dev/null +++ b/cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/crypto_pw.html @@ -0,0 +1,10 @@ +

Password of encrypted filesystem

+

This password is the final protection for your sensible data. You should +choose a complicated password, that fullfills at least the following requirements:

+ +

Do not forget your encryption password! There is no way to recover your data +without it (of course, there should be none).

diff --git a/cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/crypto_pw_repeat.html b/cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/crypto_pw_repeat.html new file mode 100644 index 0000000..7ddbd02 --- /dev/null +++ b/cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/crypto_pw_repeat.html @@ -0,0 +1,2 @@ +

Repeat the crypto password

+

This ensures, that you do not mistype your password.

diff --git a/cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/set_ip_address.html b/cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/set_ip_address.html new file mode 100644 index 0000000..a2bfe65 --- /dev/null +++ b/cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/set_ip_address.html @@ -0,0 +1,2 @@ +

Change the network address (IP)

+

Maybe you will have to reconfigure the network address of your local computer, too.

diff --git a/cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/set_language.html b/cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/set_language.html new file mode 100644 index 0000000..34e4844 --- /dev/null +++ b/cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/set_language.html @@ -0,0 +1,3 @@ +

Change the default language

+

This will set the default language of the web interface of this CryptoBox. Every user may change this temporarily +by selecting a language of choice in the upper right corner of the screen.

diff --git a/cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/set_timeout.html b/cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/set_timeout.html new file mode 100644 index 0000000..397fae8 --- /dev/null +++ b/cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/set_timeout.html @@ -0,0 +1,3 @@ +

Change the idle timeout

+

This value specifies, when the encrypted filesystem will be automatically unmounted. +The last access of the encrypted data starts this timer.

diff --git a/cbox-tree.d/var/www/cgi-bin/cryptobox.pl b/cbox-tree.d/var/www/cgi-bin/cryptobox.pl index 18473c8..1ef45cc 100755 --- a/cbox-tree.d/var/www/cgi-bin/cryptobox.pl +++ b/cbox-tree.d/var/www/cgi-bin/cryptobox.pl @@ -36,10 +36,10 @@ sub load_hdf() my $fname = "$TEMPLATE_DIR/main.cs"; die ("Template directory is invalid ($fname not found)!") unless (-e "$fname"); - $hdf->setValue("TemplateDir","$TEMPLATE_DIR"); + $hdf->setValue("Settings.TemplateDir","$TEMPLATE_DIR"); die ("Documentation directory ($DOC_DIR) not found!") unless (-d "$DOC_DIR"); - $hdf->setValue("DocDir","$DOC_DIR"); + $hdf->setValue("Settings.DocDir","$DOC_DIR"); # if it was requested as directory index (link from index.html), we should # set a real script name - otherwise links with a query string will break @@ -224,16 +224,30 @@ sub validate_timeout() } +# check for a valid interface language sub validate_language() { my $language = shift; # check for non-alphanumeric character return 0 if ($language =~ /\W/); + return 0 if ($language eq ""); return 0 if ( ! -e "$LANGUAGE_DIR/$language" . '.hdf'); return 1; } +# check for a valid documentation language +sub validate_doc_language() +{ + my $language = shift; + # check for non-alphanumeric character + return 0 if ($language =~ /\W/); + return 0 if ($language eq ""); + return 0 if ( ! -e "$DOC_DIR/$language" . '.hdf'); + return 1; +} + + ################### main ######################### my $query = new CGI; @@ -251,22 +265,25 @@ if ($query->param('weblang')) { &load_language_data($pagedata, "$weblang"); # add the setting to every link $pagedata->setValue('Data.PostData.weblang', "$weblang"); - # select documentation - if (-e "$DOC_DIR/$weblang") { - # selected web interface language - $pagedata->setValue('Data.DocLang', "$weblang"); - } elseif (-e "$DOC_DIR/$LANGUAGE") { - # default CryptoBox language - $pagedata->setValue('Data.DocLang', "$LANGUAGE"); - } else { - # default hardcoded language (english) - $pagedata->setValue('Data.DocLang', "en"); - } } else { $pagedata->setValue('Data.Warning', 'InvalidLanguage'); } } + +########## select documentation language ########## +if ($query->param('weblang') && &validate_doc_language($query->param('weblang'))) { + # selected web interface language + $pagedata->setValue('Settings.DocLang', "$query->param('weblang')"); +} elsif (&validate_doc_language($LANGUAGE)) { + # configured CryptoBox language + $pagedata->setValue('Settings.DocLang', "$LANGUAGE"); +} else { + # default hardcoded language (english) + $pagedata->setValue('Settings.DocLang', "en"); +} + + # first: check for ssl! if ( ! &check_ssl()) { $pagedata->setValue('Data.Error', 'NoSSL'); @@ -479,7 +496,7 @@ $pagedata->setValue('Data.Status.Mounted', &check_mounted() ? 1 : 0); my $output = &get_current_ip(); $pagedata->setValue('Data.Status.IP', "$output"); -($output = `$CB_SCRIPT diskinfo 2>&1`) =~ s#\Z#
#; +$output = `$CB_SCRIPT diskinfo 2>&1 | sed 's#\$#
#'`; $pagedata->setValue('Data.PartitionInfo',"$output"); # preset config settings for clearsilver diff --git a/cbox-tree.d/var/www/cryptobox.css b/cbox-tree.d/var/www/cryptobox.css index 0659278..533f352 100644 --- a/cbox-tree.d/var/www/cryptobox.css +++ b/cbox-tree.d/var/www/cryptobox.css @@ -7,7 +7,7 @@ body { margin: 0; padding: 0; font-family: verdana, lucida, arial, helvetica, sans-serif; -} + } #main { background: none; @@ -15,7 +15,7 @@ body { padding: 0px; margin-left: auto; margin-right: auto; -} + } #main h1, h2, h3 { font-family: sans-serif, arial; @@ -25,19 +25,19 @@ body { font-variant: small-caps; padding: 0 1em; text-align: left; -} + } #main h1 { font-size: 2em; -} + } #main h2 { font-size: 1.5em; -} + } #main h3 { font-size: 1.2em; -} + } #head { width: 600px; @@ -48,14 +48,14 @@ body { background-position: top right; background-attachment: scroll; background-repeat: no-repeat; -} + } #content { margin: 0; padding: 0; width: 600px; font-size: 0.9em; -} + } #content a { line-height: 1.2em; @@ -63,11 +63,11 @@ body { text-decoration: none; font-weight: bold; font-size: 0.9em; -} + } #content a:hover { text-decoration: underline; -} + } #content a:visited { color: #acacac; @@ -77,57 +77,57 @@ body { font-size: 0.9em; padding: 0 1em; text-align: justify; -} + } #menu { - text-align: center; - border-top: 1px solid #5e5e5e; - border-bottom: 1px solid #5e5e5e; - background-color: #ACE149; -} + text-align: center; + border-top: 1px solid #5e5e5e; + border-bottom: 1px solid #5e5e5e; + background-color: #ACE149; + } #menu a:link, #menu a:visited { - color: #5e5e5e; - margin: 5px; - text-decoration: none; - border: none; - padding: 4px; - font-size: 0.8em; -} + color: #5e5e5e; + margin: 5px; + text-decoration: none; + border: none; + padding: 4px; + font-size: 0.8em; + } #menu a:hover { - color: #8e8e8e; -} + color: #8e8e8e; + } #words { width: 565px; padding: 1.1em 0em 1.1em 1.1em; margin-top: 0; -} + } #words h1{ font-size: 1.8em; -} + } #words h2{ font-size: 1.4em; -} + } #words ol, #words ul { font-size: 0.9em; -} + } #words ol li { padding: 0 1em; line-height: 1.7em; -} + } #words ul li { padding: 0 1em; line-height: 1.7em; list-style: none; background: url(/cryptobox-img/list.gif) center left no-repeat; -} + } #footer { clear: both; @@ -137,7 +137,7 @@ body { background-color: #ACE149; font-size: 0.8em; color: #5e5e5e; -} + } #footer a:link, #footer a:visited { color: white; @@ -146,11 +146,11 @@ body { border: none; padding: 4px; color: #5e5e5e; -} + } #footer a:hover { text-decoration: underline; -} + } #confirmtext span { color: red; @@ -252,7 +252,7 @@ button { } button:hover { - background-color: #fff; + background-color: #D0F0A0; border: 1px solid #ACE149; color: #5e5e5e; font-size: 0.8em; @@ -271,7 +271,7 @@ button:hover { /* ------------=-=-=- language selection -=-=-=------------- */ #lang { - position: absolute; + position: fixed; float: right; right: 5px; top: 5px; @@ -317,7 +317,46 @@ button:hover { /* ------------=-=-=- special things -=-=-=------------- */ #partition_info p { - margin-left:10%; - margin-right:10%; - font-family:monospace + margin-left: 10%; + margin-right: 10%; + font-family: monospace + } + +#words a.popup { + line-height: inherit; + color: inherit; + text-decoration: inherit; + font-weight: inherit; + font-size: inherit; + } + +#words a.popup:hover { + text-decoration: inherit; + } + +#words a.popup span { + display: none; + position: fixed; + bottom: 10px; + left: 9%; + width: 80%; + background: #f0f0f0; + padding: 10px; + border-color: #e0e0e0; + border-width: 2px; + border-style: solid; + margin: 0; + } + +#words a.popup:hover span { + display: inline; + } + +#words a.popup span p { + text-align: left; + } + +#words a.popup span h3 { + color: #909090; + margin-top: 0px; }