css: language selection position is now 'fixed' instead of 'absolute'

added context sensitive help (hover)
css: changed hovered color of buttons to light green
hdf: renamed some elements of the data tree
cgi: language validation fixed
cgi: documentation language setting fixed
cgi: diskinfo rendering fixed
This commit is contained in:
lars 2005-09-06 23:28:12 +00:00
parent 36c46b8ece
commit 2cec33cd2c
14 changed files with 155 additions and 69 deletions

View File

@ -4,15 +4,15 @@
<form action="<?cs call:getSelfURL('','') ?>" method="post" <form action="<?cs call:getSelfURL('','') ?>" method="post"
enctype="application/x-www-form-urlencoded"> enctype="application/x-www-form-urlencoded">
<p><label for="ip"><?cs var:Lang.Text.IPAddress ?></label><br/> <p><label for="ip"><?cs call:help_popUp(Lang.Text.IPAddress,'set_ip_address') ?></label><br/>
<input type="text" id="ip" size="16" maxsize="15" name="ip" <input type="text" id="ip" size="16" maxsize="15" name="ip"
value="<?cs var:Data.Config.IP ?>" /><p> value="<?cs var:Data.Config.IP ?>" /><p>
<p><label for="timeout"><?cs var:Lang.Text.TimeOut ?></label><br/> <p><label for="timeout"><?cs call:help_popUp(Lang.Text.TimeOut,'set_timeout') ?></label><br/>
<input type="text" id="timeout" size="5" maxsize="5" name="timeout" <input type="text" id="timeout" size="5" maxsize="5" name="timeout"
value="<?cs var:Data.Config.TimeOut ?>" /></p> value="<?cs var:Data.Config.TimeOut ?>" /></p>
<p><label for="language"><?cs var:Lang.Text.SelectLanguage ?></label><br/> <p><label for="language"><?cs call:help_popUp(Lang.Text.SelectLanguage,'set_language') ?></label><br/>
<select name="language"> <select name="language">
<?cs each:item = Data.Languages ?> <?cs each:item = Data.Languages ?>
<option value="<?cs name:item ?>" <?cs if:(name(item) == Data.Config.Language) ?>selected="selected"<?cs /if ?>><?cs var:item ?></option> <option value="<?cs name:item ?>" <?cs if:(name(item) == Data.Config.Language) ?>selected="selected"<?cs /if ?>><?cs var:item ?></option>

View File

@ -1,5 +1,5 @@
<div id="doc"> <div id="doc">
<?cs include:DocDir + '/' + DocLang + '/' + Data.Doc.Page + '.html' ?> <?cs include:Settings.DocDir + '/' + Settings.DocLang + '/' + Data.Doc.Page + '.html' ?>
</div> </div>

View File

@ -29,7 +29,7 @@
<!-- the menu bar is disabled if redirection has been suggested --> <!-- the menu bar is disabled if redirection has been suggested -->
<?cs else ?> <?cs else ?>
<div id="menu"> <div id="menu">
<?cs include:TemplateDir + '/nav.cs' ?> <?cs include:Settings.TemplateDir + '/nav.cs' ?>
</div> </div>
<?cs /if ?> <?cs /if ?>

View File

