| 1 |
<?php |
<?php |
| 2 |
// $Id: mailalias.module,v 1.11 2006/04/09 04:28:18 weitzman Exp $ |
// $Id: mailalias.module,v 1.12 2007/12/16 15:01:22 weitzman Exp $ |
| 3 |
|
|
| 4 |
|
/** |
| 5 |
|
* Implementation of hook_user(). |
| 6 |
|
*/ |
| 7 |
function mailalias_user($type, &$edit, &$user, $category = NULL) { |
function mailalias_user($type, &$edit, &$user, $category = NULL) { |
| 8 |
if ($type == 'form' && $category == 'account') { |
if ($type == 'form' && $category == 'account') { |
| 9 |
// when user tries to edit his own data $output = |
// when user tries to edit his own data $output = |
| 17 |
return $form; |
return $form; |
| 18 |
} |
} |
| 19 |
else if ($type == 'validate' && $category == 'account') { |
else if ($type == 'validate' && $category == 'account') { |
| 20 |
$mailalias = strtr($edit["mailalias"], array (" " => "")); // strip spaces |
$mailalias = strtr($edit["mailalias"], array(" " => "")); // strip spaces |
| 21 |
$mailsarr = explode(",", $mailalias); |
$mailsarr = explode(",", $mailalias); |
| 22 |
foreach ($mailsarr as $mail) { |
foreach ($mailsarr as $mail) { |
| 23 |
if ($mail != null && $error = user_validate_mail($mail)) { |
if ($mail != NULL && $error = user_validate_mail($mail)) { |
| 24 |
form_set_error('mailalias', $error); |
form_set_error('mailalias', $error); |
| 25 |
} |
} |
| 26 |
} |
} |
| 31 |
/** |
/** |
| 32 |
* Implementation of hook_help(). |
* Implementation of hook_help(). |
| 33 |
*/ |
*/ |
| 34 |
function mailalias_help($section) { |
function mailalias_help($path, $args) { |
| 35 |
switch ($section) { |
switch ($path) { |
| 36 |
case 'admin/help#mailalias': |
case 'admin/help#mailalias': |
| 37 |
$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>'; |
$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>'; |
| 38 |
$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>'; |
$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>'; |
| 39 |
$output .= t('<p>You can</p> |
$output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="@mailalias">Mailalias page</a>.', array('@mailalias' => 'http://drupal.org/handbook/modules/mailalias/')) .'</p>'; |
|
<ul> |
|
|
<li>view the user page at <a href="@user">User</a>.</li> |
|
|
<li>adminster users at <a href="@admin-user">Administer > User management</a>.</li> |
|
|
<li>administer mailhandler at <a href="@admin-mailhandler">Administer > Content > Mailhandler</a>.</li> |
|
|
', array('@user' => url('user'), '@admin-user' => url('admin/user'), '@admin-mailhandler' => url('admin/content/mailhandler'))) .'</ul>'; |
|
|
$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>'; |
|
| 40 |
return $output; |
return $output; |
|
case "admin/modules#description": |
|
|
return t("A user may associate additional email addresses with his account."); |
|
| 41 |
} |
} |
| 42 |
} |
} |