| 1 |
weitzman |
1.1 |
<?php
|
| 2 |
weitzman |
1.12 |
// $Id: mailalias.module,v 1.11 2006/04/09 04:28:18 weitzman 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 |
weitzman |
1.11 |
$form['account']['mailalias'] = array(
|
| 8 |
|
|
'#type' => 'textfield',
|
| 9 |
|
|
'#title' => t('Email aliases'),
|
| 10 |
|
|
'#default_value' => $user->mailalias,
|
| 11 |
|
|
'#weight' => 1,
|
| 12 |
|
|
'#description' => 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.'),
|
| 13 |
|
|
);
|
| 14 |
|
|
return $form;
|
| 15 |
ankur |
1.9 |
}
|
| 16 |
|
|
else if ($type == 'validate' && $category == 'account') {
|
| 17 |
|
|
$mailalias = strtr($edit["mailalias"], array (" " => "")); // strip spaces
|
| 18 |
|
|
$mailsarr = explode(",", $mailalias);
|
| 19 |
|
|
foreach ($mailsarr as $mail) {
|
| 20 |
|
|
if ($mail != null && $error = user_validate_mail($mail)) {
|
| 21 |
weitzman |
1.11 |
form_set_error('mailalias', $error);
|
| 22 |
weitzman |
1.1 |
}
|
| 23 |
ankur |
1.9 |
}
|
| 24 |
|
|
return $edit;
|
| 25 |
weitzman |
1.1 |
}
|
| 26 |
|
|
}
|
| 27 |
|
|
|
| 28 |
webchick |
1.10 |
/**
|
| 29 |
|
|
* Implementation of hook_help().
|
| 30 |
|
|
*/
|
| 31 |
weitzman |
1.3 |
function mailalias_help($section) {
|
| 32 |
webchick |
1.10 |
switch ($section) {
|
| 33 |
|
|
case 'admin/help#mailalias':
|
| 34 |
|
|
$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>';
|
| 35 |
|
|
$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>';
|
| 36 |
|
|
$output .= t('<p>You can</p>
|
| 37 |
|
|
<ul>
|
| 38 |
weitzman |
1.12 |
<li>view the user page at <a href="@user">User</a>.</li>
|
| 39 |
|
|
<li>adminster users at <a href="@admin-user">Administer > User management</a>.</li>
|
| 40 |
|
|
<li>administer mailhandler at <a href="@admin-mailhandler">Administer > Content > Mailhandler</a>.</li>
|
| 41 |
|
|
', array('@user' => url('user'), '@admin-user' => url('admin/user'), '@admin-mailhandler' => url('admin/content/mailhandler'))) .'</ul>';
|
| 42 |
|
|
$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>';
|
| 43 |
webchick |
1.10 |
return $output;
|
| 44 |
|
|
case "admin/modules#description":
|
| 45 |
|
|
return t("A user may associate additional email addresses with his account.");
|
| 46 |
weitzman |
1.3 |
}
|
| 47 |
weitzman |
1.1 |
}
|