removed local directory name used for testing.
[squirrelmail.git] / plugins / abook_take / take.php
CommitLineData
e8b140ab 1<?php
b755a6b1 2/**
3 * take.php
4 *
6c84ba1e 5 * Copyright (c) 1999-2005 The SquirrelMail Project Team
b755a6b1 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 *
4f51df66 11 * @version $Id$
ea5f4b8e 12 * @package plugins
13 * @subpackage abook_take
b755a6b1 14 */
1bf86d6f 15
ea5f4b8e 16/**
17 * Path for SquirrelMail required files.
18 * @ignore */
08185f2a 19define('SM_PATH','../../');
e8b140ab 20
08185f2a 21/* SquirrelMail required files. */
41ec18a3 22require_once(SM_PATH . 'include/validate.php');
08185f2a 23require_once(SM_PATH . 'functions/addressbook.php');
1bf86d6f 24
08185f2a 25displayPageHeader($color, 'None');
b755a6b1 26
27/* input form data */
28sqgetGlobalVar('email', $email, SQ_POST);
29
08185f2a 30$abook_take_verify = getPref($data_dir, $username, 'abook_take_verify');
4cf43843 31
32$abook = addressbook_init(false, true);
b755a6b1 33
1bf86d6f 34$addrs = array();
35foreach ($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
831c3204 43$formdata=array('email'=>$addrs);
b755a6b1 44
831c3204 45abook_create_form(SM_PATH . 'src/addressbook.php','addaddr',_("Add to address book"),_("Add address"),$formdata);
46echo '</form>';
e8b140ab 47?>
91e0dccc 48</body></html>