[AppDB] preferences fix

Jonathan Ernst Jonathan at ErnstFamily.ch
Tue Dec 14 04:57:18 CST 2004


This patch fixes problem with the preferences code where user e-mail and 
password was not updated anymore because of global vars not being 
registered.

CHANGELOG:
- fixes bugs in preferences.php

File changed:
- preferences.php

-------------- next part --------------
Index: preferences.php
===================================================================
RCS file: /home/wine/appdb/preferences.php,v
retrieving revision 1.4
diff -u -r1.4 preferences.php
--- preferences.php	13 Dec 2004 03:50:11 -0000	1.4
+++ preferences.php	14 Dec 2004 10:55:24 -0000
@@ -57,30 +57,27 @@
 
 }
 
-if($HTTP_POST_VARS)
-{
-    global $ext_username, $ext_password1, $ext_password2, $ext_realname, $ext_email;
-    
-    
+if($_REQUEST)
+{   
     $user = new User();
     
-    while(list($key, $value) = each($HTTP_POST_VARS))
+    while(list($key, $value) = each($_REQUEST))
         {
             if(!ereg("^pref_(.+)$", $key, $arr))
                 continue;
             $_SESSION['current']->setpref($arr[1], $value);
         }
     
-    if ($ext_password == $ext_password2)
+    if ($_REQUEST['ext_password'] == $_REQUEST['ext_password2'])
     {
-        $passwd = $ext_password;
+        $str_passwd = $_REQUEST['ext_password'];
     }
-    else if ($ext_password)
+    else if ($_REQUEST['ext_password'])
     {
         addmsg("The Passwords you entered did not match.", "red");
     }
     
-    if ($user->update($_SESSION['current']->userid, $passwd, $ext_realname, $ext_email))
+    if ($user->update($_SESSION['current']->userid, $str_passwd, $_REQUEST['ext_realname'], $_REQUEST['ext_email']))
     {
         addmsg("Preferences Updated", "green");
     }


More information about the wine-patches mailing list