Now works with track_vars off.
authorpallo <pallo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 3 Apr 2000 08:16:10 +0000 (08:16 +0000)
committerpallo <pallo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 3 Apr 2000 08:16:10 +0000 (08:16 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@380 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/addressbook.php

index 7b0a215210a6c6bcd5ed7db210b39453579f004d..c69fee4617235b27125fb841b658d0e7708786aa 100644 (file)
       // ***********************************************
       // Add new address
       // ***********************************************
-      $add_data = $HTTP_POST_VARS["addaddr"];
-      if(!empty($add_data["nickname"])) {
+      if(!empty($addaddr["nickname"])) {
         
-        $r = $abook->add($add_data, $abook->localbackend);
+        $r = $abook->add($addaddr, $abook->localbackend);
 
         // Handle error messages
         if(!$r) {
 
            $formerror = $errstr;
            $showaddrlist = false;
-           $defdata = $add_data;
+           $defdata = $addaddr;
         }
    
       } 
       // ***********************************************
       // Delete address(es)
       // ***********************************************
-      else if((!empty($HTTP_POST_VARS["deladdr"])) &&
-         sizeof($HTTP_POST_VARS["sel"]) > 0) {
-
-        $sel = $HTTP_POST_VARS["sel"];
+      else if((!empty($deladdr)) &&
+         sizeof($sel) > 0) {
+        $orig_sel = $sel;
         sort($sel);
 
         // The selected addresses are identidied by "backend:nickname".
 
         if($delfailed) {
            $showaddrlist = true;
-           $defselected = $HTTP_POST_VARS["sel"];
+           $defselected  = $orig_sel;
         }
       }
 
       // ***********************************************
       // Update/modify address
       // ***********************************************
-      else if(!empty($HTTP_POST_VARS["editaddr"])) {
+      else if(!empty($editaddr)) {
 
         // Stage one: Copy data into form
-         if(sizeof($HTTP_POST_VARS["sel"]) > 0) {
-           if(sizeof($HTTP_POST_VARS["sel"]) > 1) {
+         if(sizeof($sel) > 0) {
+           if(sizeof($sel) > 1) {
               $formerror = _("You can only edit one address at the time");
               $showaddrlist = true;
-              $defselected = $HTTP_POST_VARS["sel"];
+              $defselected = $sel;
            } else {
               $abortform = true;
-              list($ebackend, $enick) = split(":", $HTTP_POST_VARS["sel"][0]);
+              list($ebackend, $enick) = split(":", $sel[0]);
               $olddata = $abook->lookup($enick, $ebackend);
 
               // Display the "new address" form
         }
 
         // Stage two: Write new data
-        else if($HTTP_POST_VARS["doedit"] = 1) {
-           $newdata = $HTTP_POST_VARS["editaddr"];
-           $r = $abook->modify($HTTP_POST_VARS["oldnick"],
-                               $newdata,
-                               $HTTP_POST_VARS["backend"]);
+        else if($doedit = 1) {
+           $newdata = $editaddr;
+           $r = $abook->modify($oldnick, $newdata, $backend);
 
            // Handle error messages
            if(!$r) {