phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] headlines deleteheadline.php, 1.9, 1.9.4.1 editheadli


From: Dave Hall <address@hidden>
Subject: [Phpgroupware-cvs] headlines deleteheadline.php, 1.9, 1.9.4.1 editheadline.php, 1.12.2.1, 1.12.2.1.2.1 newheadline.php, 1.13.2.1, 1.13.2.1.2.1 preferences.php, 1.19.2.1, 1.19.2.1.2.1 viewheadline.php, 1.9, 1.9.4.1
Date: Fri, 10 Oct 2003 01:13:47 +0000

Update of /cvsroot/phpgroupware/headlines
In directory subversions:/tmp/cvs-serv29726

Modified Files:
      Tag: Version-0_9_16-branch
        deleteheadline.php editheadline.php newheadline.php 
        preferences.php viewheadline.php 
Log Message:
fixed for bugs 4400, 4402, 4403 + globals and sql

Index: editheadline.php
===================================================================
RCS file: /cvsroot/phpgroupware/headlines/editheadline.php,v
retrieving revision 1.12.2.1
retrieving revision 1.12.2.1.2.1
diff -C2 -d -r1.12.2.1 -r1.12.2.1.2.1
*** editheadline.php    1 Feb 2003 21:00:38 -0000       1.12.2.1
--- editheadline.php    10 Oct 2003 01:13:43 -0000      1.12.2.1.2.1
***************
*** 32,45 ****
                        $errors[] = lang('You must enter a display');
                }
! 
                if (! $n_base_url)
                {
                        $errors[] = lang('You must enter a base url');
                }
! 
                if (! $n_newsfile)
                {
                        $errors[] = lang('You must enter a news url');
                }
  
                if (! $n_cachetime)
--- 32,59 ----
                        $errors[] = lang('You must enter a display');
                }
!               
                if (! $n_base_url)
                {
                        $errors[] = lang('You must enter a base url');
                }
!               else
!               {
!                       if(substr($n_base_url, -1) == '/')
!                       {
!                               $n_base_url = substr($n_base_url, 0 , -1);
!                       }
!               }
!               
                if (! $n_newsfile)
                {
                        $errors[] = lang('You must enter a news url');
                }
+               else
+               {
+                       if(substr($n_newsfile, 0, 1) == '/')
+                       {
+                               $n_newsfile = substr($n_newsfile, 1);
+                       }
+               }
  
                if (! $n_cachetime)
***************
*** 63,69 ****
                }
  
!               $phpgw->db->query("select display from phpgw_headlines_sites 
where base_url='"
!                               . addslashes(strtolower($n_base_url)) . "' and 
newsfile='"
!                               . addslashes(strtolower($n_newsfile)) . "' and 
con !='$con'",__LINE__,__FILE__);
                $phpgw->db->next_record();
                if ($phpgw->db->f('display'))
--- 77,84 ----
                }
  
!               $phpgw->db->query('SELECT display FROM phpgw_headlines_sites'
!                               . " WHERE base_url='" . 
$phpgw->db->db_addslashes(strtolower($n_base_url)) . "'"
!                               . " AND newsfile LIKE'" . 
$phpgw->db->db_addslashes($n_newsfile) . "'" 
!                               . ' AND con !=' . 
intval($con),__LINE__,__FILE__);
                $phpgw->db->next_record();
                if ($phpgw->db->f('display'))
***************
*** 72,80 ****
                }
  
!               $phpgw->db->query("UPDATE phpgw_headlines_sites SET display='" 
. addslashes($n_display) . "', " 
!                       . "base_url='" . addslashes($n_base_url) . "', "
!                       . "newsfile='" . addslashes($n_newsfile) . "', "
!                       . "lastread=0, newstype='" . $n_newstype . "', "
!                       . "cachetime='$n_cachetime', listings='$n_listings' 
WHERE con='$con'",__LINE__,__FILE__);
  
                $phpgw->redirect($phpgw->link('/headlines/admin.php'));
--- 87,98 ----
                }
  
!               $phpgw->db->query('UPDATE phpgw_headlines_sites SET '
!                       . " display='" . $phpgw->db->addslashes($n_display) . 
"'," 
!                       . " base_url='" . 
$phpgw->db->db_addslashes($n_base_url) . "',"
!                       . " newsfile='" . 
$phpgw->db->db_addslashes($n_newsfile) . "',"
!                       . " lastread=0, newstype='" . 
$phpgw->db->db_addslashes($n_newstype) . "',"
!                       . ' cachetime=' . intval($n_cachetime) . ','
!                       . ' listings=' . intval($n_listings)
!                       . ' WHERE con='.intal($con),__LINE__,__FILE__);
  
                $phpgw->redirect($phpgw->link('/headlines/admin.php'));
