61fb48116fc93c5846984464e5054d41fb36a3dc
3 ** options_identities.php
8 include('../src/validate.php');
9 include('../functions/page_header.php');
10 include('../functions/display_messages.php');
11 include('../src/load_prefs.php');
15 header('Location: options_personal.php');
19 displayPageHeader($color, 'None');
21 if (CheckAndDoDefault() ||
CheckAndDoPromote()) {
27 LoadInfo($full_name, $email_address, $reply_to, '');
31 <table width
=95% align
=center border
=0 cellpadding
=2 cellspacing
=0>
33 <th bgcolor
="<?php echo $color[0] ?>" align
=center
>
34 <?php
echo _("Options") . " - " . _("Advanced Identities"); ?
>
39 <form name
=f action
="options_identities.php" method
=post
>
40 <p align
=center
><input type
=submit name
=return value
="<?PHP
41 echo _("Save
and return to the Personal Options
"); ?>"><br
><?PHP
42 $num = getPref($data_dir, $username, 'identities');
43 echo htmlspecialchars($num) . ' ';
45 echo _("Identities Defined");
47 echo _("Identity Defined");
49 <table width
=100% cellpadding
=0 cellspacing
=2 border
=0>
50 <tr bgcolor
="<?PHP echo $color[9] ?>">
51 <th colspan
=2 align
=center
><?PHP
echo _("Default Identity") ?
></th
>
55 ShowTableInfo($full_name, $email_address, $reply_to, '');
58 while (LoadInfo($full_name, $email_address, $reply_to, $num))
61 <tr bgcolor
="<?PHP echo $color[9] ?>">
62 <th colspan
=2 align
=center
><?PHP
printf (_("Alternate Identity %d"),
66 ShowTableInfo($full_name, $email_address, $reply_to, $num);
71 <tr bgcolor
="<?PHP echo $color[9] ?>">
72 <th colspan
=2 align
=center
><?PHP
echo _("Add a New Identity") ?
></th
>
76 ShowTableInfo('', '', '', $num);
83 function SaveUpdateFunction()
85 global $username, $data_dir, $full_name, $email_address, $reply_to;
89 $name = 'form_for_' . $i;
93 $name = 'delete_' . $i;
100 $name = 'full_name' . $i;
104 setPref($data_dir, $username, 'full_name' . $fakeI, $
$name);
106 $name = 'email_address' . $i;
110 setPref($data_dir, $username, 'email_address' . $fakeI, $
$name);
112 $name = 'reply_to' . $i;
116 setPref($data_dir, $username, 'reply_to' . $fakeI, $
$name);
124 $name = 'form_for_' . $i;
128 setPref($data_dir, $username, 'identities', $fakeI);
132 removePref($data_dir, $username, 'full_name' . $fakeI);
133 removePref($data_dir, $username, 'email_address' . $fakeI);
134 removePref($data_dir, $username, 'reply_to' . $fakeI);
138 setPref($data_dir, $username, 'full_name', $full_name);
139 setPref($data_dir, $username, 'email_address', $email_address);
140 setPref($data_dir, $username, 'reply_to', $reply_to);
143 function CheckAndDoDefault()
145 global $username, $data_dir, $full_name, $email_address, $reply_to;
148 $name = 'form_for_' . $i;
150 while (isset($
$name))
152 $name = 'make_default_' . $i;
155 global $full_name, $email_address, $reply_to;
157 $name = 'full_name' . $i;
163 $name = 'email_address' . $i;
165 $temp = $email_address;
166 $email_address = $
$name;
169 $name = 'reply_to' . $i;
179 $name = 'form_for_' . $i;
185 function CheckAndDoPromote()
187 global $username, $data_dir, $full_name, $email_address, $reply_to;
190 $name = 'form_for_' . $i;
192 while (isset($
$name))
194 $name = 'promote_' . $i;
196 if (isset($
$name) && $i > 1) {
197 $nameA = 'full_name' . $i;
198 $nameB = 'full_name' . ($i - 1);
199 global $
$nameA, $
$nameB;
204 $nameA = 'email_address' . $i;
205 $nameB = 'email_address' . ($i - 1);
206 global $
$nameA, $
$nameB;
211 $nameA = 'email_address' . $i;
212 $nameB = 'email_address' . ($i - 1);
213 global $
$nameA, $
$nameB;
222 $name = 'form_for_' . $i;
228 function LoadInfo(&$n, &$e, &$r, $post)
230 global $username, $data_dir;
232 $n = getPref($data_dir, $username, 'full_name' . $post);
233 $e = getPref($data_dir, $username, 'email_address' . $post);
234 $r = getPref($data_dir, $username, 'reply_to' . $post);
236 if ($n != '' ||
$e != '' ||
$r != '')
240 function ShowTableInfo($full_name, $email_address, $reply_to, $post)
247 $OtherBG = ' bgcolor="' . $color[10] . '"';
249 if ($full_name == '' && $email_address == '' && $reply_to == '')
250 $isEmptySection = true;
252 $isEmptySection = false;
255 <tr
<?PHP
echo $OtherBG ?
>>
256 <td align
=right nowrap
>
257 <?php
echo _("Full Name"); ?
>:
260 <input size
=50 type
=text value
="<?php echo htmlspecialchars($full_name)
261 ?>" name
="full_name<?PHP echo $post ?>">
264 <tr
<?PHP
echo $OtherBG ?
>>
265 <td align
=right nowrap
>
266 <?php
echo _("E-Mail Address"); ?
>:
269 <input size
=50 type
=text value
="<?php echo htmlspecialchars($email_address)
270 ?>" name
="email_address<?PHP echo $post ?>">
273 <tr
<?PHP
echo $OtherBG ?
>>
274 <td align
=right nowrap
>
275 <?php
echo _("Reply To"); ?
>:
278 <input size
=50 type
=text value
="<?php echo htmlspecialchars($reply_to)
279 ?>" name
="reply_to<?PHP echo $post ?>">
283 if (! $isEmptySection && $post != '') {
287 <?PHP
echo _("Delete") ?
>:
290 <input type
=checkbox name
="delete_<?PHP echo $post ?>"> <?PHP
291 echo _("Delete this identity"); ?
>
298 <td colspan
=2 align
=center
>
299 <input type
=hidden name
="form_for_<?PHP echo $post ?>" value
="1">
300 <input type
=submit name
="update" value
="<?PHP
301 echo _("Save
/ Update
") ?>">
303 if (! $isEmptySection && $post != '') {
305 <input type
=submit name
="make_default_<?PHP echo $post ?>" value
="<?PHP
306 echo _("Make
Default") ?>">
309 if (! $isEmptySection && $post != '' && $post > 1) {
311 <input type
=submit name
="promote_<?PHP echo $post ?>" value
="<?PHP
312 echo _("Move Up
") ?>">