e8b140ab |
1 | <?php |
08185f2a |
2 | |
b755a6b1 |
3 | /** |
4 | * take.php |
5 | * |
6 | * Copyright (c) 1999-2003 The SquirrelMail Project Team |
7 | * Licensed under the GNU GPL. For full terms see the file COPYING. |
8 | * |
9 | * Address Take -- steals addresses from incoming email messages. Searches |
10 | * the To, Cc, From and Reply-To headers. |
11 | * |
12 | * $Id$ |
ea5f4b8e |
13 | * @package plugins |
14 | * @subpackage abook_take |
b755a6b1 |
15 | */ |
e8b140ab |
16 | |
ea5f4b8e |
17 | /** |
18 | * Path for SquirrelMail required files. |
19 | * @ignore */ |
08185f2a |
20 | define('SM_PATH','../../'); |
e8b140ab |
21 | |
08185f2a |
22 | /* SquirrelMail required files. */ |
41ec18a3 |
23 | require_once(SM_PATH . 'include/validate.php'); |
08185f2a |
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'); |
aa7fb30c |
29 | require_once(SM_PATH . 'include/load_prefs.php'); |
08185f2a |
30 | require_once(SM_PATH . 'functions/html.php'); |
31 | |
32 | displayPageHeader($color, 'None'); |
b755a6b1 |
33 | |
34 | /* input form data */ |
35 | sqgetGlobalVar('email', $email, SQ_POST); |
36 | |
08185f2a |
37 | $abook_take_verify = getPref($data_dir, $username, 'abook_take_verify'); |
4cf43843 |
38 | |
39 | $abook = addressbook_init(false, true); |
40 | $name = 'addaddr'; |
b755a6b1 |
41 | |
4cf43843 |
42 | echo '<form action="../../src/addressbook.php" name="f_add" method="post">' ."\n" . |
43 | html_tag( 'table', |
44 | html_tag( 'tr', |
45 | html_tag( 'th', sprintf(_("Add to %s"), $abook->localbackendname), 'center', $color[0] ) |
46 | ) , |
47 | 'center', '', 'width="100%" cols="1"' ) . |
48 | |
49 | html_tag( 'table', '', 'center', '', 'border="0" cellpadding="1" cols="2" width="90%"' ) . "\n" . |
50 | html_tag( 'tr', "\n" . |
51 | html_tag( 'td', _("Nickname") . ':', 'right', $color[4], 'width="50"' ) . "\n" . |
52 | html_tag( 'td', '<input name="' . $name . '[nickname]" size="15" value="">' . |
53 | ' <small>' . _("Must be unique") . '</small>', |
54 | 'left', $color[4] ) |
55 | ) . "\n" . |
56 | html_tag( 'tr' ) . "\n" . |
57 | html_tag( 'td', _("E-mail address") . ':', 'right', $color[4], 'width="50"' ) . "\n" . |
58 | html_tag( 'td', '', 'left', $color[4] ) . |
59 | '<select name="' . $name . "[email]\">\n"; |
b755a6b1 |
60 | |
61 | foreach ($email as $Val) |
62 | { |
63 | if (valid_email($Val, $abook_take_verify)) |
64 | { |
65 | echo '<option value="' . htmlspecialchars($Val) . |
66 | '">' . htmlspecialchars($Val) . "</option>\n"; |
67 | } else { |
68 | echo '<option value="' . htmlspecialchars($Val) . |
d55c0f66 |
69 | '">FAIL - ' . htmlspecialchars($Val) . "</option>\n"; |
b755a6b1 |
70 | } |
71 | } |
e842b215 |
72 | if ($squirrelmail_language == 'ja_JP') { |
73 | echo '</select></td></tr>' . "\n" . |
74 | |
75 | html_tag( 'tr', "\n" . |
76 | html_tag( 'td', _("Last name") . ':', 'right', $color[4], 'width="50"' ) . |
77 | html_tag( 'td', '<input name="' . $name . '[lastname]" size="45" value="">', 'left', $color[4] ) |
78 | ) . "\n" . |
79 | html_tag( 'tr', "\n" . |
80 | html_tag( 'td', _("First name") . ':', 'right', $color[4], 'width="50"' ) . |
81 | html_tag( 'td', '<input name="' . $name . '[firstname]" size="45" value="">', 'left', $color[4] ) |
82 | ) . "\n" . |
83 | html_tag( 'tr', "\n" . |
84 | html_tag( 'td', _("Additional info") . ':', 'right', $color[4], 'width="50"' ) . |
85 | html_tag( 'td', '<input name="' . $name . '[label]" size="45" value="">', 'left', $color[4] ) |
86 | ) . "\n" . |
87 | html_tag( 'tr', "\n" . |
88 | html_tag( 'td', |
89 | '<input type="submit" name="' . $name . '[SUBMIT]" size="45" value="'. _("Add address") .'">' , |
90 | 'center', $color[4], 'colspan="2"' ) |
91 | ) . "\n" . |
92 | '</table>'; |
93 | } else { |
b755a6b1 |
94 | echo '</select></td></tr>' . "\n" . |
e8b140ab |
95 | |
b755a6b1 |
96 | html_tag( 'tr', "\n" . |
97 | html_tag( 'td', _("First name") . ':', 'right', $color[4], 'width="50"' ) . |
98 | html_tag( 'td', '<input name="' . $name . '[firstname]" size="45" value="">', 'left', $color[4] ) |
99 | ) . "\n" . |
100 | html_tag( 'tr', "\n" . |
101 | html_tag( 'td', _("Last name") . ':', 'right', $color[4], 'width="50"' ) . |
102 | html_tag( 'td', '<input name="' . $name . '[lastname]" size="45" value="">', 'left', $color[4] ) |
103 | ) . "\n" . |
104 | html_tag( 'tr', "\n" . |
105 | html_tag( 'td', _("Additional info") . ':', 'right', $color[4], 'width="50"' ) . |
106 | html_tag( 'td', '<input name="' . $name . '[label]" size="45" value="">', 'left', $color[4] ) |
107 | ) . "\n" . |
108 | html_tag( 'tr', "\n" . |
109 | html_tag( 'td', |
110 | '<input type="submit" name="' . $name . '[SUBMIT]" size="45" value="'. _("Add address") .'">' , |
111 | 'center', $color[4], 'colspan="2"' ) |
112 | ) . "\n" . |
113 | '</table>'; |
e842b215 |
114 | } |
e8b140ab |
115 | ?> |
dcc1cc82 |
116 | </form></body> |
117 | </html> |