@ -4,11 +4,11 @@
<form action="<?cs call:getSelfURL('','') ?>" method="post" enctype="application/x-www-form-urlencoded"> <form action="<?cs call:getSelfURL('','') ?>" method="post" enctype="application/x-www-form-urlencoded">
<p class="note"><?cs var:Lang.Text.InitWarning ?></p> <p class="note"><?cs var:Lang.Text.InitWarning ?></p>
<p><label for="password"><?cs var:Lang.Text.EnterNewPassword ?></label><br/> <p><label for="password"><?cs call:help_popUp(Lang.Text.EnterNewPassword,"crypto_pw") ?></label><br/>
<input type="password" id="password" name="password" size="20" tabindex="1" maxlength="40" /></p> <input type="password" id="password" name="password" size="20" tabindex="1" maxlength="40" /></p>
<p><label for="password2"><?cs var:Lang.Text.EnterSamePassword ?></label><br/> <p><label for="password2"><?cs call:help_popUp(Lang.Text.EnterSamePassword,'crypto_pw_repeat') ?></label><br/>
<input type="password" id="password2" name="password2" size="20" tabindex="2" maxlength="40" /></p> <input type="password" id="password2" name="password2" size="20" tabindex="2" maxlength="40" /></p>
<p><label for="confirm"><?cs var:Lang.Text.ConfirmInitHint ?><br/> <p><label for="confirm"><?cs call:help_popUp(Lang.Text.ConfirmInitHint,'confirm_text') ?><br/>
<span class="note" id="confirmtext"><?cs var:Lang.Text.ConfirmInit ?></span></label><br/> <span class="note" id="confirmtext"><?cs var:Lang.Text.ConfirmInit ?></span></label><br/>
<input type="text" id="confirm" name="confirm" size="30" tabindex="3" maxlength="50" /></p> <input type="text" id="confirm" name="confirm" size="30" tabindex="3" maxlength="50" /></p>
<button type="submit" name="action" value="init_do" tabindex="4"><?cs var:Lang.Button.DoInit ?></button> <button type="submit" name="action" value="init_do" tabindex="4"><?cs var:Lang.Button.DoInit ?></button>

View File

@ -53,9 +53,8 @@
# e.g.: # e.g.:
# - 'append' is 'weblang=de' # - 'append' is 'weblang=de'
# - 'exclude' is 'weblang' # - 'exclude' is 'weblang'
# BEWARE: there is a bug (?) in clearsilver, that occours, if # BEWARE: both parameters have to be defined!
# only one of the arguments is set (none or both are fine) ?><?cs set:PostSuffix='' ?><?cs
?><?cs set:PostSuffix='' ?><?cs
set:tmp_concat='?' ?><?cs set:tmp_concat='?' ?><?cs
each:item = Data.PostData ?><?cs each:item = Data.PostData ?><?cs
if:(name(item) != exclude) ?><?cs if:(name(item) != exclude) ?><?cs
@ -68,3 +67,12 @@
var:ScriptName ?><?cs var:PostSuffix ?><?cs var:ScriptName ?><?cs var:PostSuffix ?><?cs
/def ?> /def ?>
<?cs def:help_popUp(text,filename) ?><?cs #
# show a pop-up information block on the right side of the screen
# usually good for small explanatory texts
?><a class="popup"><?cs
var:text ?><span><?cs
linclude:Settings.DocDir + '/' + Settings.DocLang + '/hints/' + filename + '.html' ?></span></a><?cs
/def ?>

View File

@ -1,14 +1,14 @@
<?cs include:TemplateDir + '/macros.cs' ?> <?cs include:Settings.TemplateDir + '/macros.cs' ?>
<?cs include:TemplateDir + '/header.cs' ?> <?cs include:Settings.TemplateDir + '/header.cs' ?>
<!-- this cryptobox template follows: <?cs var:Data.Action ?> --> <!-- this cryptobox template follows: <?cs var:Data.Action ?> -->
<?cs if:Data.Error ?> <?cs if:Data.Error ?>
<?cs include:TemplateDir + '/error.cs' ?> <?cs include:Settings.TemplateDir + '/error.cs' ?>
<?cs else ?> <?cs else ?>
<?cs if:Data.Warning ?><?cs call:warning(Data.Warning) ?><?cs /if ?> <?cs if:Data.Warning ?><?cs call:warning(Data.Warning) ?><?cs /if ?>
<?cs if:Data.Success ?><?cs call:success(Data.Success) ?><?cs /if ?> <?cs if:Data.Success ?><?cs call:success(Data.Success) ?><?cs /if ?>
<?cs include:TemplateDir + '/' + Data.Action + '.cs' ?> <?cs include:Settings.TemplateDir + '/' + Data.Action + '.cs' ?>
<?cs /if ?> <?cs /if ?>
<?cs include:TemplateDir + '/footer.cs' ?> <?cs include:Settings.TemplateDir + '/footer.cs' ?>

View File

@ -0,0 +1,2 @@
<h3>Confirmation text</h3>
<p>Type the confirmation text exactly the way, it is said. This confirms, that you know, what you are doing.</p>

View File

