5 ** Adds a "taken" address to the address book. Takes addresses from
6 ** incoming mail -- the body, To, From, Cc, or Reply-To.
10 require_once('../src/validate.php');
11 require_once("../functions/strings.php");
12 require_once("../config/config.php");
13 require_once("../functions/i18n.php");
14 require_once("../functions/page_header.php");
15 require_once("../functions/addressbook.php");
16 require_once("../src/load_prefs.php");
18 displayPageHeader($color, "None");
20 $abook_take_verify = getPref($data_dir, $username, 'abook_take_verify');
23 <FORM ACTION
="../../src/addressbook.php" NAME
=f_add METHOD
="POST">
24 <TABLE WIDTH
=100% COLS
=1 ALIGN
=CENTER
>
25 <TR
><TH BGCOLOR
="<?PHP
27 ?>" ALIGN
=CENTER
><?PHP
28 // open address book, trash errors, skip LDAP
29 $abook = addressbook_init(false, true);
30 printf(_("Add to %s"), $abook->localbackendname
);
33 <TABLE BORDER
=0 CELLPADDING
=1 COLS
=2 WIDTH
="90%" ALIGN
=center
>
37 printf("<TR><TD WIDTH=50 BGCOLOR=\"$color[4]\" ALIGN=RIGHT>%s:</TD>",
39 printf("<TD BGCOLOR=\"%s\" ALIGN=left>".
40 "<INPUT NAME=\"%s[nickname]\" SIZE=15 VALUE=\"\">".
41 " <SMALL>%s</SMALL></TD></TR>\n",
42 $color[4], $name, _("Must be unique"));
43 printf("<TR><TD WIDTH=50 BGCOLOR=\"$color[4]\" ALIGN=RIGHT>%s:</TD>",
46 echo "<TD BGCOLOR=\"$color[4]\" ALIGN=left>\n";
47 echo '<select name="' . $name . "[email]\">\n";
48 foreach ($email as $Val)
50 if (valid_email($Val, $abook_take_verify))
52 echo '<option value="' . htmlspecialchars($Val) .
53 '">' . htmlspecialchars($Val) . "</option>\n";
57 echo '<option value="' . htmlspecialchars($Val) .
58 '">FAIL - ' . htmlspecialchars($Val) . "</option>\n";
63 printf("<TR><TD WIDTH=50 BGCOLOR=\"$color[4]\" ALIGN=RIGHT>%s:</TD>",
65 printf("<TD BGCOLOR=\"%s\" ALIGN=left>".
66 "<INPUT NAME=\"%s[firstname]\" SIZE=45 VALUE=\"\"></TD></TR>\n",
68 printf("<TR><TD WIDTH=50 BGCOLOR=\"$color[4]\" ALIGN=RIGHT>%s:</TD>",
70 printf("<TD BGCOLOR=\"%s\" ALIGN=left>".
71 "<INPUT NAME=\"%s[lastname]\" SIZE=45 VALUE=\"\"></TD></TR>\n",
73 printf("<TR><TD WIDTH=50 BGCOLOR=\"$color[4]\" ALIGN=RIGHT>%s:</TD>",
74 _("Additional info"));
75 printf("<TD BGCOLOR=\"%s\" ALIGN=left>".
76 "<INPUT NAME=\"%s[label]\" SIZE=45 VALUE=\"\"></TD></TR>\n",
79 printf("<TR><TD COLSPAN=2 BGCOLOR=\"%s\" ALIGN=center>\n".
80 "<INPUT TYPE=submit NAME=\"%s[SUBMIT]\" VALUE=\"%s\"></TD></TR>\n",
81 $color[4], $name, _("Add address"));