gnupg settings interface implemented
gnupg key generation interface implemented use better way of recognising available options and settings (seperate form value)
This commit is contained in:
parent
bda51b0100
commit
807de1a0d7
|
@ -14,6 +14,7 @@ use Getopt::Std;
|
|||
use ClearSilver;
|
||||
use Mail::Ezmlm;
|
||||
use Mail::Address;
|
||||
use File::Copy;
|
||||
use File::Path;
|
||||
use DB_File;
|
||||
use CGI;
|
||||
|
@ -518,7 +519,7 @@ sub set_pagedata4list_gnupg() {
|
|||
my %config = $gpg_list->getconfig();
|
||||
my $item;
|
||||
foreach $item (keys %config) {
|
||||
$pagedata->setValue("Data.List.gnupg_options.$item", $config{$item});
|
||||
$pagedata->setValue("Data.List.Options.gnupg_$item", $config{$item});
|
||||
}
|
||||
|
||||
# retrieve the currently available public keys
|
||||
|
@ -1138,7 +1139,7 @@ sub create_list {
|
|||
sub extract_options_from_params()
|
||||
{
|
||||
# Work out the command line options ...
|
||||
my ($options, $avail_options, $settings, $avail_settings, $i);
|
||||
my ($options, $settings, $i);
|
||||
my ($listname, $old_options, $state, $old_key);
|
||||
|
||||
# NOTE: we have to define _every_ (even unchanged) setting
|
||||
|
@ -1157,11 +1158,10 @@ sub extract_options_from_params()
|
|||
################ options ################
|
||||
$i = 0;
|
||||
$old_key = substr($old_options,$i,1);
|
||||
$avail_options = $q->param('options_available');
|
||||
# parse the first part of the options string
|
||||
while ($old_key =~ m/\w/) {
|
||||
# scan the first part of the options string for lower case letters
|
||||
if ($avail_options =~ m/$old_key/i) {
|
||||
if (defined($q->param('available_option_' . lc($old_key)))) {
|
||||
my $form_var_name = "option_" . lc($old_key);
|
||||
# this option was visible for the user
|
||||
if (defined($q->param($form_var_name))) {
|
||||
|
@ -1181,9 +1181,8 @@ sub extract_options_from_params()
|
|||
|
||||
|
||||
############### settings ################
|
||||
$avail_settings = $q->param('settings_available');
|
||||
for ($i=0; $i<=9; $i++) {
|
||||
if ($avail_settings =~ m/$i/) {
|
||||
if (defined($q->param('available_setting_' . $i))) {
|
||||
# this setting was visible for the user
|
||||
if (defined($q->param("setting_state_$i"))) {
|
||||
$options .= " -$i '" . $q->param("setting_value_$i") . "'";
|
||||
|
|
11
lang/de.hdf
11
lang/de.hdf
|
@ -146,6 +146,13 @@ Lang {
|
|||
w = Entferne den Aufruf von ezmlm-warn aus den Verarbeitungsregeln (für sehr spezielle Konfigurationen)
|
||||
x = Prüfe die MIME-Typen der Anhänge eingehender Nachrichten
|
||||
y = Fordere eine Bestätigung für jede eingesandte Nachricht an
|
||||
gnupg_allowKeySubmission = Erlaube die Einsendung von Schlüsseln per Mail
|
||||
gnupg_encryptToAll = Verschlüssele an alle Empfänger gleichzeitig (keine individuell verschlüsselten Mails)
|
||||
gnupg_NokeyNocrypt = Sende Nachrichten im Klartext an Empfänger ohne Schlüssel
|
||||
gnupg_RequireSub = Nur AbonnentInnen dürfen Nachrichten einsenden
|
||||
gnupg_signMessages = Signiere ausgehende Nachrichten mit dem Listenschlüssel
|
||||
gnupg_VerifiedKeyReq = Verwende ausschliesslich verifizierte Schlüssel
|
||||
gnupg_requireSigs = Nur korrekt signierte Nachrichten werden angenommen
|
||||
}
|
||||
|
||||
|
||||
|
@ -206,6 +213,9 @@ Lang {
|
|||
NoPublicKeys = Es sind keine öffentlichen Schlüssel vorhanden.
|
||||
NoSecretKeys = Es sind keine privaten Schlüssel vorhanden.
|
||||
GnupgImportKey = Schlüssel aus einer Datei importieren:
|
||||
GnupgKeyName = Die Bezeichung des Schlüssels
|
||||
GnupgKeyComment = Ein Kommentar (optional)
|
||||
GnupgKeySize = Die Länge des Schlüssels
|
||||
}
|
||||
|
||||
|
||||
|
@ -252,5 +262,6 @@ Lang {
|
|||
GnupgPublicKeys = öffentliche Schlüssel dieser Liste
|
||||
GnupgSecretKeys = Private Schlüssel dieser Liste
|
||||
GnupgKeyImport = Schlüssel importieren
|
||||
GnupgGenerateKey = Schlüssel der Liste erzeugen
|
||||
}
|
||||
}
|
||||
|
|
11
lang/en.hdf
11
lang/en.hdf
|
@ -146,6 +146,13 @@ Lang {
|
|||
w = Remove the ezmlm-warn invocations from the list setup (rarely useful)
|
||||
x = Remove or reject specific mime types in messages
|
||||
y = Request a confirmation mail for every posted message
|
||||
gnupg_allowKeySubmission = Allow key submission via mail
|
||||
gnupg_encryptToAll = Encrypt to all recipients at once (do not encrypt inividually)
|
||||
gnupg_NokeyNocrypt = Send plaintext to the subscribers which have no key
|
||||
gnupg_RequireSub = Only subscribers may post messages
|
||||
gnupg_signMessages = Sign outgoing messages with the list's key
|
||||
gnupg_VerifiedKeyReq = Use only verified keys
|
||||
gnupg_requireSigs = Only verifiably signed messages are accepted
|
||||
}
|
||||
|
||||
|
||||
|
@ -206,6 +213,9 @@ Lang {
|
|||
NoPublicKeys = There are no public keys available.
|
||||
NoSecretKeys = There are no secret keys available.
|
||||
GnupgImportKey = Import a new key from a file:
|
||||
GnupgKeyName = Name of the key
|
||||
GnupgKeyComment = Comment (optional)
|
||||
GnupgKeySize = Length of the key
|
||||
}
|
||||
|
||||
|
||||
|
@ -252,5 +262,6 @@ Lang {
|
|||
GnupgPublicKeys = Public keys of this list
|
||||
GnupgSecretKeys = Secret keys of this list
|
||||
GnupgKeyImport = Import a key
|
||||
GnupgGenerateKey = Generate the key for this list
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
<!-- REMOVE --><?cs include:TemplateDir + '/macros.cs' ?>
|
||||
<!-- Gnupg: allow key submission -->
|
||||
<?cs call:checkbox("gnupg_allowKeySubmission") ?>
|
|
@ -0,0 +1,3 @@
|
|||
<!-- REMOVE --><?cs include:TemplateDir + '/macros.cs' ?>
|
||||
<!-- Gnupg: encrypt to all -->
|
||||
<?cs call:checkbox("gnupg_encryptToAll") ?>
|
|
@ -0,0 +1,4 @@
|
|||
<!-- comment for the key (second part of the human readable key description) -->
|
||||
|
||||
<label for="gnupg_keycomment"><?cs var:html_escape(Lang.Misc.GnupgKeyComment) ?>:</label>
|
||||
<input type="text" name="gnupg_keycomment" id="gnupg_keycomment" size="25">
|
|
@ -0,0 +1,4 @@
|
|||
<!-- name of the key (first part of the human readable key description) -->
|
||||
|
||||
<label for="gnupg_keyname"><?cs var:html_escape(Lang.Misc.GnupgKeyName) ?>:</label>
|
||||
<input type="text" name="gnupg_keyname" id="gnupg_keyname" size="25">
|
|
@ -0,0 +1,9 @@
|
|||
<!-- REMOVE --><?cs include:TemplateDir + '/macros.cs' ?>
|
||||
<!-- length of the key (bytes) -->
|
||||
<select name="setting_gnupg_keysize" size="1" id="setting_gnupg_keysize">
|
||||
<option>1024</option>
|
||||
<option selected="selected">2048</option>
|
||||
<option>4096</option>
|
||||
</select>
|
||||
<label for="setting_gnupg_keysize"><?cs var:Lang.Misc.GnupgKeySize ?></label>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<!-- REMOVE --><?cs include:TemplateDir + '/macros.cs' ?>
|
||||
<!-- Gnupg: send plaintext if no key is available -->
|
||||
<?cs call:checkbox("gnupg_NokeyNocrypt") ?>
|
3
template/config_options/gnupg_require_sigs.cs
Normal file
3
template/config_options/gnupg_require_sigs.cs
Normal file
|
@ -0,0 +1,3 @@
|
|||
<!-- REMOVE --><?cs include:TemplateDir + '/macros.cs' ?>
|
||||
<!-- Gnupg: require signed messages -->
|
||||
<?cs call:checkbox("gnupg_requireSigs") ?>
|
|
@ -0,0 +1,3 @@
|
|||
<!-- REMOVE --><?cs include:TemplateDir + '/macros.cs' ?>
|
||||
<!-- Gnupg: require subscriber -->
|
||||
<?cs call:checkbox("gnupg_RequireSub") ?>
|
|
@ -0,0 +1,3 @@
|
|||
<!-- REMOVE --><?cs include:TemplateDir + '/macros.cs' ?>
|
||||
<!-- Gnupg: sign outgoing messages -->
|
||||
<?cs call:checkbox("gnupg_signMessages") ?>
|
|
@ -0,0 +1,3 @@
|
|||
<!-- REMOVE --><?cs include:TemplateDir + '/macros.cs' ?>
|
||||
<!-- Gnupg: require keys to be trusted -->
|
||||
<?cs call:checkbox("gnupg_VerifiedKeyReq") ?>
|
|
@ -2,8 +2,3 @@
|
|||
|
||||
<input type="hidden" name="list" value="<?cs var:Data.List.Name ?>" />
|
||||
|
||||
<!-- "available_options" is filled by the checkbox macro -->
|
||||
<input type="hidden" name="options_available" value="<?cs var:available_options ?>" />
|
||||
<!-- "available_settings" is filled by the setting macro -->
|
||||
<input type="hidden" name="settings_available" value="<?cs var:available_settings ?>" />
|
||||
|
||||
|
|
|
@ -5,8 +5,9 @@
|
|||
if:(Data.List.Options[option] == 1) ?>checked="checked"<?cs
|
||||
/if ?> /> <label for="option_<?cs var:option ?>"><?cs
|
||||
var:html_escape(Lang.Options[option])
|
||||
?></label><?cs
|
||||
set:available_options = available_options + option ?><?cs
|
||||
?></label>
|
||||
<input type="hidden" name="available_option_<?cs
|
||||
var:option ?>" value="true" /><?cs
|
||||
else ?>unknown option (<?cs var:option ?>)<?cs /if ?><?cs
|
||||
/def ?><?cs
|
||||
|
||||
|
@ -19,8 +20,9 @@ def:setting(setting)
|
|||
var:html_escape(Lang.Settings[setting])
|
||||
?></label><ul><li><input type="text" name="setting_value_<?cs var:setting
|
||||
?>" id="setting_value_<?cs var:setting ?>" value="<?cs
|
||||
var:html_escape(Data.List.Settings[setting].value) ?>" size="30" /></li></ul><?cs
|
||||
set:available_settings = available_settings + setting ?><?cs
|
||||
var:html_escape(Data.List.Settings[setting].value) ?>" size="30" /></li></ul>
|
||||
<input type="hidden" name="available_setting_<?cs
|
||||
var:setting ?>" value="true"><?cs
|
||||
else ?>unknown setting (<?cs var:setting ?>)<?cs /if ?><?cs
|
||||
/def ?><?cs
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@ UI {
|
|||
KeyName = gnupg_keyname
|
||||
KeyComment = gnupg_keycomment
|
||||
KeySize = gnupg_keysize
|
||||
KeyType = gnupg_keytype
|
||||
}
|
||||
|
||||
|
||||
|
@ -44,6 +43,7 @@ UI {
|
|||
NokeyNocrypt = gnupg_nokey_nocrypt
|
||||
VerifiedKeyReq = gnupg_verified_key_required
|
||||
RequireSub = gnupg_require_subscriber
|
||||
requireSigs = gnupg_require_sigs
|
||||
WebUsers = webusers
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue