Lots of changes for variable initialization - clean up, really,
[squirrelmail.git] / src / addressbook.php
index 91f833924493f525f5866bff4e9ca9875aa1b325..17528d9ba48b609034aa4a6ab3613e8ff18cdf46 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * addressbook.php
  *
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * Manage personal address book.
@@ -16,12 +16,29 @@ define('SM_PATH','../');
 
 /* SquirrelMail required files. */
 require_once(SM_PATH . 'include/validate.php');
-require_once(SM_PATH . 'functions/array.php');
+require_once(SM_PATH . 'functions/global.php');
 require_once(SM_PATH . 'functions/display_messages.php');
 require_once(SM_PATH . 'functions/addressbook.php');
 require_once(SM_PATH . 'functions/strings.php');
 require_once(SM_PATH . 'functions/html.php');
 
+/* lets get the global vars we may need */
+sqgetGlobalVar('key',       $key,           SQ_COOKIE);
+
+sqgetGlobalVar('username',  $username,      SQ_SESSION);
+sqgetGlobalVar('onetimepad',$onetimepad,    SQ_SESSION);
+sqgetGlobalVar('base_uri',  $base_uri,      SQ_SESSION);
+sqgetGlobalVar('delimiter', $delimiter,     SQ_SESSION);
+
+/* From the address form */
+sqgetGlobalVar('addaddr',   $addaddr,   SQ_POST);
+sqgetGlobalVar('editaddr',  $editaddr,  SQ_POST);
+sqgetGlobalVar('deladdr',   $deladdr,   SQ_POST);
+sqgetGlobalVar('sel',       $sel,       SQ_POST);
+sqgetGlobalVar('oldnick',   $oldnick,   SQ_POST);
+sqgetGlobalVar('backend',   $backend,   SQ_POST);
+sqgetGlobalVar('doedit',    $doedit,    SQ_POST); 
+
 /* Make an input field */
 function adressbook_inp_field($label, $field, $name, $size, $values, $add) {
     global $color;
@@ -78,7 +95,7 @@ $form_url = 'addressbook.php';
 
 
 /* Handle user's actions */
-if($REQUEST_METHOD == 'POST') {
+if(sqgetGlobalVar('REQUEST_METHOD', $req_method, SQ_SERVER) && $req_method == 'POST') {
 
     /**************************************************
      * Add new address                                *
@@ -383,4 +400,4 @@ echo '</FORM>';
 do_hook('addressbook_bottom');
 ?>
 
-</BODY></HTML>
\ No newline at end of file
+</BODY></HTML>