phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: polls admin.php,1.14,1.15 admin_addanswer.php,1.


From: Mark A Peters <address@hidden>
Subject: [Phpgroupware-cvs] CVS: polls admin.php,1.14,1.15 admin_addanswer.php,1.12,1.13 admin_addquestion.php,1.11,1.12 admin_deleteanswer.php,1.6,1.7 admin_deletequestion.php,1.4,1.5 admin_editquestion.php,1.6,1.7 admin_settings.php,1.8,1.9 admin_viewquestion.php,1.7,1.8 vote.php,1.10,1.11
Date: Mon, 29 Apr 2002 20:15:22 -0400

Update of /cvsroot/phpgroupware/polls
In directory subversions:/tmp/cvs-serv10086

Modified Files:
        admin.php admin_addanswer.php admin_addquestion.php 
        admin_deleteanswer.php admin_deletequestion.php 
        admin_editquestion.php admin_settings.php 
        admin_viewquestion.php vote.php 
Log Message:
Converting to get_var() for all HTTP_*_VARS.

Index: admin.php
===================================================================
RCS file: /cvsroot/phpgroupware/polls/admin.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** admin.php   21 Dec 2001 14:59:46 -0000      1.14
--- admin.php   30 Apr 2002 00:15:17 -0000      1.15
***************
*** 12,15 ****
--- 12,16 ----
    /* $Id$ */
  
