6 * Copyright (c) 1999-2003 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.
15 /* Path for SquirrelMail required files. */
16 define('SM_PATH','../../');
18 /* SquirrelMail required files. */
19 require_once(SM_PATH
. 'functions/strings.php');
20 require_once(SM_PATH
. 'config/config.php');
21 require_once(SM_PATH
. 'include/validate.php');
22 require_once(SM_PATH
. 'functions/i18n.php');
23 require_once(SM_PATH
. 'functions/page_header.php');
24 require_once(SM_PATH
. 'functions/addressbook.php');
25 require_once(SM_PATH
. 'include/load_prefs.php');
26 require_once(SM_PATH
. 'functions/html.php');
28 displayPageHeader($color, 'None');
31 sqgetGlobalVar('email', $email, SQ_POST
);
33 $abook_take_verify = getPref($data_dir, $username, 'abook_take_verify');
35 $abook = addressbook_init(false, true);
38 echo '<form action="../../src/addressbook.php" name="f_add" method="post">' ."\n" .
41 html_tag( 'th', sprintf(_("Add to %s"), $abook->localbackendname
), 'center', $color[0] )
43 'center', '', 'width="100%" cols="1"' ) .
45 html_tag( 'table', '', 'center', '', 'border="0" cellpadding="1" cols="2" width="90%"' ) . "\n" .
46 html_tag( 'tr', "\n" .
47 html_tag( 'td', _("Nickname") . ':', 'right', $color[4], 'width="50"' ) . "\n" .
48 html_tag( 'td', '<input name="' . $name . '[nickname]" size="15" value="">' .
49 ' <small>' . _("Must be unique") . '</small>',
52 html_tag( 'tr' ) . "\n" .
53 html_tag( 'td', _("E-mail address") . ':', 'right', $color[4], 'width="50"' ) . "\n" .
54 html_tag( 'td', '', 'left', $color[4] ) .
55 '<select name="' . $name . "[email]\">\n";
57 foreach ($email as $Val)
59 if (valid_email($Val, $abook_take_verify))
61 echo '<option value="' . htmlspecialchars($Val) .
62 '">' . htmlspecialchars($Val) . "</option>\n";
64 echo '<option value="' . htmlspecialchars($Val) .
65 '">FAIL - ' . htmlspecialchars($Val) . "</option>\n";
68 echo '</select></td></tr>' . "\n" .
70 html_tag( 'tr', "\n" .
71 html_tag( 'td', _("First name") . ':', 'right', $color[4], 'width="50"' ) .
72 html_tag( 'td', '<input name="' . $name . '[firstname]" size="45" value="">', 'left', $color[4] )
74 html_tag( 'tr', "\n" .
75 html_tag( 'td', _("Last name") . ':', 'right', $color[4], 'width="50"' ) .
76 html_tag( 'td', '<input name="' . $name . '[lastname]" size="45" value="">', 'left', $color[4] )
78 html_tag( 'tr', "\n" .
79 html_tag( 'td', _("Additional info") . ':', 'right', $color[4], 'width="50"' ) .
80 html_tag( 'td', '<input name="' . $name . '[label]" size="45" value="">', 'left', $color[4] )
82 html_tag( 'tr', "\n" .
84 '<input type="submit" name="' . $name . '[SUBMIT]" size="45" value="'. _("Add address") .'">' ,
85 'center', $color[4], 'colspan="2"' )