Index: mailalias.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mailalias/mailalias.module,v
retrieving revision 1.8
diff -u -F^f -r1.8 mailalias.module
--- mailalias.module	1 Oct 2004 00:08:33 -0000	1.8
+++ mailalias.module	1 Oct 2004 02:59:52 -0000
@@ -1,27 +1,26 @@
 <?php
 // $Id: mailalias.module,v 1.8 2004/10/01 00:08:33 uwe Exp $
 
-function mailalias_user($type, $edit, $user) {
-  switch ($type) {
-    case "form":
-      // when user tries to edit his own data $output =
-      $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."));
-      return array (t('Personal information') => $output);
-    case "validate":
-      // validate user data editing. TODO
-      $mailalias = strtr($edit["mailalias"], array (" " => "")); // strip spaces
-      $mailsarr = explode(",", $mailalias);
-      foreach ($mailsarr as $mail) {
-        if ($mail != null && $error = user_validate_mail($mail)) {
-          return $error;
-        }
+function mailalias_user($type, &$edit, &$user, $category = NULL) {
+  if ($type == 'form' && $category == 'account') {
+    // when user tries to edit his own data $output =
+    $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.'));
+    return array(array('title' => t('Personal information'), 'data' => $output, 'weight' => 2));
+  }
+  else if ($type == 'validate' && $category == 'account') {
+    $mailalias = strtr($edit["mailalias"], array (" " => "")); // strip spaces
+    $mailsarr = explode(",", $mailalias);
+    foreach ($mailsarr as $mail) {
+      if ($mail != null && $error = user_validate_mail($mail)) {
+        form_set_error(t('Mail Alias'), $error);
       }
-      return array ("mailalias" => $mailalias);
+    }
+    return $edit;
   }
 }
 
 function mailalias_help($section) {
-  if ($section == "admin/system/modules#description") {
+  if ($section == "admin/modules#description") {
     return t("A user may associate additional email addresses with his account.");
   }
 }
