6 * Copyright (c) 1999-2004 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
9 * Address Take -- steals addresses from incoming email messages. Searches
10 * the To, Cc, From and Reply-To headers.
14 * @subpackage abook_take
18 * Path for SquirrelMail required files.
20 define('SM_PATH','../../');
22 /* SquirrelMail required files. */
23 require_once(SM_PATH
. 'include/validate.php');
24 require_once(SM_PATH
. 'functions/strings.php');
25 require_once(SM_PATH
. 'config/config.php');
26 require_once(SM_PATH
. 'functions/i18n.php');
27 require_once(SM_PATH
. 'functions/page_header.php');
28 require_once(SM_PATH
. 'functions/addressbook.php');
29 require_once(SM_PATH
. 'include/load_prefs.php');
30 require_once(SM_PATH
. 'functions/html.php');
31 require_once(SM_PATH
. 'functions/forms.php');
33 displayPageHeader($color, 'None');
36 sqgetGlobalVar('email', $email, SQ_POST
);
38 $abook_take_verify = getPref($data_dir, $username, 'abook_take_verify');
40 $abook = addressbook_init(false, true);
44 foreach ($email as $Val) {
45 if (valid_email($Val, $abook_take_verify)) {
48 $addrs[$Val] = 'FAIL - ' . $Val;
52 echo addForm(SM_PATH
. 'src/addressbook.php', 'POST', 'f_add') . "\n" .
55 html_tag( 'th', sprintf(_("Add to %s"), $abook->localbackendname
), 'center', $color[0] )
57 'center', '', 'width="100%"' ) . "\n" .
59 html_tag( 'table', '', 'center', '', 'border="0" cellpadding="1" cols="2" width="90%"' ) . "\n" .
60 html_tag( 'tr', "\n" .
61 html_tag( 'td', _("Nickname") . ':', 'right', $color[4], 'width="50"' ) . "\n" .
62 html_tag( 'td', addInput($name . '[nickname]', '', 15) .
63 ' <small>' . _("Must be unique") . '</small>',
66 html_tag( 'tr' ) . "\n" .
67 html_tag( 'td', _("E-mail address") . ':', 'right', $color[4], 'width="50"' ) . "\n" .
68 html_tag( 'td', '', 'left', $color[4] ) . "\n" .
69 addSelect($name . '[email]', $addrs, null, true) .
72 if ($squirrelmail_language == 'ja_JP') {
73 echo html_tag( 'tr', "\n" .
74 html_tag( 'td', _("Last name") . ':', 'right', $color[4], 'width="50"' ) .
75 html_tag( 'td', addInput($name . '[lastname]', '', 45), 'left', $color[4] )
77 html_tag( 'tr', "\n" .
78 html_tag( 'td', _("First name") . ':', 'right', $color[4], 'width="50"' ) .
79 html_tag( 'td', addInput($name . '[firstname]', '', 45), 'left', $color[4] )
82 echo html_tag( 'tr', "\n" .
83 html_tag( 'td', _("First name") . ':', 'right', $color[4], 'width="50"' ) .
84 html_tag( 'td', addInput($name . '[firstname]', '', 45), 'left', $color[4] )
86 html_tag( 'tr', "\n" .
87 html_tag( 'td', _("Last name") . ':', 'right', $color[4], 'width="50"' ) .
88 html_tag( 'td', addInput($name . '[lastname]', '', 45), 'left', $color[4] )
91 echo html_tag( 'tr', "\n" .
92 html_tag( 'td', _("Additional info") . ':', 'right', $color[4], 'width="50"' ) .
93 html_tag( 'td', addInput($name . '[label]', '', 45), 'left', $color[4] )
95 html_tag( 'tr', "\n" .
97 addSubmit(_("Add address"), $name . '[SUBMIT]'),
98 'center', $color[4], 'colspan="2"' )