+       $GLOBALS['phpgw_info'] = Array();
        $GLOBALS['phpgw_info']['flags'] = array(
                'admin_only'              => True,
***************
*** 20,38 ****
        include('../header.inc.php');
  
!       $show  = $HTTP_GET_VARS['show'];
!       $order = $HTTP_GET_VARS['order'];
!       $sort  = $HTTP_GET_VARS['sort'];
  
!       if (! $show)
        {
                $GLOBALS['phpgw']->common->phpgw_exit(True);
        }
  
!       if ($order)
        {
                $ordermethod = " order by $order $sort";
        }
  
!       if ($show == 'questions')
        {
                $GLOBALS['phpgw']->template->set_file(array('admin' => 
'admin_list_questions.tpl'));
--- 21,39 ----
        include('../header.inc.php');
  
!       $show  = get_var('show',Array('GET'));
!       $order = get_var('order',Array('GET'));
!       $sort  = get_var('sort',Array('GET'));
  
!       if(!$show)
        {
                $GLOBALS['phpgw']->common->phpgw_exit(True);
        }
  
!       if($order)
        {
                $ordermethod = " order by $order $sort";
        }
  
!       if($show == 'questions')
        {
                $GLOBALS['phpgw']->template->set_file(array('admin' => 
'admin_list_questions.tpl'));
***************
*** 49,53 ****
        
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
        
$GLOBALS['phpgw']->template->set_var('sort_title',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'poll_title',$order,'admin.php',lang('Title'),'&show='
 . $show));
!       if ($show == 'answers')
        {
                
$GLOBALS['phpgw']->template->set_var('sort_answer',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'option_text',$order,'admin.php',lang('Answer'),'&show='
 . $show));
--- 50,54 ----
        
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
        
$GLOBALS['phpgw']->template->set_var('sort_title',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'poll_title',$order,'admin.php',lang('Title'),'&show='
 . $show));
!       if($show == 'answers')
        {
                
$GLOBALS['phpgw']->template->set_var('sort_answer',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'option_text',$order,'admin.php',lang('Answer'),'&show='
 . $show));
***************
*** 56,65 ****
        $GLOBALS['phpgw']->template->set_var('lang_edit',lang('edit'));
        $GLOBALS['phpgw']->template->set_var('lang_delete',lang('delete'));
!       if ($show == 'questions')
        {
                $GLOBALS['phpgw']->template->set_var('lang_view',lang('view'));
        }
  
!       if ($show == 'questions')
        {
                $GLOBALS['phpgw']->db->query("select * from phpgw_polls_desc 
$ordermethod",__LINE__,__FILE__);
--- 57,66 ----
        $GLOBALS['phpgw']->template->set_var('lang_edit',lang('edit'));
        $GLOBALS['phpgw']->template->set_var('lang_delete',lang('delete'));
!       if($show == 'questions')
        {
                $GLOBALS['phpgw']->template->set_var('lang_view',lang('view'));
        }
  
!       if($show == 'questions')
        {
                $GLOBALS['phpgw']->db->query("select * from phpgw_polls_desc 
$ordermethod",__LINE__,__FILE__);
***************
*** 76,80 ****
                $GLOBALS['phpgw']->template->set_var('tr_color',$tr_color);
  
!               if ($show == 'questions')
                {
                        
$GLOBALS['phpgw']->template->set_var('row_title',$GLOBALS['phpgw']->db->f('poll_title'));
--- 77,81 ----
                $GLOBALS['phpgw']->template->set_var('tr_color',$tr_color);
  
!               if($show == 'questions')
                {
                        
$GLOBALS['phpgw']->template->set_var('row_title',$GLOBALS['phpgw']->db->f('poll_title'));
***************
*** 90,94 ****
                        $GLOBALS['phpgw']->template->set_var('row_delete','<a 
href="' . $GLOBALS['phpgw']->link('/polls/admin_deleteanswer.php','vote_id=' . 
$GLOBALS['phpgw']->db->f('vote_id')) . '">' . lang('Delete') . '</a>');
                }
- 
                $GLOBALS['phpgw']->template->parse('rows','row',True);
        }
--- 91,94 ----

Index: admin_addanswer.php
===================================================================
RCS file: /cvsroot/phpgroupware/polls/admin_addanswer.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** admin_addanswer.php 21 Dec 2001 14:59:46 -0000      1.12
--- admin_addanswer.php 30 Apr 2002 00:15:17 -0000      1.13
***************
*** 12,16 ****
        /* $Id$ */
  
!       $phpgw_info = array();
        $GLOBALS['phpgw_info']['flags'] = array(
                'admin_only'              => True,
--- 12,16 ----
        /* $Id$ */
  
!       $GLOBALS['phpgw_info'] = array();
        $GLOBALS['phpgw_info']['flags'] = array(
                'admin_only'              => True,
***************
*** 25,33 ****
        $GLOBALS['phpgw']->template->set_block('admin','row','row');
  
!       if ($HTTP_POST_VARS['submit'])
        {
!               $poll_id = $HTTP_POST_VARS['poll_id'];
!               $answer  = $HTTP_POST_VARS['answer'];
!               $vote_id = $HTTP_POST_VARS['vote_id'];
  
                $GLOBALS['phpgw']->db->query("select max(vote_id)+1 from 
phpgw_polls_data where poll_id='$poll_id'",__LINE__,__FILE__);
--- 25,33 ----
        $GLOBALS['phpgw']->template->set_block('admin','row','row');
  
!       if(get_var('submit',Array('POST')))
        {
!               $poll_id = get_var('poll_Id',Array('POST'));
!               $answer  = get_var('answer',Array('POST'));
!               $vote_id = get_var('vote_Id',Array('POST'));
  
                $GLOBALS['phpgw']->db->query("select max(vote_id)+1 from 
phpgw_polls_data where poll_id='$poll_id'",__LINE__,__FILE__);

Index: admin_addquestion.php
===================================================================
RCS file: /cvsroot/phpgroupware/polls/admin_addquestion.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** admin_addquestion.php       21 Dec 2001 14:59:46 -0000      1.11
--- admin_addquestion.php       30 Apr 2002 00:15:17 -0000      1.12
***************
*** 12,16 ****
    /* $Id$ */
  
!       $phpgw_info = array();
        $GLOBALS['phpgw_info']['flags'] = array(
                'admin_only'              => True,
--- 12,16 ----
    /* $Id$ */
  
!       $GLOBALS['phpgw_info'] = array();
        $GLOBALS['phpgw_info']['flags'] = array(
                'admin_only'              => True,
***************
*** 25,35 ****
        $GLOBALS['phpgw']->template->set_block('admin','row','row');
  
!       if ($HTTP_POST_VARS['submit'])
        {
!               $question = $HTTP_POST_VARS['question'];
  
                $GLOBALS['phpgw']->db->query("insert into phpgw_polls_desc 
(poll_title,poll_timestamp) values ('"
                        . addslashes($question) . "','" . time() . 
"')",__LINE__,__FILE__);
!               $GLOBALS['phpgw']->template->set_var("message",lang("New poll 
has been added.  You should now add some answers for this poll"));
        }
        else
--- 25,35 ----
        $GLOBALS['phpgw']->template->set_block('admin','row','row');
  
!       if(get_var('submit',Array('POST')))
        {
!               $question = get_var('question',Array('POST'));
  
                $GLOBALS['phpgw']->db->query("insert into phpgw_polls_desc 
(poll_title,poll_timestamp) values ('"
                        . addslashes($question) . "','" . time() . 
"')",__LINE__,__FILE__);
!               $GLOBALS['phpgw']->template->set_var('message',lang('New poll 
has been added.  You should now add some answers for this poll'));
        }
        else
***************
*** 39,43 ****
  
        $GLOBALS['phpgw']->template->set_var('header_message',lang('Add new 
poll question'));
!       $GLOBALS['phpgw']->template->set_var('td_message',"&nbsp;");
        
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
        
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/polls/admin_addquestion.php'));
--- 39,43 ----
  
        $GLOBALS['phpgw']->template->set_var('header_message',lang('Add new 
poll question'));
!       $GLOBALS['phpgw']->template->set_var('td_message','&nbsp;');
        
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
        
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/polls/admin_addquestion.php'));
***************
*** 45,49 ****
        $GLOBALS['phpgw']->template->set_var('form_button_2','</form><form 
method="POST" action="' . $GLOBALS['phpgw']->link('/polls/admin.php') . 
'"><input type="submit" name="submit" value="' . lang('Cancel') . '">');
  
!       add_template_row($GLOBALS['phpgw']->template,lang("Enter poll 
question"),'<input name="question">');
  
        $GLOBALS['phpgw']->template->pparse('out','form');
--- 45,49 ----
        $GLOBALS['phpgw']->template->set_var('form_button_2','</form><form 
method="POST" action="' . $GLOBALS['phpgw']->link('/polls/admin.php') . 
'"><input type="submit" name="submit" value="' . lang('Cancel') . '">');
  
!       add_template_row($GLOBALS['phpgw']->template,lang('Enter poll 
question'),'<input name="question">');
  
        $GLOBALS['phpgw']->template->pparse('out','form');

Index: admin_deleteanswer.php
===================================================================
RCS file: /cvsroot/phpgroupware/polls/admin_deleteanswer.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** admin_deleteanswer.php      21 Dec 2001 14:59:46 -0000      1.6
--- admin_deleteanswer.php      30 Apr 2002 00:15:17 -0000      1.7
***************
*** 19,23 ****
                'admin_header'            => True
        );
!       if ($HTTP_GET_VARS['confirm'])
        {
                $GLOBALS['phpgw_info']['flags']['noheader'] = True;
--- 19,23 ----
                'admin_header'            => True
        );
!       if($HTTP_GET_VARS['confirm'])
        {
                $GLOBALS['phpgw_info']['flags']['noheader'] = True;
***************
*** 27,33 ****
        include('../header.inc.php');
  
!       if ($HTTP_GET_VARS['confirm'])
        {
!               $GLOBALS['phpgw']->db->query("delete from phpgw_polls_data 
where vote_id='" . $HTTP_GET_VARS['vote_id'] . "'");
                Header('Location: ' . 
$GLOBALS['phpgw']->link('/polls/admin.php','show=answers'));
        }
--- 27,34 ----
        include('../header.inc.php');
  
!       $vote_id = get_vars('vots_id',Array('GET'));
!       if(get_var('confirm',Array('GET')))
        {
!               $GLOBALS['phpgw']->db->query("delete from phpgw_polls_data 
where vote_id='".$vote_id."'",__LINE__,__FILE__);
                Header('Location: ' . 
$GLOBALS['phpgw']->link('/polls/admin.php','show=answers'));
        }
***************
*** 38,42 ****
                echo '<tr><td align="left"><a href="' . 
$GLOBALS['phpgw']->link('/polls/admin.php','show=answers') . '">' . lang('No') 
. '</td>';
                echo '    <td align="right"><a href="' . 
$GLOBALS['phpgw']->link('/polls/admin_deleteanswer.php','vote_id='
!                       . $HTTP_GET_VARS['vote_id'] . '&confirm=True') . '">' . 
lang('Yes') . '</td></tr>';
                echo '</table>';
        }
--- 39,43 ----
                echo '<tr><td align="left"><a href="' . 
$GLOBALS['phpgw']->link('/polls/admin.php','show=answers') . '">' . lang('No') 
. '</td>';
                echo '    <td align="right"><a href="' . 
$GLOBALS['phpgw']->link('/polls/admin_deleteanswer.php','vote_id='
!                       .$vote_id.'&confirm=True') . '">' . lang('Yes') . 
'</td></tr>';
                echo '</table>';
        }

Index: admin_deletequestion.php
===================================================================
RCS file: /cvsroot/phpgroupware/polls/admin_deletequestion.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** admin_deletequestion.php    21 Dec 2001 14:59:46 -0000      1.4
--- admin_deletequestion.php    30 Apr 2002 00:15:17 -0000      1.5
***************
*** 12,16 ****
    /* $Id$ */
  
!       $phpgw_info = array();
        $GLOBALS['phpgw_info']['flags'] = array(
                'currentapp'   => 'polls',
--- 12,16 ----
    /* $Id$ */
  
!       $GLOBALS['phpgw_info'] = array();
        $GLOBALS['phpgw_info']['flags'] = array(
                'currentapp'   => 'polls',
***************
*** 18,22 ****
                'admin_header' => True
        );
!       if ($HTTP_GET_VARS['confirm'])
        {
                $GLOBALS['phpgw_info']['flags']['noheader'] = True;
--- 18,22 ----
                'admin_header' => True
        );
!       if($HTTP_GET_VARS['confirm'])
        {
                $GLOBALS['phpgw_info']['flags']['noheader'] = True;
***************
*** 26,35 ****
        include('../header.inc.php');
  
!       if ($HTTP_GET_VARS['confirm'])
        {
!               $GLOBALS['phpgw']->db->query("delete from phpgw_polls_desc 
where poll_id='" . $HTTP_GET_VARS['poll_id'] . "'");
!               $GLOBALS['phpgw']->db->query("delete from phpgw_polls_data 
where poll_id='" . $HTTP_GET_VARS['poll_id'] . "'");
!               $GLOBALS['phpgw']->db->query("delete from phpgw_polls_user 
where poll_id='" . $HTTP_GET_VARS['poll_id'] . "'");
!               $GLOBALS['phpgw']->db->query("select MAX(poll_id) from 
phpgw_polls_desc");
                $max = $GLOBALS['phpgw']->db->f('1');
                $GLOBALS['phpgw']->db->query("update phpgw_polls_settings set 
setting_value='$max' where setting_name='currentpoll'");
--- 26,36 ----
        include('../header.inc.php');
  
!       $poll_id = intval(get_var('poll_id',Array('GET')));
!       if(get_var('confirm',Array('GET')))
        {
!               $GLOBALS['phpgw']->db->query("delete from phpgw_polls_desc 
where poll_id='".$poll_id."'",__LINE__,__FILE__);
!               $GLOBALS['phpgw']->db->query("delete from phpgw_polls_data 
where poll_id='".$poll_id."'",__LINE__,__FILE__);
!               $GLOBALS['phpgw']->db->query("delete from phpgw_polls_user 
where poll_id='".$poll_id."'",__LINE__,__FILE__);
!               $GLOBALS['phpgw']->db->query("select MAX(poll_id) from 
phpgw_polls_desc",__LINE__,__FILE__);
                $max = $GLOBALS['phpgw']->db->f('1');
                $GLOBALS['phpgw']->db->query("update phpgw_polls_settings set 
setting_value='$max' where setting_name='currentpoll'");
***************
*** 42,46 ****
                echo '<tr><td align="left"><a href="' . 
$GLOBALS['phpgw']->link('/polls/admin.php','show=questions') . '">' . 
lang('No') . '</td>';
                echo '    <td align="right"><a href="' . 
$GLOBALS['phpgw']->link('/polls/admin_deletequestion.php','poll_id='
!                       . intval($HTTP_GET_VARS['poll_id']) .'&confirm=True') . 
'">' . lang('Yes') . '</td></tr>';
                echo '</table>';
        }
--- 43,47 ----
                echo '<tr><td align="left"><a href="' . 
$GLOBALS['phpgw']->link('/polls/admin.php','show=questions') . '">' . 
lang('No') . '</td>';
                echo '    <td align="right"><a href="' . 
$GLOBALS['phpgw']->link('/polls/admin_deletequestion.php','poll_id='
!                       . $poll_id .'&confirm=True') . '">' . lang('Yes') . 
'</td></tr>';
                echo '</table>';
        }

Index: admin_editquestion.php
===================================================================
RCS file: /cvsroot/phpgroupware/polls/admin_editquestion.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** admin_editquestion.php      21 Dec 2001 14:59:46 -0000      1.6
--- admin_editquestion.php      30 Apr 2002 00:15:17 -0000      1.7
***************
*** 12,16 ****
    /* $Id$ */
  
!       $phpgw_info = array();
        $GLOBALS['phpgw_info']['flags'] = array(
                'admin_only'              => True,
--- 12,16 ----
    /* $Id$ */
  
!       $GLOBALS['phpgw_info'] = array();
        $GLOBALS['phpgw_info']['flags'] = array(
                'admin_only'              => True,
***************
*** 25,33 ****
        $GLOBALS['phpgw']->template->set_block('admin','row','row');
  
!       $poll_id = $HTTP_GET_VARS['poll_id'] ? $HTTP_GET_VARS['poll_id'] : 
$HTTP_POST_VARS['poll_id'];
  
!       if ($HTTP_POST_VARS['edit'])
        {
!               $question = $HTTP_POST_VARS['question'];
                $GLOBALS['phpgw']->db->query("update phpgw_polls_desc set 
poll_title='" . addslashes($question)
                        . "' where poll_id='$poll_id'",__LINE__,__FILE__);
--- 25,33 ----
        $GLOBALS['phpgw']->template->set_block('admin','row','row');
  
!       $poll_id = get_var('poll_id',Array('POST','GET'));
  
!       if(get_var('edit',Array('POST')))
        {
!               $question = get_var('question',Array('POST'));
                $GLOBALS['phpgw']->db->query("update phpgw_polls_desc set 
poll_title='" . addslashes($question)
                        . "' where poll_id='$poll_id'",__LINE__,__FILE__);
***************
*** 39,43 ****
        }
  
!       $GLOBALS['phpgw']->db->query("select * from phpgw_polls_desc where 
poll_id='$poll_id'");
        $GLOBALS['phpgw']->db->next_record();
  
--- 39,43 ----
        }
  
!       $GLOBALS['phpgw']->db->query("select * from phpgw_polls_desc where 
poll_id='$poll_id'",__LINE__,__FILE__);
        $GLOBALS['phpgw']->db->next_record();
  

Index: admin_settings.php
===================================================================
RCS file: /cvsroot/phpgroupware/polls/admin_settings.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** admin_settings.php  21 Dec 2001 15:00:59 -0000      1.8
--- admin_settings.php  30 Apr 2002 00:15:17 -0000      1.9
***************
*** 12,16 ****
    /* $Id$ */
  
!       $phpgw_info = array();
        $GLOBALS['phpgw_info']['flags'] = array(
                'admin_only'              => True,
--- 12,16 ----
    /* $Id$ */
  
!       $GLOBALS['phpgw_info'] = array();
        $GLOBALS['phpgw_info']['flags'] = array(
                'admin_only'              => True,
***************
*** 21,30 ****
        include('../header.inc.php');
  
!       if ($HTTP_POST_VARS['submit'])
        {
!               $settings = $HTTP_POST_VARS['settings'];
!               $GLOBALS['phpgw']->db->query("delete from 
phpgw_polls_settings",__LINE__,__FILE__);
  
!               while (list($name,$value) = each($settings))
                {
                        $GLOBALS['phpgw']->db->query("insert into 
phpgw_polls_settings values ('$name','$value')",__LINE__,__FILE__);
--- 21,30 ----
        include('../header.inc.php');
  
!       if(get_var('submit',Array('POST')))
        {
!               $settings = get_var('settings',Array('POST'));
!               $GLOBALS['phpgw']->db->query('delete from 
phpgw_polls_settings',__LINE__,__FILE__);
  
!               while(list($name,$value) = each($settings))
                {
                        $GLOBALS['phpgw']->db->query("insert into 
phpgw_polls_settings values ('$name','$value')",__LINE__,__FILE__);
***************
*** 34,38 ****
        else
        {
!               $GLOBALS['phpgw']->db->query("select * from 
phpgw_polls_settings");
                while ($GLOBALS['phpgw']->db->next_record())
                {
--- 34,38 ----
        else
        {
!               $GLOBALS['phpgw']->db->query('select * from 
phpgw_polls_settings',__LINE__,__FILE__);
                while ($GLOBALS['phpgw']->db->next_record())
                {
***************
*** 47,51 ****
        echo '<tr><td>' . lang('Select current poll') . '</td>'
                . '    <td><select name="settings[currentpoll]">';
!       $GLOBALS['phpgw']->db->query("select * from phpgw_polls_desc order by 
poll_title",__LINE__,__FILE__);
        while ($GLOBALS['phpgw']->db->next_record())
        {
--- 47,51 ----
        echo '<tr><td>' . lang('Select current poll') . '</td>'
                . '    <td><select name="settings[currentpoll]">';
!       $GLOBALS['phpgw']->db->query('select * from phpgw_polls_desc order by 
poll_title',__LINE__,__FILE__);
        while ($GLOBALS['phpgw']->db->next_record())
        {

Index: admin_viewquestion.php
===================================================================
RCS file: /cvsroot/phpgroupware/polls/admin_viewquestion.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** admin_viewquestion.php      21 Dec 2001 14:59:46 -0000      1.7
--- admin_viewquestion.php      30 Apr 2002 00:15:17 -0000      1.8
***************
*** 21,25 ****
        include('../header.inc.php');
  
!       $poll_id = $HTTP_GET_VARS['poll_id'];
  
        $GLOBALS['phpgw']->template->set_file(array('admin' => 
'admin_form.tpl'));
--- 21,25 ----
        include('../header.inc.php');
  
!       $poll_id = get_var('poll_id',Array('GET'));
  
        $GLOBALS['phpgw']->template->set_file(array('admin' => 
'admin_form.tpl'));

Index: vote.php
===================================================================
RCS file: /cvsroot/phpgroupware/polls/vote.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** vote.php    21 Apr 2002 19:19:27 -0000      1.10
--- vote.php    30 Apr 2002 00:15:17 -0000      1.11
***************
*** 14,20 ****
    /* $Id$ */
  
!       if ($GLOBALS['HTTP_POST_VARS']['submit'])
        {
!               $GLOBALS['phpgw_info']['flags'] = array(
                        'noheader' => True,
                        'nonavbar' => True
--- 14,20 ----
    /* $Id$ */
  
!       if($GLOBALS['HTTP_POST_VARS']['submit'])
        {
!               $GLOBALS['phpgw_info']['flags'] = Array(
                        'noheader' => True,
                        'nonavbar' => True
***************
*** 26,46 ****
        include('../header.inc.php');
  
!       if ($GLOBALS['HTTP_POST_VARS']['submit'])
        {
!               if (verify_uservote($GLOBALS['HTTP_POST_VARS']['poll_id']))
                {
                        
//$GLOBALS['phpgw']->db->lock(array("phpgw_polls_data","phpgw_polls_user"));
                        $GLOBALS['phpgw']->db->query("UPDATE phpgw_polls_data 
SET option_count=option_count+1 WHERE "
!                               . "poll_id='" . 
$GLOBALS['HTTP_POST_VARS']['poll_id'] . "' AND vote_id='" . 
$GLOBALS['HTTP_POST_VARS']['poll_voteNr'] . "'",__LINE__,__FILE__);
!                       $GLOBALS['phpgw']->db->query("insert into 
phpgw_polls_user values ('" . $GLOBALS['HTTP_POST_VARS']['poll_id'] . "','','"
                                . $GLOBALS['phpgw_info']['user']['account_id'] 
. "','" . time() . "')",__LINE__,__FILE__);
                        //$GLOBALS['phpgw']->db->unlock();
                }
!               Header('Location: ' . 
$GLOBALS['phpgw']->link('/polls/vote.php','show_results=' . 
$GLOBALS['HTTP_POST_VARS']['poll_id']));
                $GLOBALS['phpgw']->common->phpgw_exit();
        }
!       if ($GLOBALS['HTTP_GET_VARS']['show_results'])
        {
!               poll_viewResults($GLOBALS['HTTP_GET_VARS']['show_results']);
        }
        $GLOBALS['phpgw']->common->phpgw_footer();
--- 26,49 ----
        include('../header.inc.php');
  
!       if(get_var('submit',Array('POST')))
        {
!               $poll_id = get_var('poll_id',Array('POST'));
!               $poll_voteNr = get_var('poll_voteNr',Array('POST'));
!               if(verify_uservote($poll_id))
                {
                        
//$GLOBALS['phpgw']->db->lock(array("phpgw_polls_data","phpgw_polls_user"));
                        $GLOBALS['phpgw']->db->query("UPDATE phpgw_polls_data 
SET option_count=option_count+1 WHERE "
!                               . "poll_id='" . $poll_id . "' AND vote_id='" . 
$poll_voteNr . "'",__LINE__,__FILE__);
!                       $GLOBALS['phpgw']->db->query("insert into 
phpgw_polls_user values ('" . $poll_id . "','','"
                                . $GLOBALS['phpgw_info']['user']['account_id'] 
. "','" . time() . "')",__LINE__,__FILE__);
                        //$GLOBALS['phpgw']->db->unlock();
                }
!               Header('Location: ' . 
$GLOBALS['phpgw']->link('/polls/vote.php','show_results=' . $poll_id));
                $GLOBALS['phpgw']->common->phpgw_exit();
        }
!       $show_results = get_var('show_results',Array('GET'));
!       if($show_results)
        {
!               poll_viewResults($show_results);
        }
        $GLOBALS['phpgw']->common->phpgw_footer();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]