From 48139ccfef87a39e20e1fbecebcbf88ecb303dfa Mon Sep 17 00:00:00 2001 From: "community.cacert.org" Date: Sun, 12 Jul 2009 02:08:45 +0000 Subject: [PATCH] closing votes now controlled by crontab (user www-data) to close daily on the new day. Votes are due in the last minute of previous day git-svn-id: http://svn.cacert.cl/Software/Voting/vote@65 d4452222-2f33-11de-9270-010000000000 --- .htaccess | 2 +- closevotes.php | 8 ++++++++ closevotes.php-script | 2 ++ motions.php | 1 - remind.php | 2 -- 5 files changed, 11 insertions(+), 4 deletions(-) create mode 100755 closevotes.php create mode 100644 closevotes.php-script diff --git a/.htaccess b/.htaccess index 02170ca..403e132 100644 --- a/.htaccess +++ b/.htaccess @@ -9,7 +9,7 @@ php_value open_basedir /var/www/board php_value safe_mode_exec_dir /var/empty - + Order Deny,Allow Deny from all diff --git a/closevotes.php b/closevotes.php new file mode 100755 index 0000000..ca95905 --- /dev/null +++ b/closevotes.php @@ -0,0 +1,8 @@ +#!/usr/bin/php +closeVotes(); + +?> diff --git a/closevotes.php-script b/closevotes.php-script new file mode 100644 index 0000000..5246205 --- /dev/null +++ b/closevotes.php-script @@ -0,0 +1,2 @@ +# echo "select strftime('%H:%M %m%d%Y',due) from decisions where status=0;" | sqlite3 database.sqlite | xargs -n1 -I^ sudo -u www-data at -f closevotes.php-script ^ +1minute +/var/www/board/closevotes.php diff --git a/motions.php b/motions.php index a087c9e..0a35cb3 100644 --- a/motions.php +++ b/motions.php @@ -1,7 +1,6 @@ closeVotes(); $page = is_numeric($_REQUEST['page'])?$_REQUEST['page']:1; $user = $db->auth(); diff --git a/remind.php b/remind.php index 635c2c7..b3ce74c 100755 --- a/remind.php +++ b/remind.php @@ -3,8 +3,6 @@ require_once("database.php"); $db = new DB(); -$db->closeVotes(); - $id = 0; $page = 1;