take.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * take.php
  4. *
  5. * Address Take -- steals addresses from incoming email messages. Searches
  6. * the To, Cc, From and Reply-To headers.
  7. *
  8. * @copyright &copy; 1999-2007 The SquirrelMail Project Team
  9. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  10. * @version $Id$
  11. * @package plugins
  12. * @subpackage abook_take
  13. */
  14. /**
  15. * Include the SquirrelMail initialization file.
  16. */
  17. require('../../include/init.php');
  18. /* SquirrelMail required files. */
  19. require(SM_PATH . 'functions/forms.php');
  20. require(SM_PATH . 'functions/addressbook.php');
  21. displayPageHeader($color, 'None');
  22. /* input form data */
  23. sqgetGlobalVar('email', $email, SQ_POST);
  24. $abook_take_verify = getPref($data_dir, $username, 'abook_take_verify');
  25. $abook = addressbook_init(false, true);
  26. $addrs = array();
  27. foreach ($email as $Val) {
  28. if (valid_email($Val, $abook_take_verify)) {
  29. $addrs[$Val] = $Val;
  30. } else {
  31. $addrs[$Val] = 'FAIL - ' . $Val;
  32. }
  33. }
  34. $formdata=array('email'=>$addrs);
  35. abook_create_form(SM_PATH . 'src/addressbook.php','addaddr',_("Add to address book"),_("Add address"),$formdata);
  36. echo '</form>';
  37. ?>
  38. </body></html>