diff contrib/web/php-admin/htdocs/save.php @ 769:fc5892d87716

Update php code to use superglobals
author Ben Schmidt
date Fri, 29 Oct 2010 22:13:47 +1100
parents 75fb7729c6e8
children b9b60f3dd694
line wrap: on
line diff
--- a/contrib/web/php-admin/htdocs/save.php	Thu Oct 21 10:08:35 2010 +1100
+++ b/contrib/web/php-admin/htdocs/save.php	Fri Oct 29 22:13:47 2010 +1100
@@ -31,11 +31,11 @@
 
 function mlmmj_boolean($name, $nicename, $text)
 {
-    global $tpl, $topdir, $list, $HTTP_POST_VARS;
+    global $tpl, $topdir, $list;
     
     $file = $topdir."/".$list."/control/".$name;
     
-    if (isset($HTTP_POST_VARS[$name])) 
+    if(isset($_POST[$name]) && !empty($_POST[$name]))
     {
 	if(!touch($file))
 	    die("Couldn't open ".$file." for writing");
@@ -53,16 +53,16 @@
 
 function mlmmj_list($name, $nicename, $text) 
 {
-    global $tpl, $topdir, $list,$HTTP_POST_VARS;
+    global $tpl, $topdir, $list;
 
     $file = $topdir."/".$list."/control/".$name;
     
-    if(!empty($HTTP_POST_VARS[$name]))
+    if(isset($_POST[$name]) && !empty($_POST[$name]))
     {
 	if (!$fp = fopen($file, "w"))
 	    die("Couldn't open ".$file." for writing");
 
-	fwrite($fp, preg_replace('/\\r/',"",$HTTP_POST_VARS[$name]));
+       fwrite($fp, preg_replace('/\\r/',"",$_POST[$name]));
 	fclose($fp);
 
 	if (!chmod($file, 0644))
@@ -79,7 +79,7 @@
 
 $tpl = new rFastTemplate($templatedir);
 
-$list = $HTTP_POST_VARS["list"];
+$list = $_POST["list"];
 
 if(!isset($list))
 die("no list specified");