[20891] change from $GLOBALS['HTTP_POST_VARS'] to $_POST

Sigurd Nes <[email protected]>
Newsgroups gmane.comp.web.phpgroupware.cvs
Message-ID <[email protected]>
Revision: 20891
          http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=20891
Author:   sigurdne
Date:     2009-11-23 20:14:55 +0000 (Mon, 23 Nov 2009)
Log Message:
-----------
change from $GLOBALS['HTTP_POST_VARS'] to $_POST

Modified Paths:
--------------
    modules/email/trunk/addressbook-js.php
    modules/email/trunk/inc/class.mail_filters.inc.php
    modules/email/trunk/inc/class.uijsaddressbook.inc.php

Modified: modules/email/trunk/addressbook-js.php
===================================================================
--- modules/email/trunk/addressbook-js.php	2009-11-23 20:02:40 UTC (rev 20890)
+++ modules/email/trunk/addressbook-js.php	2009-11-23 20:14:55 UTC (rev 20891)
@@ -41,9 +41,9 @@
 	$boxecoming=False;
 
 /*		This   exists if we clicked on a name to see its data from the database  */
-	$searchbox  = $GLOBALS['HTTP_POST_VARS']['searchbox'] ? $GLOBALS['HTTP_POST_VARS']['searchbox'] : $GLOBALS['HTTP_GET_VARS']['searchbox'];
+	$searchbox  = $_POST['searchbox'] ? $_POST['searchbox'] : $_GET['searchbox'];
 /*	This is the View More checkbox */
-	$viewmore = $GLOBALS['HTTP_POST_VARS']['viewmore'] ? $GLOBALS['HTTP_POST_VARS']['viewmore'] : $GLOBALS['HTTP_GET_VARS']['viewmore'];
+	$viewmore = $_POST['viewmore'] ? $_POST['viewmore'] : $_GET['viewmore'];
 	
 /*	
 	The next three are, respectively, the selected To:,cc and bcc  selectboxes. We need them to remember if
@@ -158,11 +158,11 @@
 	$GLOBALS['phpgw']->template->set_var('lang_select_cats',lang('Select category'));
 
 /*	This vars here are most important, they drive the search */
-	$start  = $GLOBALS['HTTP_POST_VARS']['start'] ? $GLOBALS['HTTP_POST_VARS']['start'] : $GLOBALS['HTTP_GET_VARS']['start'];
-	$filter  = $GLOBALS['HTTP_POST_VARS']['filter'] ? $GLOBALS['HTTP_POST_VARS']['filter'] : $GLOBALS['HTTP_GET_VARS']['filter'];
-	$cat_id  = $GLOBALS['HTTP_POST_VARS']['cat_id'] ? $GLOBALS['HTTP_POST_VARS']['cat_id'] : $GLOBALS['HTTP_GET_VARS']['cat_id'];
+	$start  = $_POST['start'] ? $_POST['start'] : $_GET['start'];
+	$filter  = $_POST['filter'] ? $_POST['filter'] : $_GET['filter'];
+	$cat_id  = $_POST['cat_id'] ? $_POST['cat_id'] : $_GET['cat_id'];
 	$cat_id = ($cat_id == -2)?"":$cat_id;
-	$order  = $GLOBALS['HTTP_POST_VARS']['order'] ? $GLOBALS['HTTP_POST_VARS']['order'] : $GLOBALS['HTTP_GET_VARS']['order'];
+	$order  = $_POST['order'] ? $_POST['order'] : $_GET['order'];
 	$GLOBALS['phpgw']->template->set_var('search_action',$GLOBALS['phpgw']->link('/'.$GLOBALS['phpgw_info']['flags']['currentapp'].'/addressbook-js.php',"sort=$sort&order=$order&filter=$filter&start=$start&cat_id=$cat_id"));
 	$GLOBALS['phpgw']->template->set_var('query',$query);
 	$GLOBALS['phpgw']->template->set_var('order',$order);

