| 1 |
weitzman |
1.1 |
<?php
|
| 2 |
|
|
|
| 3 |
weitzman |
1.3 |
function mailalias_user($type, $edit, $user) {
|
| 4 |
weitzman |
1.1 |
switch ($type) {
|
| 5 |
weitzman |
1.7 |
case "form":
|
| 6 |
weitzman |
1.1 |
// when user tries to edit his own data $output =
|
| 7 |
weitzman |
1.2 |
$output = form_textfield(t("Email aliases"), "mailalias", $user->mailalias, 70, 255, t("Add any additional email addresses, separated by commas. We use these to identify the author of email submissions. These email addresses are private and are not shared with other users."));
|
| 8 |
weitzman |
1.7 |
return array (t('Personal information') => $output);
|
| 9 |
weitzman |
1.6 |
case "validate":
|
| 10 |
weitzman |
1.1 |
// validate user data editing. TODO
|
| 11 |
|
|
$mailalias = strtr($edit["mailalias"], array (" " => "")); // strip spaces
|
| 12 |
|
|
$mailsarr = explode(",", $mailalias);
|
| 13 |
|
|
foreach ($mailsarr as $mail) {
|
| 14 |
mathias |
1.4 |
if ($mail != null && $error = user_validate_mail($mail)) {
|
| 15 |
weitzman |
1.1 |
return $error;
|
| 16 |
|
|
}
|
| 17 |
|
|
}
|
| 18 |
|
|
return array ("mailalias" => $mailalias);
|
| 19 |
|
|
}
|
| 20 |
|
|
}
|
| 21 |
|
|
|
| 22 |
weitzman |
1.3 |
function mailalias_help($section) {
|
| 23 |
|
|
if ($section == "admin/system/modules#description") {
|
| 24 |
|
|
return t("A user may associate additional email addresses with his account.");
|
| 25 |
|
|
}
|
| 26 |
weitzman |
1.1 |
}
|
| 27 |
|
|
|
| 28 |
mathias |
1.4 |
?>
|