| 1 |
weitzman |
1.1 |
<?php
|
| 2 |
webchick |
1.10 |
// $Id: mailalias.module,v 1.9 2004/10/01 21:51:48 ankur Exp $
|
| 3 |
weitzman |
1.1 |
|
| 4 |
ankur |
1.9 |
function mailalias_user($type, &$edit, &$user, $category = NULL) {
|
| 5 |
|
|
if ($type == 'form' && $category == 'account') {
|
| 6 |
|
|
// when user tries to edit his own data $output =
|
| 7 |
|
|
$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 |
|
|
return array(array('title' => t('Personal information'), 'data' => $output, 'weight' => 2));
|
| 9 |
|
|
}
|
| 10 |
|
|
else if ($type == 'validate' && $category == 'account') {
|
| 11 |
|
|
$mailalias = strtr($edit["mailalias"], array (" " => "")); // strip spaces
|
| 12 |
|
|
$mailsarr = explode(",", $mailalias);
|
| 13 |
|
|
foreach ($mailsarr as $mail) {
|
| 14 |
|
|
if ($mail != null && $error = user_validate_mail($mail)) {
|
| 15 |
|
|
form_set_error(t('Mail Alias'), $error);
|
| 16 |
weitzman |
1.1 |
}
|
| 17 |
ankur |
1.9 |
}
|
| 18 |
|
|
return $edit;
|
| 19 |
weitzman |
1.1 |
}
|
| 20 |
|
|
}
|
| 21 |
|
|
|
| 22 |
webchick |
1.10 |
/**
|
| 23 |
|
|
* Implementation of hook_help().
|
| 24 |
|
|
*/
|
| 25 |
weitzman |
1.3 |
function mailalias_help($section) {
|
| 26 |
webchick |
1.10 |
switch ($section) {
|
| 27 |
|
|
case 'admin/help#mailalias':
|
| 28 |
|
|
$output = '<p>'. t('The mail alias module associates additional e-mail aliases to user accounts. The mailhandler module uses these email aliases to authenticate incoming e-mail with your account. This is useful because many users have multiple email accounts and administrators want to aggregate their content submitted by e-mail to the single user account.') .'</p>';
|
| 29 |
|
|
$output .= '<p>'. t('The module is enabled on the users account settings page as a text field. e-mail aliases: where users can enter multiple e-mail addresses separated by a comma.') .'</p>';
|
| 30 |
|
|
$output .= t('<p>You can</p>
|
| 31 |
|
|
<ul>
|
| 32 |
|
|
<li>view the user page at <a href="%user"> user</a>.</li>
|
| 33 |
|
|
<li>adminster users at <a href="%admin-user">administer >> users</a>.</li>
|
| 34 |
|
|
<li>administer mailhandler at <a href="%admin-mailhandler">administer >> mailhandler</a>.</li>
|
| 35 |
|
|
', array('%user' => url('user'), '%admin-user' => url('admin/user'), '%admin-mailhandler' => url('admin/mailhandler'))) .'</ul>';
|
| 36 |
|
|
$output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="%mailalias">Mailalias page</a>.', array('%mailalias' => 'http://www.drupal.org/handbook/modules/mailalias/')) .'</p>';
|
| 37 |
|
|
return $output;
|
| 38 |
|
|
case "admin/modules#description":
|
| 39 |
|
|
return t("A user may associate additional email addresses with his account.");
|
| 40 |
weitzman |
1.3 |
}
|
| 41 |
weitzman |
1.1 |
}
|
| 42 |
|
|
|
| 43 |
mathias |
1.4 |
?>
|