Squash-merging the ISSO3 branch back onto master
[bugdar.git] / vote.php
index 7c35db3db0caa8ccfe5c6ec04f79aead61d640ad..129c1a0385f8bef6602d00a843ba9ce7669caa40 100644 (file)
--- a/vote.php
+++ b/vote.php
@@ -2,7 +2,7 @@
 /*=====================================================================*\
 || ###################################################################
 || # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2008 Blue Static
 || #
 || # This program is free software; you can redistribute it and/or modify
 || # it under the terms of the GNU General Public License as published by
@@ -19,7 +19,6 @@
 || ###################################################################
 \*=====================================================================*/
 
-define('SVN', '$Id$');
 
 $focus['showreport'] = 'focus';
 
@@ -36,8 +35,8 @@ if (empty($_REQUEST['do']))
 
 if ($_REQUEST['do'] == 'vote')
 {
-       $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $bugsys->input_clean('bugid', TYPE_UINT));
-       $vote =  $db->query_first("SELECT *, FIND_IN_SET(" . $bugsys->userinfo['userid'] . ", userids) AS uservote FROM " . TABLE_PREFIX . "vote WHERE bugid = $bug[bugid]");
+       $bug = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $input->inputClean('bugid', TYPE_UINT));
+       $vote =  $db->queryFirst("SELECT *, FIND_IN_SET(" . bugdar::$userinfo['userid'] . ", userids) AS uservote FROM " . TABLE_PREFIX . "vote WHERE bugid = $bug[bugid]");
        
        if (!check_bug_permissions($bug))
        {
@@ -61,19 +60,19 @@ if ($_REQUEST['do'] == 'vote')
        
        // handle userids
        $userids = $vote['userids'];
-       if ($bugsys->userinfo['userid'])
+       if (bugdar::$userinfo['userid'])
        {
                if (trim($vote['userids']))
                {
-                       $userids .= ',' . $bugsys->userinfo['userid'];
+                       $userids .= ',' . bugdar::$userinfo['userid'];
                }
                else
                {
-                       $userids = $bugsys->userinfo['userid'];
+                       $userids = bugdar::$userinfo['userid'];
                }
        }
        
-       $uservote = $bugsys->input_clean('vote', TYPE_INT);
+       $uservote = $input->inputClean('vote', TYPE_INT);
        
        $votefor = $vote['votefor'];
        $voteagainst = $vote['voteagainst'];
@@ -96,10 +95,4 @@ if ($_REQUEST['do'] == 'vote')
        $message->redirect(T('Your vote has been added.'), "showreport.php?bugid=$bug[bugid]");
 }
 
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
 ?>
\ No newline at end of file