Complete Marc's fix for untagged [PARSE] response to THREAD
[squirrelmail.git] / plugins / abook_take / take.php
index b062552e16defc9c66fd3aa83152f2b37bd2816e..6a78d55427f5e2f680e77db24e6af5c917e219a6 100644 (file)
@@ -1,19 +1,24 @@
 <?php
 
-  /**
-   * take.php
-   *
-   * Adds a "taken" address to the address book.  Takes addresses from
-   * incoming mail -- the body, To, From, Cc, or Reply-To.
-   */
+/**
+ * take.php
+ *
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Licensed under the GNU GPL. For full terms see the file COPYING.
+ *
+ * Address Take -- steals addresses from incoming email messages. Searches
+ * the To, Cc, From and Reply-To headers.
+ *
+ * $Id$
+ */
    
 /* Path for SquirrelMail required files. */
 define('SM_PATH','../../');
 
 /* SquirrelMail required files. */
+require_once(SM_PATH . 'include/validate.php');
 require_once(SM_PATH . 'functions/strings.php');
 require_once(SM_PATH . 'config/config.php');
-require_once(SM_PATH . 'include/validate.php');
 require_once(SM_PATH . 'functions/i18n.php');
 require_once(SM_PATH . 'functions/page_header.php');
 require_once(SM_PATH . 'functions/addressbook.php');
@@ -21,11 +26,15 @@ require_once(SM_PATH . 'include/load_prefs.php');
 require_once(SM_PATH . 'functions/html.php');
    
 displayPageHeader($color, 'None');
-  
+
+/* input form data */
+sqgetGlobalVar('email', $email, SQ_POST);
+
 $abook_take_verify = getPref($data_dir, $username, 'abook_take_verify');
 
 $abook = addressbook_init(false, true);
 $name = 'addaddr';
+
 echo '<form action="../../src/addressbook.php" name="f_add" method="post">' ."\n" .
     html_tag( 'table',
         html_tag( 'tr',
@@ -44,39 +53,61 @@ echo '<form action="../../src/addressbook.php" name="f_add" method="post">' ."\n
             html_tag( 'td', _("E-mail address") . ':', 'right', $color[4], 'width="50"' ) . "\n" .
             html_tag( 'td', '', 'left', $color[4] ) .
                 '<select name="' . $name . "[email]\">\n";
-  foreach ($email as $Val)
-  {
-      if (valid_email($Val, $abook_take_verify))
-      {
-          echo '<option value="' . htmlspecialchars($Val) .
-              '">' . htmlspecialchars($Val) . "</option>\n";
-      }
-      else
-      {
-          echo '<option value="' . htmlspecialchars($Val) .
+
+    foreach ($email as $Val)
+    {
+        if (valid_email($Val, $abook_take_verify))
+        {
+            echo '<option value="' . htmlspecialchars($Val) .
+                '">' . htmlspecialchars($Val) . "</option>\n";
+        } else {
+            echo '<option value="' . htmlspecialchars($Val) .
              '">FAIL - ' . htmlspecialchars($Val) . "</option>\n";
-      }
-  }
-  echo '</select></td></tr>' . "\n" . 
+        }
+    }
+    if ($squirrelmail_language == 'ja_JP') {
+        echo '</select></td></tr>' . "\n" . 
+            
+            html_tag( 'tr', "\n" .
+                      html_tag( 'td', _("Last name") . ':', 'right', $color[4], 'width="50"' ) .
+                      html_tag( 'td', '<input name="' . $name . '[lastname]" size="45" value="">', 'left', $color[4] )
+                      ) . "\n" .
+            html_tag( 'tr', "\n" .
+                      html_tag( 'td', _("First name") . ':', 'right', $color[4], 'width="50"' ) .
+                      html_tag( 'td', '<input name="' . $name . '[firstname]" size="45" value="">', 'left', $color[4] )
+                      ) . "\n" .
+            html_tag( 'tr', "\n" .
+                      html_tag( 'td', _("Additional info") . ':', 'right', $color[4], 'width="50"' ) .
+                      html_tag( 'td', '<input name="' . $name . '[label]" size="45" value="">', 'left', $color[4] )
+                      ) . "\n" .
+            html_tag( 'tr', "\n" .
+                      html_tag( 'td',
+                                '<input type="submit" name="' . $name . '[SUBMIT]" size="45" value="'. _("Add address") .'">' ,
+                                'center', $color[4], 'colspan="2"' )
+                      ) . "\n" .
+            '</table>';
+    } else {
+    echo '</select></td></tr>' . "\n" . 
 
-  html_tag( 'tr', "\n" .
-      html_tag( 'td', _("First name") . ':', 'right', $color[4], 'width="50"' ) .
-      html_tag( 'td', '<input name="' . $name . '[firstname]" size="45" value="">', 'left', $color[4] )
-  ) . "\n" .
-  html_tag( 'tr', "\n" .
-      html_tag( 'td', _("Last name") . ':', 'right', $color[4], 'width="50"' ) .
-      html_tag( 'td', '<input name="' . $name . '[lastname]" size="45" value="">', 'left', $color[4] )
-  ) . "\n" .
-  html_tag( 'tr', "\n" .
-      html_tag( 'td', _("Additional info") . ':', 'right', $color[4], 'width="50"' ) .
-      html_tag( 'td', '<input name="' . $name . '[label]" size="45" value="">', 'left', $color[4] )
-  ) . "\n" .
-  html_tag( 'tr', "\n" .
-      html_tag( 'td',
-          '<input type="submit" name="' . $name . '[SUBMIT]" size="45" value="'. _("Add address") .'">' ,
-      'center', $color[4], 'colspan="2"' )
-  ) . "\n" .
-  '</table>';
+    html_tag( 'tr', "\n" .
+        html_tag( 'td', _("First name") . ':', 'right', $color[4], 'width="50"' ) .
+        html_tag( 'td', '<input name="' . $name . '[firstname]" size="45" value="">', 'left', $color[4] )
+    ) . "\n" .
+    html_tag( 'tr', "\n" .
+        html_tag( 'td', _("Last name") . ':', 'right', $color[4], 'width="50"' ) .
+        html_tag( 'td', '<input name="' . $name . '[lastname]" size="45" value="">', 'left', $color[4] )
+    ) . "\n" .
+    html_tag( 'tr', "\n" .
+        html_tag( 'td', _("Additional info") . ':', 'right', $color[4], 'width="50"' ) .
+        html_tag( 'td', '<input name="' . $name . '[label]" size="45" value="">', 'left', $color[4] )
+    ) . "\n" .
+    html_tag( 'tr', "\n" .
+        html_tag( 'td',
+            '<input type="submit" name="' . $name . '[SUBMIT]" size="45" value="'. _("Add address") .'">' ,
+        'center', $color[4], 'colspan="2"' )
+    ) . "\n" .
+    '</table>';
+    }
 ?>
 </form></body>
 </html>