Source for file take.php

Documentation is available at take.php

  1. <?php
  2.  
  3. /**
  4.  * take.php
  5.  *
  6.  * Copyright (c) 1999-2006 The SquirrelMail Project Team
  7.  * Licensed under the GNU GPL. For full terms see the file COPYING.
  8.  *
  9.  * Address Take -- steals addresses from incoming email messages. Searches
  10.  * the To, Cc, From and Reply-To headers.
  11.  *
  12.  * $Id: take.php,v 1.8.2.5 2006/02/03 22:27:51 jervfors Exp $
  13.  */
  14.    
  15. /* Path for SquirrelMail required files. */
  16. define('SM_PATH','../../');
  17.  
  18. /* SquirrelMail required files. */
  19. require_once(SM_PATH 'include/validate.php');
  20. require_once(SM_PATH 'functions/addressbook.php');
  21.    
  22. displayPageHeader($color'None');
  23.  
  24. /* input form data */
  25. sqgetGlobalVar('email'$emailSQ_POST);
  26.  
  27. $abook_take_verify getPref($data_dir$username'abook_take_verify');
  28.  
  29. $abook addressbook_init(falsetrue);
  30. $name 'addaddr';
  31.  
  32. echo '<form action="../../src/addressbook.php" name="f_add" method="post">' ."\n" .
  33.     html_tag'table',
  34.         html_tag'tr',
  35.             html_tag'th'sprintf(_("Add to %s")$abook->localbackendname)'center'$color[0)
  36.         ,
  37.     'center''''width="100%" cols="1"' .
  38.  
  39.     html_tag'table''''center''''border="0" cellpadding="1" cols="2" width="90%"' "\n" .
  40.             html_tag'tr'"\n" .
  41.                 html_tag'td'_("Nickname"':''right'$color[4]'width="50"' "\n" .
  42.                 html_tag'td''<input name="' $name '[nickname]" size="15" value="">' .
  43.                     '&nbsp;<small>' _("Must be unique"'</small>',
  44.                 'left'$color[4)
  45.             "\n" .
  46.             html_tag'tr' "\n" .
  47.             html_tag'td'_("E-mail address"':''right'$color[4]'width="50"' "\n" .
  48.             html_tag'td''''left'$color[4.
  49.                 '<select name="' $name "[email]\">\n";
  50.  
  51.     foreach ($email as $Val)
  52.     {
  53.         if (valid_email($Val$abook_take_verify))
  54.         {
  55.             echo '<option value="' htmlspecialchars($Val.
  56.                 '">' htmlspecialchars($Val"</option>\n";
  57.         else {
  58.             echo '<option value="' htmlspecialchars($Val.
  59.           '">FAIL - ' htmlspecialchars($Val"</option>\n";
  60.         }
  61.     }
  62.     if ($squirrelmail_language == 'ja_JP'{
  63.         echo '</select></td></tr>' "\n" 
  64.             
  65.             html_tag'tr'"\n" .
  66.                       html_tag'td'_("Last name"':''right'$color[4]'width="50"' .
  67.                       html_tag'td''<input name="' $name '[lastname]" size="45" value="">''left'$color[4)
  68.                       "\n" .
  69.             html_tag'tr'"\n" .
  70.                       html_tag'td'_("First name"':''right'$color[4]'width="50"' .
  71.                       html_tag'td''<input name="' $name '[firstname]" size="45" value="">''left'$color[4)
  72.                       "\n" .
  73.             html_tag'tr'"\n" .
  74.                       html_tag'td'_("Additional info"':''right'$color[4]'width="50"' .
  75.                       html_tag'td''<input name="' $name '[label]" size="45" value="">''left'$color[4)
  76.                       "\n" .
  77.             html_tag'tr'"\n" .
  78.                       html_tag'td',
  79.                                 '<input type="submit" name="' $name '[SUBMIT]" size="45" value="'_("Add address".'">' ,
  80.                                 'center'$color[4]'colspan="2"' )
  81.                       "\n" .
  82.             '</table>';
  83.     else {
  84.     echo '</select></td></tr>' "\n" 
  85.  
  86.     html_tag'tr'"\n" .
  87.         html_tag'td'_("First name"':''right'$color[4]'width="50"' .
  88.         html_tag'td''<input name="' $name '[firstname]" size="45" value="">''left'$color[4)
  89.     "\n" .
  90.     html_tag'tr'"\n" .
  91.         html_tag'td'_("Last name"':''right'$color[4]'width="50"' .
  92.         html_tag'td''<input name="' $name '[lastname]" size="45" value="">''left'$color[4)
  93.     "\n" .
  94.     html_tag'tr'"\n" .
  95.         html_tag'td'_("Additional info"':''right'$color[4]'width="50"' .
  96.         html_tag'td''<input name="' $name '[label]" size="45" value="">''left'$color[4)
  97.     "\n" .
  98.     html_tag'tr'"\n" .
  99.         html_tag'td',
  100.             '<input type="submit" name="' $name '[SUBMIT]" size="45" value="'_("Add address".'">' ,
  101.         'center'$color[4]'colspan="2"' )
  102.     "\n" .
  103.     '</table>';
  104.     }
  105. ?>
  106. </form></body>
  107. </html>

Documentation generated on Sat, 07 Oct 2006 16:33:54 +0300 by phpDocumentor 1.3.0RC6