Temporary location of Voting Software Source code.
Find a file
Bradley M. Kuhn cf3f3e5180 preference field belongs in election_votes table.
It's clear from the PHP code that there should be an integer field called
'preference' in the election_votes table.  I suspect that at some point there
was an ALTER TABLE done that wasn't reflected in the schema.sql file.
2013-12-18 18:47:16 -05:00
bin Releasing the bin/ scripts under GPLv3+ 2013-12-18 15:44:26 -05:00
include Here too. 2013-07-25 11:32:35 +02:00
vote preference field belongs in election_votes table. 2013-12-18 18:47:16 -05:00
.cvsignore Merge the new-template branch in to HEAD. The branch is now defunct, and 2003-11-02 05:06:55 +00:00
.gitignore Add .gitignore 2009-05-17 16:39:21 +02:00
autogen.sh Remove references to things other than the vote stuff in configure scripts. 2013-12-17 13:19:12 -05:00
configure.in No longer reference removed directories. 2013-12-18 13:14:03 -05:00
MAINTAINERS I'm the maintainer of this fork of the GNOME voting stuff. 2013-12-17 13:15:57 -05:00
Makefile.am Remove references to things other than the vote stuff in configure scripts. 2013-12-17 13:19:12 -05:00
README More details on how to run an election and documentation of setup. 2013-12-18 18:09:12 -05:00
rules.common go back to evilsedhack for php files, since PHP is evil. Should fix this 2005-05-23 07:17:00 +00:00

Setting up an election:

0. vote/include/election-sql.php expects a secret config file that exists
   only on the server and is included as PHP code.  It's hard coded currently
   to: /home/admin/secret/anonvoting currently.

   The file should look something like this:

<?php
       $mysql_host = "localhost";
       $mysql_user = "someuser";
       $mysql_password = "somepassword";
       $mysql_db = "somedb";
       $committee_name = "The Vote Masters";
       $committee_email = "elections@example.org";
?>

1. When I deploy, I create an account for the election, as the mysql root user:
   mysql -u root -p
   Password: <MYSQLROOTPW>

   Then Run these commands at the mysql> prompt:
     CREATE USER 'someusername' identified by 'somepassword';
     CREATE DATABASE somedbname;

   Then, exit, and at the main command line run:
   msyql -u root -p -D somedbname < ..../vote/include/schema.sql

   Then run this again:
   mysql -u root -p
   Password: <MYSQLROOTPW>

   and at the mysql command line, run these grant commands:

   GRANT SELECT on somedb.elections TO someuser@localhost;
   GRANT SELECT on somedb.election_choices TO someuser@localhost;


2. Create an election, with something like this:
   mysql -u root -D somedb -p

      SET NAMES 'utf8';
      INSERT t INTO elections (type, name, voting_start, voting_end, choices_nb,   question) VALUES ("elections", "2011 Spring Election", "2011-05-29 00:00:00", "2011-06-12 23:59:59", "7", "Which candidates would you like to see Elected?");
set @el_id = @@IDENTITY;
INSERT INTO election_choices (election_id, choice)
    VALUES
    (@el_id, 'Candidate 1'),
    (@el_id, 'Candidate 2'),
    (@el_id, 'Candidate 3'),
    (@el_id, 'Candidate 4');
select @el_id;

That number you see at the end is your election id.  The URL you'll give out
is thus something like:

  http://example.org/vote?election_id=THAT_NUMBER