8bf7eae5fc83ba050cd17b8ba77afcba523a4c25
[squirrelmail.git] / plugins / abook_take / take.php
1 <?php
2 /**
3 * take.php
4 *
5 * Copyright (c) 1999-2005 The SquirrelMail Project Team
6 * Licensed under the GNU GPL. For full terms see the file COPYING.
7 *
8 * Address Take -- steals addresses from incoming email messages. Searches
9 * the To, Cc, From and Reply-To headers.
10 *
11 * @version $Id$
12 * @package plugins
13 * @subpackage abook_take
14 */
15
16 /**
17 * Path for SquirrelMail required files.
18 * @ignore */
19 define('SM_PATH','../../');
20
21 /* SquirrelMail required files. */
22 require_once(SM_PATH . 'include/validate.php');
23 require_once(SM_PATH . 'functions/addressbook.php');
24
25 displayPageHeader($color, 'None');
26
27 /* input form data */
28 sqgetGlobalVar('email', $email, SQ_POST);
29
30 $abook_take_verify = getPref($data_dir, $username, 'abook_take_verify');
31
32 $abook = addressbook_init(false, true);
33
34 $addrs = array();
35 foreach ($email as $Val) {
36 if (valid_email($Val, $abook_take_verify)) {
37 $addrs[$Val] = $Val;
38 } else {
39 $addrs[$Val] = 'FAIL - ' . $Val;
40 }
41 }
42
43 $formdata=array('email'=>$addrs);
44
45 abook_create_form(SM_PATH . 'src/addressbook.php','addaddr',_("Add to address book"),_("Add address"),$formdata);
46 echo '</form>';
47 ?>
48 </body></html>