-$idents = getPref($data_dir, $username, 'identities');
-if ($idents != '' && $idents > 1) {
- echo ' <select name="identity">' . "\n" .
- '<option value="default">' . $defaultmail;
- for ($i = 1; $i < $idents; $i ++) {
- echo '<option value="' . $i . '"';
- if (isset($identity) && $identity == $i) {
- echo ' selected';
- }
- echo '>' . htmlspecialchars(getPref($data_dir, $username,
- 'full_name' . $i));
- $em = getPref($data_dir, $username, 'email_address' . $i);
- if ($em != '') {
- echo htmlspecialchars(' <' . $em . '>') . "\n";
- }
+if (count($idents) > 1) {
+ echo '<select name="identity">';
+ foreach($idents as $nr=>$data) {
+ echo '<option value="' . $nr . '">' .
+ htmlspecialchars(
+ $data['full_name'].' <'.
+ $data['email_address'] . ">\n");