Added support for IMAP & SMTP use of TLS and fancy auth mechanisms to administrator...
[squirrelmail.git] / plugins / abook_take / take.php
1 <?php
2
3 /**
4 * take.php
5 *
6 * Adds a "taken" address to the address book. Takes addresses from
7 * incoming mail -- the body, To, From, Cc, or Reply-To.
8 */
9
10 /* Path for SquirrelMail required files. */
11 define('SM_PATH','../../');
12
13 /* SquirrelMail required files. */
14 require_once(SM_PATH . 'functions/strings.php');
15 require_once(SM_PATH . 'config/config.php');
16 require_once(SM_PATH . 'include/validate.php');
17 require_once(SM_PATH . 'functions/i18n.php');
18 require_once(SM_PATH . 'functions/page_header.php');
19 require_once(SM_PATH . 'functions/addressbook.php');
20 require_once(SM_PATH . 'include/load_prefs.php');
21 require_once(SM_PATH . 'functions/html.php');
22
23 displayPageHeader($color, 'None');
24
25 $abook_take_verify = getPref($data_dir, $username, 'abook_take_verify');
26
27 $abook = addressbook_init(false, true);
28 $name = 'addaddr';
29 echo '<form action="../../src/addressbook.php" name="f_add" method="post">' ."\n" .
30 html_tag( 'table',
31 html_tag( 'tr',
32 html_tag( 'th', sprintf(_("Add to %s"), $abook->localbackendname), 'center', $color[0] )
33 ) ,
34 'center', '', 'width="100%" cols="1"' ) .
35
36 html_tag( 'table', '', 'center', '', 'border="0" cellpadding="1" cols="2" width="90%"' ) . "\n" .
37 html_tag( 'tr', "\n" .
38 html_tag( 'td', _("Nickname") . ':', 'right', $color[4], 'width="50"' ) . "\n" .
39 html_tag( 'td', '<input name="' . $name . '[nickname]" size="15" value="">' .
40 '&nbsp;<small>' . _("Must be unique") . '</small>',
41 'left', $color[4] )
42 ) . "\n" .
43 html_tag( 'tr' ) . "\n" .
44 html_tag( 'td', _("E-mail address") . ':', 'right', $color[4], 'width="50"' ) . "\n" .
45 html_tag( 'td', '', 'left', $color[4] ) .
46 '<select name="' . $name . "[email]\">\n";
47 foreach ($email as $Val)
48 {
49 if (valid_email($Val, $abook_take_verify))
50 {
51 echo '<option value="' . htmlspecialchars($Val) .
52 '">' . htmlspecialchars($Val) . "</option>\n";
53 }
54 else
55 {
56 echo '<option value="' . htmlspecialchars($Val) .
57 '">FAIL - ' . htmlspecialchars($Val) . "</option>\n";
58 }
59 }
60 echo '</select></td></tr>' . "\n" .
61
62 html_tag( 'tr', "\n" .
63 html_tag( 'td', _("First name") . ':', 'right', $color[4], 'width="50"' ) .
64 html_tag( 'td', '<input name="' . $name . '[firstname]" size="45" value="">', 'left', $color[4] )
65 ) . "\n" .
66 html_tag( 'tr', "\n" .
67 html_tag( 'td', _("Last name") . ':', 'right', $color[4], 'width="50"' ) .
68 html_tag( 'td', '<input name="' . $name . '[lastname]" size="45" value="">', 'left', $color[4] )
69 ) . "\n" .
70 html_tag( 'tr', "\n" .
71 html_tag( 'td', _("Additional info") . ':', 'right', $color[4], 'width="50"' ) .
72 html_tag( 'td', '<input name="' . $name . '[label]" size="45" value="">', 'left', $color[4] )
73 ) . "\n" .
74 html_tag( 'tr', "\n" .
75 html_tag( 'td',
76 '<input type="submit" name="' . $name . '[SUBMIT]" size="45" value="'. _("Add address") .'">' ,
77 'center', $color[4], 'colspan="2"' )
78 ) . "\n" .
79 '</table>';
80 ?>
81 </form></body>
82 </html>