/[drupal]/contributions/modules/mailalias/mailalias.module
ViewVC logotype

Contents of /contributions/modules/mailalias/mailalias.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.9 - (hide annotations) (download) (as text)
Fri Oct 1 21:51:48 2004 UTC (5 years, 1 month ago) by ankur
Branch: MAIN
Branch point for: DRUPAL-4-5, DRUPAL-4-6
Changes since 1.8: +16 -17 lines
File MIME type: text/x-php
Ported to Drupal 4.5.
No changes otherwise.
1 weitzman 1.1 <?php
2 ankur 1.9 // $Id: mailalias.module,v 1.8 2004/10/01 00:08:33 uwe 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 weitzman 1.3 function mailalias_help($section) {
23 ankur 1.9 if ($section == "admin/modules#description") {
24 weitzman 1.3 return t("A user may associate additional email addresses with his account.");
25     }
26 weitzman 1.1 }
27    
28 mathias 1.4 ?>

  ViewVC Help
Powered by ViewVC 1.1.2