[NCUC E-team] Election management

Tapani Tarvainen ncuc at tapani.tarvainen.info
Mon Dec 16 11:39:03 CET 2013


As mentioned before, I wrote a couple of tools to help
in elections.

First, if you log on to Wordpress (http://www.ncuc.org/login),
a new menu entry appears under "Participate", namely "Ballots".
(A few others will also appear but they're empty for now.)
It's actually a bit of a misnomer as there's only voter
list, both as human-readable web page as well as a
downloadable text file in the format Glen &co need it
to generate actual ballots.

(The login requirement is simply to avoid address
harvesting by spammers. It doesn't provide any real
security, indeed the pages in question can be accessed
without login if one knows their URLs - so please don't
post them here.)

When the next election comes, what's needed is
simply ensuring that member database is up to date,
and in particular that "members in good standing"
are marked with state=2,
then going to the above page, downloading the weighted
voter list and sending it to Glen.
(If the voter weights need to be changed, edit the
"NCUC Ballots" plugin in Wordpress.)

The hard part is keeping the database up to date,
that is, verifying people & their addresses.

The tool I wrote for this is a bit less polished,
it needs command-line access to the server.
It wouldn't be all that hard to make web GUI for this,
but I never got around to doing that - this was a very quick hack.
So, I'm afraid the following is a bit more technical,
but it should be easy enough to anyone who can deal with command line.
(Note though that there's no absolute need to use this, any means of
updating the database (like manually reading emails and using phppgadmin)
will do fine for people who like manual labour.
Me, I am lazy enough to automate things as much as I can.)

Basically it's a script that sends a customized
form letter to all members with state=1,
which contains a custom URL, clicking which is logged
and yet another script uses the log file to
change state of members who replied to 2.

If someone wants to use it for next election:
log on to ncuc1 as membadm (or use "sudo su - membadm") and:

(1) review and edit the form letter template "confirmation1.txt"
    and the "thank you" message in the reply web page
    /var/www/members/confirm.php as desired
(2) ensure all uncertain members have state=1 in the member database;
    might even do this to all members by
    psql ncuc -c 'update ncucers set state=1 where state<3;'
(3) generate new xkey for all members, e.g., by
    psql ncuc -c 'update ncucers set xkey=trunc(100000000*random()) where state=1;'
(4) remove old replies from /var/local/ncuc/confirm.log
    ("rm /var/local/ncuc/confirm.log" will do)
(5) run "passivecheck.sh", which sends the email to members.
(6) once deadline for replies is over, run "check-confirmations.sh"
    to update the database.
    (can be run again if replies keep coming - replies can be
    seen in /var/local/ncuc/confirm.log)
(7) if you want to send another message to those who haven't confirmed,
    just do (5) and (6) again (possibly editing the letter template first).

That's all.

Plus, of course, handling people who reply to the letter
with corrections or whatever instead of just clicking the link.
(A development idea is adding a form where they can update
their data directly.)
Replies go to memberadmin at ncuc.org, which should be directed
to whoever is handling this.

-- 
Tapani Tarvainen


More information about the E-team mailing list