From: Thomas Hochstein Date: Wed, 19 Mar 2014 20:51:29 +0000 (+0100) Subject: Merge branch 'upstream-tmp' into upstream X-Git-Tag: 4.0.12^0 X-Git-Url: https://code.th-h.de/?p=usenet%2Fusevote.git;a=commitdiff_plain;h=adf1f9a735713a5d33644d1fc3ff3f79d227e435;hp=c1cc3954b44990c22aef40789195c4c4952cfca4 Merge branch 'upstream-tmp' into upstream * upstream-tmp: Update CHANGES for release. Fix typo in README. Change quorum default value to 50 "JA" votes. Correctly find $votename. Enforce strict response for data protection clause. Add votename to Menu. --- diff --git a/CHANGES b/CHANGES index 4afa606..f434572 100644 --- a/CHANGES +++ b/CHANGES @@ -1,10 +1,10 @@ -UseVoteGer Versionshistorie (aktuelle Version: 4.12, released 19.01.2014) +UseVoteGer Versionshistorie (aktuelle Version: 4.12, released 28.02.2014) ========================================================================= TODO: - aussortieren von Bounces aus Stimmenliste -Version 4.12 (19.01.2014): +Version 4.12 (28.02.2014): - uvbounce.pl und uvballot.pl benutzen jetzt wieder den uebergebenen Dateinamen statt irrtuemlich das Mailboxfile aus usevote.cfg (Bugfix in UVreadmail.pm) @@ -20,6 +20,15 @@ Version 4.12 (19.01.2014): Wahlschein und einem Musterwahlschein (wie im CfV geposted) zu starten. Dazu muss die Config-Option "sampleballotfile" gesetzt und die Datei vorhanden sein (Standard-Dateiname: ballot.sample) +- im Fehlermenue wird nun der Name der Abstimmung als Ueberschrift + angezeigt. Ausserdem wurde in UVmenu.pm ein redundanter Code-Abschnitt + entfernt +- BDSG-Klausel muss nun standardmaessig zwingend mit JA beantwortet + werden, DAFUER wird nicht mehr akzeptiert. Dies kann in usevote.cfg + konfiguriert werden +- Regular Expression fuer Pruefung des Abstimmungsnamens weiter + verbessert +- Standardwert fuer Mindest-JA-Stimmenzahl von 60 auf 50 verringert Version 4.11 (25.09.2012): - Regular Expression fuer Pruefung des Abstimmungsnamens verbessert. diff --git a/README b/README index 286e1ad..fec87c8 100644 --- a/README +++ b/README @@ -430,7 +430,7 @@ Nun solltest Du zunaechst mit (1) die Mail ansehen und anhand der bemaengelten Punkte entscheiden, ob der Wahlschein gueltig oder ungueltig ist bzw. welche Maengel tatsaechlich zutreffen. Mit (0) kannst Du einen Dateivergleich zu einem vorher hinterlegten -Musterwahlschein ausführen ("diff"), um Aenderungen/Fehler schneller +Musterwahlschein ausfuehren ("diff"), um Aenderungen/Fehler schneller zu sehen. Mit den Optionen (2) bis (7) kannst Du einzelne Eigenschaften diff --git a/UVconfig.pm b/UVconfig.pm index 571ab69..f78e3b9 100644 --- a/UVconfig.pm +++ b/UVconfig.pm @@ -94,7 +94,7 @@ sub read_config { ann_stimme => 'A\s*N\s*N\s*U\s*L\s*L\s*I\s*E\s*R\s*U\s*N\s*G', bdsg_confirm => 'JA', condition1 => '$yes>=2*$no', # twice as many yes as no - condition2 => '$yes>=60', # min 60 yes votes + condition2 => '$yes>=50', # min 60 yes votes prop_formula => '$yes/$no', tpl_ack_mail => 'ack-mail', tpl_bouncelist => 'bouncelist', @@ -121,6 +121,7 @@ sub read_config { tpl_rule_violated => 'rule-violated', begin_divider => 'Alles vor dieser Zeile bitte loeschen', end_divider => 'Alles nach dieser Zeile bitte loeschen', + ballotintro => 'WAHLSCHEIN fuer', nametext => 'Dein Realname, falls nicht im FROM-Header:', nametext2 => 'Waehlername:', addresstext => 'Waehleradresse:', diff --git a/UVmenu.pm b/UVmenu.pm index 486bb2c..07e32c8 100644 --- a/UVmenu.pm +++ b/UVmenu.pm @@ -60,6 +60,7 @@ sub menu { while (1) { system($config{clearcmd}); + print "-> $config{votename} <-\n"; print UVmessage::get("MENU_PROBLEMS") . "\n"; foreach my $error (keys %errors) { @@ -107,7 +108,7 @@ sub menu { open (DIFF, "|$config{diff} - $config{sampleballotfile} | $config{pager}"); print DIFF $$body, "\n"; close (DIFF); - + } elsif ($input eq '1') { system($config{clearcmd}); # ignore SIGPIPE (Bug in more and less) @@ -300,22 +301,6 @@ sub menu { $errors{WrongVoting} = UVmessage::get("MENU_WRONGVOTING"); } - } elsif ($input eq '7') { - my $sel; - do { - print "[a] ", UVmessage::get("MENU_VOTING_CORRECT"), "\n", - "[b] ", UVmessage::get("MENU_VOTING_WRONG"), "\n\n", - UVmessage::get("MENU_PROMPT"); - $sel = ; - } until ($sel =~ /^[ab]$/i); - - if ($sel =~ /^a$/i) { - delete $errors{NoVoting}; - delete $errors{WrongVoting}; - } else { - $errors{WrongVoting} = UVmessage::get("MENU_WRONGVOTING"); - } - } elsif ($input =~ /^i$/i) { my $ignore = UVmessage::get("MENU_IGNORE_STRING"); # Set columns for Text::Wrap diff --git a/usevote.cfg b/usevote.cfg index 8e0ada3..eb99d33 100644 --- a/usevote.cfg +++ b/usevote.cfg @@ -281,6 +281,10 @@ enth_stimme = (E|E\s*N\s*T\s*H\s*A\s*L\s*T\s*U\s*N\s*G) # Achtung, sollte auch in den Templates im Bestaetigungstext angepasst werden ann_stimme = A\s*N\s*N\s*U\s*L\s*L\s*I\s*E\s*R\s*U\s*N\s*G +# RegExp fuer Bestaetigung der Datenschutzklause (case-insensitive) +# Standardmaessig wird nur JA erkannt +bdsg_confirm = JA + # Template files (these files are in the template directory defined above) tpl_mailheader = "mailheader" # generally used mail header tpl_bouncelist = "bouncelist" # used by uvbounce.pl diff --git a/uvvote.pl b/uvvote.pl index 0e7e2bd..c101f1f 100644 --- a/uvvote.pl +++ b/uvvote.pl @@ -231,9 +231,9 @@ sub process_vote { } # correct voting? - if ($$body =~ /\Q$config{ballotintro}\E\s+(.+?)[^\S\n]*\n([>:|]*?[\t ]+(\S+.+)\s*$)?/m) { + if ($$body =~ /\Q$config{ballotintro}\E\s+(.+?)\s*\n([>:|]*?[\t ]+(\S+.+)\s*$)?/m) { $voting = $1; - $voting .= " $3" if defined($3); + $voting .= " $3" if (defined($3) and $3 !~ /\Q$config{nametext}\E/); push (@errors, 'WrongVoting') if ($config{votename} !~ /^\s*\Q$voting\E\s*$/); } else { push (@errors, 'NoVoting'); @@ -319,7 +319,7 @@ sub process_vote { # Should read like this: #a [ STIMME ] Text # (Text is configurable in usevote.cfg) unless ($$body =~ /$bdsg_regexp/s && - $$body =~ /#a\W*?\[\W*?$config{ja_stimme}\W*?\]\W*?$bdsg2_regexp/is) { + $$body =~ /#a\W*?\[\W*?$config{bdsg_confirm}\W*?\]\W*?$bdsg2_regexp/is) { push (@errors, 'InvalidBDSG'); }