***************
*** 82,93 ****
        else
        {
!               $phpgw->db->query("select * from phpgw_headlines_sites where 
con='$con'",__LINE__,__FILE__);
                $phpgw->db->next_record();
  
!               $n_display   = $phpgw->db->f('display');
!               $n_base_url  = $phpgw->db->f('base_url');
!               $n_newsfile  = $phpgw->db->f('newsfile');
                $n_cachetime = $phpgw->db->f('cachetime');
!               $n_newstype  = $phpgw->db->f('newstype');       
                $n_listings  = $phpgw->db->f('listings');
        }
--- 100,111 ----
        else
        {
!               $phpgw->db->query('SELECT * FROM phpgw_headlines_sites WHERE 
con='.intval($con),__LINE__,__FILE__);
                $phpgw->db->next_record();
  
!               $n_display   = $phpgw->db->f('display', True);
!               $n_base_url  = $phpgw->db->f('base_url', True);
!               $n_newsfile  = $phpgw->db->f('newsfile', True);
                $n_cachetime = $phpgw->db->f('cachetime');
!               $n_newstype  = $phpgw->db->f('newstype');
                $n_listings  = $phpgw->db->f('listings');
        }

Index: deleteheadline.php
===================================================================
RCS file: /cvsroot/phpgroupware/headlines/deleteheadline.php,v
retrieving revision 1.9
retrieving revision 1.9.4.1
diff -C2 -d -r1.9 -r1.9.4.1
*** deleteheadline.php  19 Nov 2001 15:46:14 -0000      1.9
--- deleteheadline.php  10 Oct 2003 01:13:43 -0000      1.9.4.1
***************
*** 21,26 ****
        include('../header.inc.php');
  
!       $con     = $GLOBALS['HTTP_POST_VARS']['con'] ? 
$GLOBALS['HTTP_POST_VARS']['con'] : $GLOBALS['HTTP_GET_VARS']['con'];
!       $confirm = $GLOBALS['HTTP_POST_VARS']['confirm'] ? 
$GLOBALS['HTTP_POST_VARS']['confirm'] : $GLOBALS['HTTP_GET_VARS']['confirm'];
  
        if (($con) && (! $confirm))
--- 21,26 ----
        include('../header.inc.php');
  
!       $con            = $_POST['con']         ? $_POST['con']         : 
$_GET['con'];
!       $confirm        = $_POST['confirm']     ? $_POST['confirm']     : 
$_GET['confirm'];
  
        if (($con) && (! $confirm))
***************
*** 52,59 ****
                $GLOBALS['phpgw']->db->transaction_begin();
  
!               $GLOBALS['phpgw']->db->query("delete from phpgw_headlines_sites 
where con='$con'",__LINE__,__FILE__);
!               $GLOBALS['phpgw']->db->query("delete from 
phpgw_headlines_cached where site='$con'",__LINE__,__FILE__);
  
!               $GLOBALS['phpgw']->db->query("SELECT * FROM 
phpgw_preferences",__LINE__,__FILE__);
                while ($GLOBALS['phpgw']->db->next_record())
                {
--- 52,62 ----
                $GLOBALS['phpgw']->db->transaction_begin();
  
!               $GLOBALS['phpgw']->db->query('DELETE FROM phpgw_headlines_sites'
!                                       . ' WHERE con=' . 
intval($con),__LINE__,__FILE__);
!               $GLOBALS['phpgw']->db->query('DELETE FROM 
phpgw_headlines_cached'
!                                       . ' WHERE site=' . 
intval($con),__LINE__,__FILE__);
  
!               $GLOBALS['phpgw']->db->query('SELECT * FROM phpgw_preferences'
!                                       . " WHERE preference_app 
='headlines'",__LINE__,__FILE__);
                while ($GLOBALS['phpgw']->db->next_record())
                {
***************
*** 66,70 ****
                                }
                        }
!                       else
                        {
                                $phpgw_newuser['user']['preferences'] = 
$GLOBALS['phpgw']->db->f('preference_value');
--- 69,73 ----
                                }
                        }
!                       else//not sure what this is doing, so it is unchanged - 
skwashd 
                        {
                                $phpgw_newuser['user']['preferences'] = 
$GLOBALS['phpgw']->db->f('preference_value');

Index: newheadline.php
===================================================================
RCS file: /cvsroot/phpgroupware/headlines/newheadline.php,v
retrieving revision 1.13.2.1
retrieving revision 1.13.2.1.2.1
diff -C2 -d -r1.13.2.1 -r1.13.2.1.2.1
*** newheadline.php     1 Feb 2003 21:00:38 -0000       1.13.2.1
--- newheadline.php     10 Oct 2003 01:13:43 -0000      1.13.2.1.2.1
***************
*** 32,35 ****
--- 32,42 ----
                        $errors[] = lang('You must enter a base url');
                }
+               else
+               {
+                       if(substr($n_base_url, -1) == '/')
+                       {
+                               $n_base_url = substr($n_base_url, 0 , -1);
+                       }
+               }
  
                if (! $n_newsfile)
***************
*** 37,40 ****
--- 44,54 ----
                        $errors[] = lang('You must enter a news url');
                }
+               else
+               {
+                       if(substr($n_newsfile, 0, 1) == '/')
+                       {
+                               $n_newsfile = substr($n_newsfile, 1);
+                       }
+               }
  
                if (! $n_cachetime)
***************
*** 58,64 ****
                }
  
!               $phpgw->db->query("select display from phpgw_headlines_sites 
where base_url='"
!                               . addslashes(strtolower($n_base_url)) . "' and 
newsfile='"
!                               . addslashes(strtolower($n_newsfile)) . 
"'",__LINE__,__FILE__);
                $phpgw->db->next_record();
                if ($phpgw->db->f('display'))
--- 72,78 ----
                }
  
!               $phpgw->db->query('SELECT display FROM phpgw_headlines_sites'
!                               . " WHERE 
base_url='".$phpgws->db->db_addslashes(strtolower($n_base_url)) . "'"
!                               . " AND newsfile 
LIKE'".$phpgw->db->db_addslashes($n_newsfile)."'",__LINE__,__FILE__);
                $phpgw->db->next_record();
                if ($phpgw->db->f('display'))
***************
*** 69,78 ****
                if (! is_array($errors))
                {
!                       $sql = "insert into phpgw_headlines_sites 
(display,base_url,newsfile,"
                                        . 
"lastread,newstype,cachetime,listings) "
!                                       . "values ('" . addslashes($n_display) 
. "','"
!                                       . addslashes(strtolower($n_base_url)) . 
"','" 
!                                       . addslashes(strtolower($n_newsfile)) . 
"',0,'"
!                                       . $n_newstype . 
"',$n_cachetime,$n_listings)";
  
                        $phpgw->db->query($sql,__LINE__,__FILE__);
--- 83,94 ----
                if (! is_array($errors))
                {
!                       $sql = "INSERT INTO phpgw_headlines_sites 
(display,base_url,newsfile,"
                                        . 
"lastread,newstype,cachetime,listings) "
!                                       . "VALUES ('" . 
$phpgw->db->db_addslashes($n_display) . "',"
!                                       . "'" . 
$phpgw->db->db_addslashes(strtolower($n_base_url)) . "',"
!                                       . "'" . 
$phpgw->db->db_addslashes($n_newsfile) . "',0,"
!                                       . "'" . 
$phpgw->db->db_addslashes($n_newstype) . "',"
!                                       . intval($n_cachetime) . ','
!                                       . intval($n_listings);
  
                        $phpgw->db->query($sql,__LINE__,__FILE__);

Index: preferences.php
===================================================================
RCS file: /cvsroot/phpgroupware/headlines/preferences.php,v
retrieving revision 1.19.2.1
retrieving revision 1.19.2.1.2.1
diff -C2 -d -r1.19.2.1 -r1.19.2.1.2.1
*** preferences.php     25 Jan 2002 02:53:28 -0000      1.19.2.1
--- preferences.php     10 Oct 2003 01:13:44 -0000      1.19.2.1.2.1
***************
*** 42,46 ****
                                $html_select .= ' selected';
                        }
!                       $html_select .= '>' . 
$GLOBALS['phpgw']->db->f('display') . '</option>'."\n";
                }
                
$GLOBALS['phpgw']->template->set_var('select_options',$html_select);
--- 42,46 ----
                                $html_select .= ' selected';
                        }
!                       $html_select .= '>' . 
$GLOBALS['phpgw']->db->f('display', True) . '</option>'."\n";
                }
                
$GLOBALS['phpgw']->template->set_var('select_options',$html_select);
***************
*** 60,66 ****
                }
        
!               if (count($GLOBALS['HTTP_POST_VARS']['headlines']))
                {
!                       while ($value = 
each($GLOBALS['HTTP_POST_VARS']['headlines']))
                        {
                                
$GLOBALS['phpgw']->preferences->add('headlines',$value[1],'True');
--- 60,66 ----
                }
        
!               if (count($_POST['headlines']))
                {
!                       while ($value = each($_POST['headlines']))
                        {
                                
$GLOBALS['phpgw']->preferences->add('headlines',$value[1],'True');

Index: viewheadline.php
===================================================================
RCS file: /cvsroot/phpgroupware/headlines/viewheadline.php,v
retrieving revision 1.9
retrieving revision 1.9.4.1
diff -C2 -d -r1.9 -r1.9.4.1
*** viewheadline.php    22 Sep 2001 02:05:38 -0000      1.9
--- viewheadline.php    10 Oct 2003 01:13:44 -0000      1.9.4.1
***************
*** 62,66 ****
  
  
!       $phpgw->db->query("select title,link from phpgw_headlines_cached where 
site='$con'",__LINE__,__FILE__);
  
        $phpgw->template->set_var('th_bg2',$phpgw_info['theme']['th_bg']);
--- 62,67 ----
  
  
!       $phpgw->db->query('SELECT title,link FROM phpgw_headlines_cached'
!                       . ' WHERE site=' . intval($con),__LINE__,__FILE__);
  
        $phpgw->template->set_var('th_bg2',$phpgw_info['theme']['th_bg']);





reply via email to

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