@ -0,0 +1,10 @@
<h3>Password of encrypted filesystem</h3>
<p>This password is the final protection for your sensible data. You should
choose a complicated password, that fullfills at least the following requirements:</p>
<ul>
<li>more than 20 characters</li>
<li>contain lowercase, uppercase, numbers, special characters</li>
<li>may not be written anywhere in cleartext</li>
</ul>
<p>Do not forget your encryption password! There is no way to recover your data
without it (of course, there should be none).</p>

View File

@ -0,0 +1,2 @@
<h3>Repeat the crypto password</h3>
<p>This ensures, that you do not mistype your password.</p>

View File

@ -0,0 +1,2 @@
<h3>Change the network address (IP)</h3>
<p>Maybe you will have to reconfigure the network address of your local computer, too.</p>

View File

@ -0,0 +1,3 @@
<h3>Change the default language</h3>
<p>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.</p>

View File

@ -0,0 +1,3 @@
<h3>Change the idle timeout</h3>
<p>This value specifies, when the encrypted filesystem will be automatically unmounted.
The last access of the encrypted data starts this timer.</p>

View File

@ -36,10 +36,10 @@ sub load_hdf()
my $fname = "$TEMPLATE_DIR/main.cs"; my $fname = "$TEMPLATE_DIR/main.cs";
die ("Template directory is invalid ($fname not found)!") unless (-e "$fname"); 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"); 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 # 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 # 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() sub validate_language()
{ {
my $language = shift; my $language = shift;
# check for non-alphanumeric character # check for non-alphanumeric character
return 0 if ($language =~ /\W/); return 0 if ($language =~ /\W/);
return 0 if ($language eq "");
return 0 if ( ! -e "$LANGUAGE_DIR/$language" . '.hdf'); return 0 if ( ! -e "$LANGUAGE_DIR/$language" . '.hdf');
return 1; 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 ######################### ################### main #########################
my $query = new CGI; my $query = new CGI;
@ -251,22 +265,25 @@ if ($query->param('weblang')) {
&load_language_data($pagedata, "$weblang"); &load_language_data($pagedata, "$weblang");
# add the setting to every link # add the setting to every link
$pagedata->setValue('Data.PostData.weblang', "$weblang"); $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 { } else {
$pagedata->setValue('Data.Warning', 'InvalidLanguage'); $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! # first: check for ssl!
if ( ! &check_ssl()) { if ( ! &check_ssl()) {
$pagedata->setValue('Data.Error', 'NoSSL'); $pagedata->setValue('Data.Error', 'NoSSL');
@ -479,7 +496,7 @@ $pagedata->setValue('Data.Status.Mounted', &check_mounted() ? 1 : 0);
my $output = &get_current_ip(); my $output = &get_current_ip();
$pagedata->setValue('Data.Status.IP', "$output"); $pagedata->setValue('Data.Status.IP', "$output");
($output = `$CB_SCRIPT diskinfo 2>&1`) =~ s#\Z#<br/>#; $output = `$CB_SCRIPT diskinfo 2>&1 | sed 's#\$#<br/>#'`;
$pagedata->setValue('Data.PartitionInfo',"$output"); $pagedata->setValue('Data.PartitionInfo',"$output");
# preset config settings for clearsilver # preset config settings for clearsilver

View File

@ -7,7 +7,7 @@ body {
margin: 0; margin: 0;
padding: 0; padding: 0;
font-family: verdana, lucida, arial, helvetica, sans-serif; font-family: verdana, lucida, arial, helvetica, sans-serif;
} }
#main { #main {
background: none; background: none;
@ -15,7 +15,7 @@ body {
padding: 0px; padding: 0px;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
#main h1, h2, h3 { #main h1, h2, h3 {
font-family: sans-serif, arial; font-family: sans-serif, arial;
@ -25,19 +25,19 @@ body {
font-variant: small-caps; font-variant: small-caps;
padding: 0 1em; padding: 0 1em;
text-align: left; text-align: left;
} }
#main h1 { #main h1 {
font-size: 2em; font-size: 2em;
} }
#main h2 { #main h2 {
font-size: 1.5em; font-size: 1.5em;
} }
#main h3 { #main h3 {
font-size: 1.2em; font-size: 1.2em;
} }
#head { #head {
width: 600px; width: 600px;
@ -48,14 +48,14 @@ body {
background-position: top right; background-position: top right;
background-attachment: scroll; background-attachment: scroll;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
#content { #content {
margin: 0; margin: 0;
padding: 0; padding: 0;
width: 600px; width: 600px;
font-size: 0.9em; font-size: 0.9em;
} }
#content a { #content a {
line-height: 1.2em; line-height: 1.2em;
@ -63,11 +63,11 @@ body {
text-decoration: none; text-decoration: none;
font-weight: bold; font-weight: bold;
font-size: 0.9em; font-size: 0.9em;
} }
#content a:hover { #content a:hover {
text-decoration: underline; text-decoration: underline;
} }
#content a:visited { #content a:visited {
color: #acacac; color: #acacac;
@ -77,57 +77,57 @@ body {
font-size: 0.9em; font-size: 0.9em;
padding: 0 1em; padding: 0 1em;
text-align: justify; text-align: justify;
} }
#menu { #menu {
text-align: center; text-align: center;
border-top: 1px solid #5e5e5e; border-top: 1px solid #5e5e5e;
border-bottom: 1px solid #5e5e5e; border-bottom: 1px solid #5e5e5e;
background-color: #ACE149; background-color: #ACE149;
} }
#menu a:link, #menu a:visited { #menu a:link, #menu a:visited {
color: #5e5e5e; color: #5e5e5e;
margin: 5px; margin: 5px;
text-decoration: none; text-decoration: none;
border: none; border: none;
padding: 4px; padding: 4px;
font-size: 0.8em; font-size: 0.8em;
} }
#menu a:hover { #menu a:hover {
color: #8e8e8e; color: #8e8e8e;
} }
#words { #words {
width: 565px; width: 565px;
padding: 1.1em 0em 1.1em 1.1em; padding: 1.1em 0em 1.1em 1.1em;
margin-top: 0; margin-top: 0;
} }
#words h1{ #words h1{
font-size: 1.8em; font-size: 1.8em;
} }
#words h2{ #words h2{
font-size: 1.4em; font-size: 1.4em;
} }
#words ol, #words ul { #words ol, #words ul {
font-size: 0.9em; font-size: 0.9em;
} }
#words ol li { #words ol li {
padding: 0 1em; padding: 0 1em;
line-height: 1.7em; line-height: 1.7em;
} }
#words ul li { #words ul li {
padding: 0 1em; padding: 0 1em;
line-height: 1.7em; line-height: 1.7em;
list-style: none; list-style: none;
background: url(/cryptobox-img/list.gif) center left no-repeat; background: url(/cryptobox-img/list.gif) center left no-repeat;
} }
#footer { #footer {
clear: both; clear: both;
@ -137,7 +137,7 @@ body {
background-color: #ACE149; background-color: #ACE149;
font-size: 0.8em; font-size: 0.8em;
color: #5e5e5e; color: #5e5e5e;
} }
#footer a:link, #footer a:visited { #footer a:link, #footer a:visited {
color: white; color: white;
@ -146,11 +146,11 @@ body {
border: none; border: none;
padding: 4px; padding: 4px;
color: #5e5e5e; color: #5e5e5e;
} }
#footer a:hover { #footer a:hover {
text-decoration: underline; text-decoration: underline;
} }
#confirmtext span { #confirmtext span {
color: red; color: red;
@ -252,7 +252,7 @@ button {
} }
button:hover { button:hover {
background-color: #fff; background-color: #D0F0A0;
border: 1px solid #ACE149; border: 1px solid #ACE149;
color: #5e5e5e; color: #5e5e5e;
font-size: 0.8em; font-size: 0.8em;
@ -271,7 +271,7 @@ button:hover {
/* ------------=-=-=- language selection -=-=-=------------- */ /* ------------=-=-=- language selection -=-=-=------------- */
#lang { #lang {
position: absolute; position: fixed;
float: right; float: right;
right: 5px; right: 5px;
top: 5px; top: 5px;
@ -317,7 +317,46 @@ button:hover {
/* ------------=-=-=- special things -=-=-=------------- */ /* ------------=-=-=- special things -=-=-=------------- */
#partition_info p { #partition_info p {
margin-left:10%; margin-left: 10%;
margin-right:10%; margin-right: 10%;
font-family:monospace 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;
} }