Modified: modules/email/trunk/inc/class.mail_filters.inc.php
===================================================================
--- modules/email/trunk/inc/class.mail_filters.inc.php	2009-11-23 20:02:40 UTC (rev 20890)
+++ modules/email/trunk/inc/class.mail_filters.inc.php	2009-11-23 20:14:55 UTC (rev 20891)
@@ -64,19 +64,19 @@
 		function distill_filter_args()
 		{
 			// do we have data
-			if  (!isset($GLOBALS['HTTP_POST_VARS'][$this->submit_flag]))
+			if  (!isset($_POST[$this->submit_flag]))
 			{
 				if ($this->debug_level > 0) { echo 'mail_filters: distill_filter_args: NO data submitted<br />'."\r\n"; }
 				return Array();
 			}
 			
 			// look for top level "filter_X" array
-			while(list($key,$value) = each($GLOBALS['HTTP_POST_VARS']))
+			while(list($key,$value) = each($_POST))
 			{
 				if (strstr($key, 'filter_'))
 				{
 					// put the raw data dor this particular filter into a local var
-					$filter_X = $GLOBALS['HTTP_POST_VARS'][$key];
+					$filter_X = $_POST[$key];
 					if ($this->debug_level > 0) { echo 'mail_filters: distill_filter_args: filter_X dump <strong><pre>'; print_r($filter_X); echo "</pre></strong>\r\n"; }
 					
 					// prepare to fill your structured array

Modified: modules/email/trunk/inc/class.uijsaddressbook.inc.php
===================================================================
--- modules/email/trunk/inc/class.uijsaddressbook.inc.php	2009-11-23 20:02:40 UTC (rev 20890)
+++ modules/email/trunk/inc/class.uijsaddressbook.inc.php	2009-11-23 20:14:55 UTC (rev 20891)
@@ -230,10 +230,10 @@
 			$this->template->set_var('include_link',$GLOBALS['phpgw']->link("/email/inc/selectboxes.js"));
 			$this->template->set_var('font',$GLOBALS['phpgw_info']['theme']['font']);
 			//Get the hider values where needed
-			$this->hideto  = $GLOBALS['HTTP_POST_VARS']['hideto'] ? $GLOBALS['HTTP_POST_VARS']['hideto'] : $GLOBALS['HTTP_GET_VARS']['hideto'];
-			$this->hidecc  = $GLOBALS['HTTP_POST_VARS']['hidecc'] ? $GLOBALS['HTTP_POST_VARS']['hidecc'] : $GLOBALS['HTTP_GET_VARS']['hidecc'];
-			$this->hidebcc  = $GLOBALS['HTTP_POST_VARS']['hidebcc'] ? $GLOBALS['HTTP_POST_VARS']['hidebcc'] : $GLOBALS['HTTP_GET_VARS']['hidebcc'];
-			$this->cat_id  = $GLOBALS['HTTP_POST_VARS']['cat_id'] ? $GLOBALS['HTTP_POST_VARS']['cat_id'] : $GLOBALS['HTTP_GET_VARS']['cat_id'];
+			$this->hideto  = $_POST['hideto'] ? $_POST['hideto'] : $_GET['hideto'];
+			$this->hidecc  = $_POST['hidecc'] ? $_POST['hidecc'] : $_GET['hidecc'];
+			$this->hidebcc  = $_POST['hidebcc'] ? $_POST['hidebcc'] : $_GET['hidebcc'];
+			$this->cat_id  = $_POST['cat_id'] ? $_POST['cat_id'] : $_GET['cat_id'];
 			//Set the link to the main frame...see, this is what im talking about
 			//asd soon as this frameset is server to the browser it will go GET
 			//the given url which is a call to the public function show_mainframe
@@ -330,8 +330,8 @@
 			/* DEPRECATED We initialize this switch that tells the code if any comes with data in it */
 			$boxecoming=False;
 
-			$this->searchbox  = $GLOBALS['HTTP_POST_VARS']['searchbox'] ? $GLOBALS['HTTP_POST_VARS']['searchbox'] : $GLOBALS['HTTP_GET_VARS']['searchbox'];
-			$this->querycommand=$GLOBALS['HTTP_POST_VARS']['querycommand'] ? $GLOBALS['HTTP_POST_VARS']['querycommand'] : $GLOBALS['HTTP_GET_VARS']['querycommand'];
+			$this->searchbox  = $_POST['searchbox'] ? $_POST['searchbox'] : $_GET['searchbox'];
+			$this->querycommand=$_POST['querycommand'] ? $_POST['querycommand'] : $_GET['querycommand'];
 			if($this->querycommand=='cleanquery')//We have been ordered to clean the query
 			{
 				$this->searchbox="";
@@ -343,7 +343,7 @@
 					$this->searchbox=$GLOBALS['phpgw']->session->appsession('jsuibook_sbox','email');
 			}
 			/*      This is the View More checkbox */
-			$this->viewmore = $GLOBALS['HTTP_POST_VARS']['viewmore'] ? $GLOBALS['HTTP_POST_VARS']['viewmore'] : $GLOBALS['HTTP_GET_VARS']['viewmore'];
+			$this->viewmore = $_POST['viewmore'] ? $_POST['viewmore'] : $_GET['viewmore'];
 
 			/*      
 				The next three are, respectively, the selected To:,cc and bcc  selectboxes. We need them to remember if
@@ -352,14 +352,14 @@
 				just before submiting. BTW, this should come in post allways but its a good practice to allways try and 
 				get from both. Good thing about get_var in 0.9.15.
 			 */
-			$this->toselectbox=$GLOBALS['HTTP_POST_VARS']['toselectbox']? $GLOBALS['HTTP_POST_VARS']['toselectbox'] : $GLOBALS['HTTP_GET_VARS']['toselectbox'];
-			$this->ccselectbox=$GLOBALS['HTTP_POST_VARS']['ccselectbox']? $GLOBALS['HTTP_POST_VARS']['ccselectbox'] : $GLOBALS['HTTP_GET_VARS']['ccselectbox'];
-			$this->bccselectbox=$GLOBALS['HTTP_POST_VARS']['bccselectbox']? $GLOBALS['HTTP_POST_VARS']['bccselectbox'] : $GLOBALS['HTTP_GET_VARS']['bccselectbox'];
-			$this->nameselectbox  = $GLOBALS['HTTP_POST_VARS']['nameselect'] ? $GLOBALS['HTTP_POST_VARS']['nameselect'] : $GLOBALS['HTTP_GET_VARS']['nameselect'];
+			$this->toselectbox=$_POST['toselectbox']? $_POST['toselectbox'] : $_GET['toselectbox'];
+			$this->ccselectbox=$_POST['ccselectbox']? $_POST['ccselectbox'] : $_GET['ccselectbox'];
+			$this->bccselectbox=$_POST['bccselectbox']? $_POST['bccselectbox'] : $_GET['bccselectbox'];
+			$this->nameselectbox  = $_POST['nameselect'] ? $_POST['nameselect'] : $_GET['nameselect'];
 			//nameselect is the value of the first selection in the nameselectbox
 			$this->nameselect = $this->nameselectbox[0];
-			$this->start  = $GLOBALS['HTTP_POST_VARS']['start'] ? $GLOBALS['HTTP_POST_VARS']['start'] : $GLOBALS['HTTP_GET_VARS']['start'];
-			$this->filter  = $GLOBALS['HTTP_POST_VARS']['filter'] ? $GLOBALS['HTTP_POST_VARS']['filter'] : $GLOBALS['HTTP_GET_VARS']['filter'];
+			$this->start  = $_POST['start'] ? $_POST['start'] : $_GET['start'];
+			$this->filter  = $_POST['filter'] ? $_POST['filter'] : $_GET['filter'];
 			//To selectbox must be hidden,set variables acordinlgy....likewise for cc and bcc
 			if($this->hideto)
 			{
@@ -457,7 +457,7 @@
 				}
 			}
 			//Get our category id
-			$this->cat_id  = $GLOBALS['HTTP_POST_VARS']['cat_id'] ? $GLOBALS['HTTP_POST_VARS']['cat_id'] : $GLOBALS['HTTP_GET_VARS']['cat_id'];
+			$this->cat_id  = $_POST['cat_id'] ? $_POST['cat_id'] : $_GET['cat_id'];
 			//print "<br /> ".$this->cat_id;
 			//Check if we have to check in the cache
 			if($this->cat_id == -1)
@@ -486,9 +486,9 @@
 				$this->cat_id="";
 			}
 			//The order query field...NOT USED ATM
-			$this->order  = $GLOBALS['HTTP_POST_VARS']['order'] ? $GLOBALS['HTTP_POST_VARS']['order'] : $GLOBALS['HTTP_GET_VARS']['order'];
+			$this->order  = $_POST['order'] ? $_POST['order'] : $_GET['order'];
 			//So we remember the autocomplete's value
-			$this->searchautocomplete  = $GLOBALS['HTTP_POST_VARS']['searchautocomplete'] ? $GLOBALS['HTTP_POST_VARS']['searchautocomplete'] : $GLOBALS['HTTP_GET_VARS']['searchautocomplete'];
+			$this->searchautocomplete  = $_POST['searchautocomplete'] ? $_POST['searchautocomplete'] : $_GET['searchautocomplete'];
 			if(!$this->searchautocomplete&&($this->querycommand != 'cleanquery'))//again, not found in the vars, look for it in cache
 			{
 				$this->searchautocomplete=$GLOBALS['phpgw']->session->appsession('jsuibook_acbox','email');
@@ -499,7 +499,7 @@
 				$GLOBALS['phpgw']->session->appsession('jsuibook_acbox','email','');
 			}
 			//The sort field ... NOTUSED ATM
-			$this->sort = $GLOBALS['HTTP_POST_VARS']['sort'] ? $GLOBALS['HTTP_POST_VARS']['sort'] : $GLOBALS['HTTP_GET_VARS']['sort'];
+			$this->sort = $_POST['sort'] ? $_POST['sort'] : $_GET['sort'];
 			//Starnge.... i have no idea what does this do
 			$catid_string=($this->cat_id) ? "cat_id=".$this->cat_id : "";
 			
@@ -770,11 +770,11 @@
 		function set_destboxes()
 		{
 			
-			$this->toselectbox=$GLOBALS['HTTP_POST_VARS']['toselectbox']? $GLOBALS['HTTP_POST_VARS']['toselectbox'] : $GLOBALS['HTTP_GET_VARS']['toselectbox'];
-			$this->ccselectbox=$GLOBALS['HTTP_POST_VARS']['ccselectbox']? $GLOBALS['HTTP_POST_VARS']['ccselectbox'] : $GLOBALS['HTTP_GET_VARS']['ccselectbox'];
-			$this->bccselectbox=$GLOBALS['HTTP_POST_VARS']['bccselectbox']? $GLOBALS['HTTP_POST_VARS']['bccselectbox'] : $GLOBALS['HTTP_GET_VARS']['bccselectbox'];
-			$deleted=$GLOBALS['HTTP_POST_VARS']['deleted']? $GLOBALS['HTTP_POST_VARS']['deleted'] : $GLOBALS['HTTP_GET_VARS']['deleted'];
-			$forget_after=$GLOBALS['HTTP_POST_VARS']['forget_after']? $GLOBALS['HTTP_POST_VARS']['forget_after'] : $GLOBALS['HTTP_GET_VARS']['forget_after'];
+			$this->toselectbox=$_POST['toselectbox']? $_POST['toselectbox'] : $_GET['toselectbox'];
+			$this->ccselectbox=$_POST['ccselectbox']? $_POST['ccselectbox'] : $_GET['ccselectbox'];
+			$this->bccselectbox=$_POST['bccselectbox']? $_POST['bccselectbox'] : $_GET['bccselectbox'];
+			$deleted=$_POST['deleted']? $_POST['deleted'] : $_GET['deleted'];
+			$forget_after=$_POST['forget_after']? $_POST['forget_after'] : $_GET['forget_after'];
 			$this->bo=CreateObject("email.bojsaddressbook");
 		
 			$destboxes=array(
@@ -870,7 +870,7 @@
 						'userdata_t' => 'addressbook-js-bits.tpl'
 						));
 			$this->bo=CreateObject("email.bojsaddressbook");
-			$this->nameselect  = $GLOBALS['HTTP_POST_VARS']['nameselect'] ? $GLOBALS['HTTP_POST_VARS']['nameselect'] : $GLOBALS['HTTP_GET_VARS']['nameselect'];
+			$this->nameselect  = $_POST['nameselect'] ? $_POST['nameselect'] : $_GET['nameselect'];
 			$data = $this->bo->recordinfo($this->nameselect);
 			if(!$data)
 			{
@@ -960,4 +960,3 @@
 					
 		}
 	}
-?>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.