summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcommunity.cacert.org <community.cacert.org@d4452222-2f33-11de-9270-010000000000>2009-07-12 02:08:45 +0000
committercommunity.cacert.org <community.cacert.org@d4452222-2f33-11de-9270-010000000000>2009-07-12 02:08:45 +0000
commit48139ccfef87a39e20e1fbecebcbf88ecb303dfa (patch)
tree70775a7afeca20f5af90cb79b99e4877e0d63792
parent5e71e18a53d346cc6b7c02f8c43cd788af2c97cc (diff)
downloadcacert-boardvoting-48139ccfef87a39e20e1fbecebcbf88ecb303dfa.tar.gz
cacert-boardvoting-48139ccfef87a39e20e1fbecebcbf88ecb303dfa.tar.xz
cacert-boardvoting-48139ccfef87a39e20e1fbecebcbf88ecb303dfa.zip
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
-rw-r--r--.htaccess2
-rwxr-xr-xclosevotes.php8
-rw-r--r--closevotes.php-script2
-rw-r--r--motions.php1
-rwxr-xr-xremind.php2
5 files changed, 11 insertions, 4 deletions
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
</IfModule>
-<FilesMatch "^(database.*|remind.php)$">
+<FilesMatch "^(database.*|remind.php|closevotes.php.*)$">
Order Deny,Allow
Deny from all
</FilesMatch>
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
+<?
+require_once("database.php");
+$db = new DB();
+
+$db->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 @@
<?php
require_once("database.php");
$db = new DB();
- $db->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;