summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Lipscombe <Mark Lipscombe@d4452222-2f33-11de-9270-010000000000>2009-08-02 11:27:28 +0000
committerMark Lipscombe <Mark Lipscombe@d4452222-2f33-11de-9270-010000000000>2009-08-02 11:27:28 +0000
commita6fea98782bfc2e1f3de6cbafbb0461c541fa634 (patch)
tree6a0ef2fc34d60f54ad4fa4bb396c202068942416
parent35127fcc25b75f1ff005aeba1a1d068449590c06 (diff)
downloadcacert-boardvoting-a6fea98782bfc2e1f3de6cbafbb0461c541fa634.tar.gz
cacert-boardvoting-a6fea98782bfc2e1f3de6cbafbb0461c541fa634.tar.xz
cacert-boardvoting-a6fea98782bfc2e1f3de6cbafbb0461c541fa634.zip
Remove ability to modify motions.
git-svn-id: http://svn.cacert.cl/Software/Voting/vote@69 d4452222-2f33-11de-9270-010000000000
-rw-r--r--motion.php130
-rw-r--r--motions.php1
2 files changed, 34 insertions, 97 deletions
diff --git a/motion.php b/motion.php
index 2dec354..536de03 100644
--- a/motion.php
+++ b/motion.php
@@ -23,91 +23,30 @@
<body>
<?php
if ($_REQUEST['action'] == "store") {
- if (is_numeric($_REQUEST['motion'])) {
- $stmt = $db->getStatement("update decision");
- $stmt->bindParam(":id",$_POST['motion']);
- $stmt->bindParam(":proponent",$user['id']);
- $stmt->bindParam(":title",$_POST['title']);
- $stmt->bindParam(":content",$_POST['content']);
- $stmt->bindParam(":due",$_POST['due']);
- $stmt->bindParam(":votetype",$_POST['votetype']);
- if ($stmt->execute()) {
- ?>
- <b>The motion has been proposed!</b><br/>
- <a href="motions.php">Back to motions</a><br/>
- <br/>
- <br/>
- <?php
- $decision = $db->getStatement("get decision")->execute(array($_POST['motion']))?$db->getStatement("get decision")->fetch():array();
- $name = $user['name'];
- $tag = $decision['tag'];
- $title = $decision['title'];
- $content =$decision['content'];
- $due = $decision['due']." UTC";
- $votetype = !$decision['votetype'] ? 'motion' : 'veto';
- $baseurl = "https://".$_SERVER['HTTP_HOST'].":".$_SERVER['SERVER_PORT'].preg_replace('/motion\.php/','',$_SERVER['REQUEST_URI']);
- $voteurl = $baseurl."vote.php?motion=".$decision['id'];
- $unvoted = $baseurl."motions.php?unvoted=1";
- $body = <<<BODY
-Dear Board,
-
-$name has modified motion $tag to the following:
-
-$title
-$content
-
-Vote type: $votetype
-
-To vote please choose:
-
-Aye: $voteurl&vote=1
-Naye: $voteurl&vote=-1
-Abstain: $voteurl&vote=0
-
-Please be aware, that if you have voted already your vote is still registered and valid.
-If this modification has an impact on how you wish to vote, you are responsible for voting
-again.
-
-To see all your outstanding votes : $unvoted
-
-Kind regards,
-the voting system
-BODY;
- $db->notify("Re: $tag - $title - modified",$body,$tag);
- } else {
- ?>
- <b>The motion has NOT been proposed!</b><br/>
- <a href="motions.php">Back to motions</a><br/>
- <i><?php echo join("<br/>\n",$stmt->errorInfo()); ?></i><br/>
- <br/>
- <br/>
- <?php
- }
- } else {
- $stmt = $db->getStatement("create decision");
- $stmt->bindParam(":proponent",$user['id']);
- $stmt->bindParam(":title",$_POST['title']);
- $stmt->bindParam(":content",$_POST['content']);
- $stmt->bindParam(":votetype",$_POST['votetype']);
- $stmt->bindParam(":due",$_POST['due']);
- if ($stmt->execute()) {
- ?>
- <b>The motion has been proposed!</b><br/>
- <a href="motions.php">Back to motions</a><br/>
- <br/>
- <br/>
- <?php
- $decision = $db->getStatement("get new decision")->execute()?$db->getStatement("get new decision")->fetch():array();
- $name = $user['name'];
- $tag = $decision['tag'];
- $title = $decision['title'];
- $content =$decision['content'];
- $due = $decision['due']." UTC";
- $votetype = !$decision['votetype'] ? 'motion' : 'veto';
- $baseurl = "https://".$_SERVER['HTTP_HOST'].":".$_SERVER['SERVER_PORT'].preg_replace('/motion\.php/','',$_SERVER['REQUEST_URI']);
- $voteurl = $baseurl."vote.php?motion=".$decision['id'];
- $unvoted = $baseurl."motions.php?unvoted=1";
- $body = <<<BODY
+ $stmt = $db->getStatement("create decision");
+ $stmt->bindParam(":proponent",$user['id']);
+ $stmt->bindParam(":title",$_POST['title']);
+ $stmt->bindParam(":content",$_POST['content']);
+ $stmt->bindParam(":votetype",$_POST['votetype']);
+ $stmt->bindParam(":due",$_POST['due']);
+ if ($stmt->execute()) {
+ ?>
+ <b>The motion has been proposed!</b><br/>
+ <a href="motions.php">Back to motions</a><br/>
+ <br/>
+ <br/>
+ <?php
+ $decision = $db->getStatement("get new decision")->execute()?$db->getStatement("get new decision")->fetch():array();
+ $name = $user['name'];
+ $tag = $decision['tag'];
+ $title = $decision['title'];
+ $content =$decision['content'];
+ $due = $decision['due']." UTC";
+ $votetype = !$decision['votetype'] ? 'motion' : 'veto';
+ $baseurl = "https://".$_SERVER['HTTP_HOST'].":".$_SERVER['SERVER_PORT'].preg_replace('/motion\.php/','',$_SERVER['REQUEST_URI']);
+ $voteurl = $baseurl."vote.php?motion=".$decision['id'];
+ $unvoted = $baseurl."motions.php?unvoted=1";
+ $body = <<<BODY
Dear Board,
$name has made the following motion:
@@ -130,19 +69,18 @@ To see all your outstanding votes : $unvoted
Kind regards,
the voting system
BODY;
- $db->notify("$tag - $title",$body,$tag,TRUE);
- } else {
- ?>
- <b>The motion has NOT been proposed!</b><br/>
- <a href="motions.php">Back to motions</a><br/>
- <i><?php echo join("<br/>\n",$stmt->errorInfo()); ?></i><br/>
- <br/>
- <br/>
- <?php
- }
+ $db->notify("$tag - $title",$body,$tag,TRUE);
+ } else {
+ ?>
+ <b>The motion has NOT been proposed!</b><br/>
+ <a href="motions.php">Back to motions</a><br/>
+ <i><?php echo join("<br/>\n",$stmt->errorInfo()); ?></i><br/>
+ <br/>
+ <br/>
+ <?php
}
-
}
+
if (is_numeric($_REQUEST['motion'])) {
$stmt = $db->getStatement("get decision");
if ($stmt->execute(array($_REQUEST['motion']))) {
diff --git a/motions.php b/motions.php
index 533f33a..20b4653 100644
--- a/motions.php
+++ b/motions.php
@@ -115,7 +115,6 @@ BODY;
<li><a href="vote.php?motion=<?php echo($row['id']); ?>&amp;vote=0">Abstain</a></li>
<li><a href="vote.php?motion=<?php echo($row['id']); ?>&amp;vote=-1">Naye</a></li>
<li><a href="proxy.php?motion=<?php echo($row['id']); ?>">Proxy Vote</a></li>
- <li><a href="motion.php?motion=<?php echo($row['id']); ?>">Modify</a></li>
<li><a href="motions.php?motion=<?php echo($row['tag']); ?>&amp;withdrawl=1">Withdraw</a></li>
</ul>
<?php