Browse Source

removed last hard coded texts

'EnterCurrentCryptoPassword' added to language files
'EnterAdminPassword' renamed to 'EnterCurrentAdminPassword'
language file loaded immeadiately before rendering
sort language links in web interface lexically
reordered 'find' options to avoid warnings
master
lars 17 years ago
parent
commit
882b9d1bb7
  1. 7
      cbox-tree.d/usr/share/cryptobox/lang/de.hdf
  2. 9
      cbox-tree.d/usr/share/cryptobox/lang/en.hdf
  3. 3
      cbox-tree.d/usr/share/cryptobox/lang/si.hdf
  4. 2
      cbox-tree.d/usr/share/cryptobox/templates/config_form.cs
  5. 2
      cbox-tree.d/usr/share/cryptobox/templates/init_form.cs
  6. 1
      cbox-tree.d/usr/share/cryptobox/templates/macros.cs
  7. 6
      cbox-tree.d/usr/share/cryptobox/templates/mount_form.cs
  8. 89
      cbox-tree.d/var/www/cgi-bin/cryptobox.pl
  9. 6
      scripts/validate.sh

7
cbox-tree.d/usr/share/cryptobox/lang/de.hdf

@ -15,9 +15,10 @@ Lang {
Text {
EnterCurrentCryptoPassword = Das Crypto-Passwort eingeben:
EnterNewCryptoPassword = Das neue Crypto-Passwort eingeben:
EnterSameCryptoPassword = Das Crypto-Passwort wiederholen:
EnterAdminPassword = Das bisherige Admin-Passwort eingeben:
EnterCurrentAdminPassword = Das aktuelle Admin-Passwort eingeben:
EnterNewAdminPassword = Das neue Admin-Passwort eingeben:
EnterSameAdminPassword = Das neue Admin-Passwort wiederholen:
InitWarning = Bei der Initialisierung werden ALLE DATEN auf der Festplatte GELÖSCHT!
@ -41,8 +42,8 @@ Lang {
DoInit = CryptoBox initialisieren
SaveConfig = Speichere Konfiguration
Update = Aktualisieren
Mount = CryptoDaten aktivieren
Umount = CryptoDaten deaktivieren
Mount = Crypto-Daten aktivieren
Umount = Crypto-Daten deaktivieren
Config = Einstellungen
PowerOff = ausschalten
ReBoot = neu starten

9
cbox-tree.d/usr/share/cryptobox/lang/en.hdf

@ -15,9 +15,10 @@ Lang {
Text {
EnterCurrentCryptoPassword = Enter the crypto password:
EnterNewCryptoPassword = Enter the new crypto password:
EnterSameCryptoPassword = Repeat the new crypto password:
EnterAdminPassword = Enter the current administration password:
EnterCurrentAdminPassword = Enter the current administration password:
EnterNewAdminPassword = Enter the new administration password:
EnterSameAdminPassword = Repeat the new administration password:
InitWarning = During the process of initialization ALL DATA on the hard drive WILL BE DELETED!
@ -30,7 +31,7 @@ Lang {
SelectLanguage = Language preferences:
RedirectNote = Click here if your browser does not support automatic redirection.
ProjectHomePage = Website of project
ProjectNote = The CryptoBox is a product of
ProjectNote = The CryptoBox is a project of
DoUmount = Deactivation of the encrypted filesystem
DoMount = Activation of the encrypted filesystem
Configuration = Configuration
@ -41,8 +42,8 @@ Lang {
DoInit = Initialize CryptoBox
SaveConfig = Save configuration
Update = Refresh
Mount = activate encrypted filesystem
Umount = deactivate encrypted filesystem
Mount = Activate encrypted filesystem
Umount = Deactivate encrypted filesystem
Config = Configuration
PowerOff = Shutdown
ReBoot = Reboot

3
cbox-tree.d/usr/share/cryptobox/lang/si.hdf

@ -15,9 +15,10 @@ Lang {
Text {
EnterCurrentCryptoPassword = Vpišite geslo:
EnterNewCryptoPassword = Vpišite novo geslo:
EnterSameCryptoPassword = Ponovite novo geslo:
EnterAdminPassword = Vnesite trenutno obstoječe geslo administratorja/ke:
EnterCurrentAdminPassword = Vnesite trenutno obstoječe geslo administratorja/ke:
EnterNewAdminPassword = Vnesite novo geslo administratorja/ke:
EnterSameAdminPassword = Ponovite novo geslo administratorja/ke:
InitWarning = Med incializacijo bodo VSI PODATKI z vašega trdega diska IZBRISANI!

2
cbox-tree.d/usr/share/cryptobox/templates/config_form.cs

@ -5,7 +5,7 @@
enctype="application/x-www-form-urlencoded">
<?cs if:Data.Config.AdminPasswordIsSet ?>
<p><label for="current_admin_password"><?cs call:help_popUp(Lang.Text.EnterAdminPassword,"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>
<?cs /if ?>

2
cbox-tree.d/usr/share/cryptobox/templates/init_form.cs

@ -5,7 +5,7 @@
<p class="note"><?cs var:Lang.Text.InitWarning ?></p>
<?cs if:Data.Config.AdminPasswordIsSet ?>
<p><label for="current_admin_password"><?cs call:help_popUp(Lang.Text.EnterAdminPassword,"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>
<?cs /if ?>
<p><label for="admin_password"><?cs call:help_popUp(Lang.Text.EnterNewAdminPassword,"new_admin_pw") ?></label><br/>

1
cbox-tree.d/usr/share/cryptobox/templates/macros.cs

@ -70,6 +70,7 @@
<?cs def:help_popUp_broken(text,filename) ?><?cs #
# show a pop-up information block on the right side of the screen
# usually good for small explanatory texts
# does not work for ie?
?><a class="popup"><?cs
var:text ?><span><?cs
linclude:Settings.DocDir + '/' + Settings.DocLang + '/hints/' + filename + '.html' ?></span></a><?cs

6
cbox-tree.d/usr/share/cryptobox/templates/mount_form.cs

@ -1,13 +1,13 @@
<h1>Aktivierung des verschl&uuml;sselten Dateisystems</h1>
<h1><?cs var:Lang.Title.Mount ?></h1>
<div align="center">
<form action="<?cs call:getSelfURL('','') ?>" method="post"
enctype="application/x-www-form-urlencoded">
<p><label for="crypto_passwort">Passwort eingeben:</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>
<button type="submit" name="action" value="mount_do">Dateisystem aktivieren</button>
<button type="submit" name="action" value="mount_do"><?cs var:Lang.Button.Mount ?></button>
</form>
</div>

89
cbox-tree.d/var/www/cgi-bin/cryptobox.pl

@ -13,7 +13,7 @@ use ConfigFile;
my ($pagedata, $pagename);
my ($LANGUAGE_DIR, $LANGUAGE, $HTML_TEMPLATE_DIR, $DOC_DIR);
my ($LANGUAGE_DIR, $DEFAULT_LANGUAGE, $HTML_TEMPLATE_DIR, $DOC_DIR);
my ($CB_SCRIPT, $LOG_FILE, $IS_DEV);
my $config = ConfigFile::read_config_file('/etc/cryptobox/cryptobox.conf');
@ -21,12 +21,13 @@ my $config = ConfigFile::read_config_file('/etc/cryptobox/cryptobox.conf');
$CB_SCRIPT = $config->{CB_SCRIPT};
$LOG_FILE = $config->{LOG_FILE};
$LANGUAGE_DIR = $config->{LANGUAGE_DIR};
# language setting may be later overriden by "weblang"
$LANGUAGE = $config->{LANGUAGE};
$DEFAULT_LANGUAGE = $config->{LANGUAGE};
$HTML_TEMPLATE_DIR = $config->{HTML_TEMPLATE_DIR};
$DOC_DIR = $config->{DOC_DIR};
$IS_DEV = ( -e $config->{DEV_FEATURES_SCRIPT});
my $query = new CGI;
#################### subs ######################
@ -47,24 +48,52 @@ sub load_hdf
(my $script_url = $ENV{'SCRIPT_NAME'}) =~ m/^[^&]*/;
$hdf->setValue("ScriptName", ($ENV{'SCRIPT_NAME'} eq '/')? '/cryptobox' : $script_url );
&load_language_data($hdf, $LANGUAGE);
&get_available_languages($hdf);
return $hdf;
}
sub load_language_data
# import the specified language data
# every call overrides previously loaded values
# it is sufficient to call it somewhere before "render"
sub load_selected_language
{
my $data = shift;
my $lang = shift;
my $fname = "$LANGUAGE_DIR/$lang" . '.hdf';
die ("Language file ($fname) not found!") unless (-e "$fname");
$data->readFile("$fname");
my $config_language;
# load $DEFAULT_LANGUAGE - this is necessary, if a translation is incomplete
$data->readFile("$LANGUAGE_DIR/$DEFAULT_LANGUAGE" . ".hdf");
# load configured language, if it is valid
$config_language = `$CB_SCRIPT get_config language`;
$config_language = $DEFAULT_LANGUAGE unless (&validate_language("$config_language"));
######### temporary language setting? ############
# the default language can be overriden by the language links in the
# upper right of the page
if ($query->param('weblang')) {
my $weblang = $query->param('weblang');
if (&validate_language($weblang)) {
# load the data
$config_language = "$weblang";
# add the setting to every link
$pagedata->setValue('Data.PostData.weblang', "$weblang");
} else {
$pagedata->setValue('Data.Warning', 'InvalidLanguage');
}
}
# import the configured resp. the temporarily selected language
$data->readFile("$LANGUAGE_DIR/$config_language" . ".hdf");
########## select documentation language ##########
if (&validate_doc_language($config_language)) {
# selected web interface language
$pagedata->setValue('Settings.DocLang', "$config_language");
} elsif (&validate_doc_language($DEFAULT_LANGUAGE)) {
# configured CryptoBox language
$pagedata->setValue('Settings.DocLang', "$DEFAULT_LANGUAGE");
} else {
# default hardcoded language (english)
$pagedata->setValue('Settings.DocLang', "en");
}
}
@ -75,7 +104,7 @@ sub get_available_languages
my ($file, @files, $hdf, $lang_name);
opendir(DIR, $LANGUAGE_DIR) or die ("Language directory ($LANGUAGE_DIR) not accessible!");
@files = grep { /.*\.hdf$/ } readdir(DIR);
@files = sort grep { /.*\.hdf$/ } readdir(DIR);
close(DIR);
foreach $file (@files) {
@ -146,6 +175,8 @@ sub get_admin_pw
sub render
{
&load_selected_language($pagedata);
$pagedata->setValue("PageName","$pagename");
my $pagefile = "$HTML_TEMPLATE_DIR/main.cs";
print "Content-Type: text/html\n\n";
@ -260,40 +291,10 @@ sub validate_doc_language
################### main #########################
my $query = new CGI;
$pagedata = load_hdf();
######### temporary language setting? ############
# the default language can be overriden by the language links in the
# upper right of the page
if ($query->param('weblang')) {
my $weblang = $query->param('weblang');
if (&validate_language($weblang)) {
# load the data
&load_language_data($pagedata, "$weblang");
# add the setting to every link
$pagedata->setValue('Data.PostData.weblang', "$weblang");
} 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');

6
scripts/validate.sh

@ -38,7 +38,7 @@ function do_series()
{
[ -d "$VALIDATE_REPORT_DIR/$1" ] && rm -r "$VALIDATE_REPORT_DIR/$1"
mkdir -p "$VALIDATE_REPORT_DIR/$1"
find "$VALIDATE_TEST_CASES_DIR/$1" -type d -maxdepth 1 -mindepth 1 | grep -v "/\.[^/]*$" | sort | while read a
find "$VALIDATE_TEST_CASES_DIR/$1" -maxdepth 1 -mindepth 1 -type d | grep -v "/\.[^/]*$" | sort | while read a
do do_single "$a" "$VALIDATE_REPORT_DIR/$1"
done
create_summary "$1" >"$VALIDATE_REPORT_DIR/summary-$1.html"
@ -49,7 +49,7 @@ function create_summary()
# parameter: name of test series
{
cat "$VALIDATE_SUMMARY_TEMPLATE_DIR/header"
find "$VALIDATE_REPORT_DIR/$1" -type f -name \*.desc -maxdepth 1 | sort | while read a
find "$VALIDATE_REPORT_DIR/$1" -maxdepth 1 -type f -name \*.desc | sort | while read a
do TESTNAME=$(basename ${a%.desc})
TESTDESCRIPTION=$(cat $a)
sed "s#_TESTSERIES_#$1#g; s#_TESTNAME_#$TESTNAME#g; s/_TESTDESCRIPTION_/$TESTDESCRIPTION/" "$VALIDATE_SUMMARY_TEMPLATE_DIR/single_header"
@ -102,7 +102,7 @@ ACTION="--help"
case "$ACTION" in
list )
find "$VALIDATE_TEST_CASES_DIR" -type d -maxdepth 1 -mindepth 1 | grep -v "/\.[^/]*$" | sort | while read a
find "$VALIDATE_TEST_CASES_DIR" -maxdepth 1 -mindepth 1 -type d | grep -v "/\.[^/]*$" | sort | while read a
do echo $(basename "$a")
done
;;

Loading…
Cancel
Save