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
This commit is contained in:
parent
5e71e18a53
commit
48139ccfef
5 changed files with 11 additions and 4 deletions
|
@ -9,7 +9,7 @@ php_value open_basedir /var/www/board
|
||||||
php_value safe_mode_exec_dir /var/empty
|
php_value safe_mode_exec_dir /var/empty
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
<FilesMatch "^(database.*|remind.php)$">
|
<FilesMatch "^(database.*|remind.php|closevotes.php.*)$">
|
||||||
Order Deny,Allow
|
Order Deny,Allow
|
||||||
Deny from all
|
Deny from all
|
||||||
</FilesMatch>
|
</FilesMatch>
|
||||||
|
|
8
closevotes.php
Executable file
8
closevotes.php
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/usr/bin/php
|
||||||
|
<?
|
||||||
|
require_once("database.php");
|
||||||
|
$db = new DB();
|
||||||
|
|
||||||
|
$db->closeVotes();
|
||||||
|
|
||||||
|
?>
|
2
closevotes.php-script
Normal file
2
closevotes.php-script
Normal file
|
@ -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
|
|
@ -1,7 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
require_once("database.php");
|
require_once("database.php");
|
||||||
$db = new DB();
|
$db = new DB();
|
||||||
$db->closeVotes();
|
|
||||||
$page = is_numeric($_REQUEST['page'])?$_REQUEST['page']:1;
|
$page = is_numeric($_REQUEST['page'])?$_REQUEST['page']:1;
|
||||||
$user = $db->auth();
|
$user = $db->auth();
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
require_once("database.php");
|
require_once("database.php");
|
||||||
$db = new DB();
|
$db = new DB();
|
||||||
|
|
||||||
$db->closeVotes();
|
|
||||||
|
|
||||||
$id = 0;
|
$id = 0;
|
||||||
$page = 1;
|
$page = 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue