summaryrefslogtreecommitdiff
path: root/vote.php
diff options
context:
space:
mode:
authorJan Dittberner <jandd@cacert.org>2017-04-21 13:21:59 +0200
committerJan Dittberner <jan@dittberner.info>2017-04-22 00:14:11 +0200
commitdad5d581585def23a25a9f54faab2691ccb1fb95 (patch)
treef31f7d6d4fefe3f2628379e989fd38bd9489e82a /vote.php
parent8d0e0eeb1b6e983749b3a24131cd05ed6781a9ef (diff)
downloadcacert-boardvoting-dad5d581585def23a25a9f54faab2691ccb1fb95.tar.gz
cacert-boardvoting-dad5d581585def23a25a9f54faab2691ccb1fb95.tar.xz
cacert-boardvoting-dad5d581585def23a25a9f54faab2691ccb1fb95.zip
Remove PHP code
Diffstat (limited to 'vote.php')
-rw-r--r--vote.php104
1 files changed, 0 insertions, 104 deletions
diff --git a/vote.php b/vote.php
deleted file mode 100644
index ef1b6fd..0000000
--- a/vote.php
+++ /dev/null
@@ -1,104 +0,0 @@
-<?php
- if ($_SERVER['HTTPS'] != 'on') {
- header("HTTP/1.0 302 Redirect");
- header("Location: https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
- exit();
- }
- require_once("database.php");
- $db = new DB();
- if (!($user = $db->auth())) {
- header("HTTP/1.0 302 Redirect");
- header("Location: denied.php");
- exit();
- }
-?>
-<html>
- <head>
- <title>CAcert Board Decisions</title>
- <meta http-equiv="Content-Type" content="text/html; charset='UTF-8'" />
- <link rel="stylesheet" type="text/css" href="styles.css" />
- </head>
- <body>
- <?php
- if (is_numeric($_REQUEST['motion']) && is_numeric($_REQUEST['vote'])) {
- $stmt = $db->getStatement("get decision");
- $stmt->bindParam(":decision",$_REQUEST['motion']);
- if ($stmt->execute() && ($decision=$stmt->fetch())) {
- if ($decision['status'] == 0) {
- $stmt = $db->getStatement("del vote");
- $stmt->bindParam(":voter",$user['id']);
- $stmt->bindParam(":decision",$_REQUEST['motion']);
- if ($stmt->execute()) {
- $stmt = $db->getStatement("do vote");
- $stmt->bindParam(":voter",$user['id']);
- $stmt->bindParam(":decision",$_REQUEST['motion']);
- $stmt->bindParam(":vote",$_REQUEST['vote']);
- $notes="Direct Vote\n\n".$_SERVER['SSL_CLIENT_CERT'];
- $stmt->bindParam(":notes",$notes);
- if ($stmt->execute()) {
- ?>
- <b>Your vote has been registered.</b><br/>
- <a href="motions.php">Back to motions</a>
- <?php
- $name = $user['name'];
- $vote = '';
- switch($_REQUEST['vote']) {
- case 1 : $vote='Aye'; break;
- case -1: $vote='Naye'; break;
- default: $vote='Abstain'; break;
- }
- $tag = $decision['tag'];
- $title = $decision['title'];
- $content = $decision['content'];
- $due = $decision['due']." UTC";
- $body = <<<BODY
-Dear Board,
-
-$name has just voted $vote on motion $tag.
-
-Motion:
- $title
- $content
-
-Kind regards,
-the vote system
-
-BODY;
- $db->vote_notify("Re: $tag - $title",$body,$tag);
- } else {
- ?>
- <b>Your vote has NOT been registered.</b><br/>
- <a href="motions.php">Back to motions</a>
- <i><?php echo join("<br/>\n",$stmt->errorInfo()); ?></i>
- <?php
- }
- } else {
- ?>
- <b>Your vote has NOT been registered.</b><br/>
- <a href="motions.php">Back to motions</a>
- <i><?php echo join("<br/>\n",$stmt->errorInfo()); ?></i>
- <?php
- }
- } else {
- ?>
- <b>Your vote has NOT been registered.</b><br/>
- <b>Voting is alread closed!</b><br/>
- <a href="motions.php">Back to motions</a>
- <?php
- }
- } else {
- ?>
- <b>Your vote has NOT been registered.</b><br/>
- <b>Could not find the motion to be voted!</b><br/>
- <a href="motions.php">Back to motions</a>
- <?php
- }
- } else {
- ?>
- <b>This call is not a valid vote!</b><br/>
- <a href="motions.php">Back to motions</a>
- <?php
- }
- ?>
- </body>
-</html>