--- terms_of_use.module	2009-03-23 14:20:27.000000000 -0700
+++ terms_of_use.module	2010-02-27 17:56:28.000000000 -0800
@@ -126,53 +126,55 @@ function terms_of_use_admin_settings_val
 }
 
 /**
- * Implementation of hook_form_form_id_alter().
+ * Implementation of hook_user().
  */
-function terms_of_use_form_user_register_alter(&$form, $form_state) {
-  // Adding the fieldset.
-  $form['terms_of_use'] = array(
-    '#type' => 'fieldset',
-    '#title' => check_plain(variable_get('terms_of_use_fieldset_name', t('Terms of Use'))),
-    '#weight' => 10,
-  );
-
-  // Getting the node that contains the Terms of Use.
-  $terms_of_use_node_id = variable_get('terms_of_use_node_id', '');
-  if (module_exists('translation')) {
-    global $language;
-    $translations = translation_node_get_translations($terms_of_use_node_id);
-    if ($translations[$language->language]) {
-      $terms_of_use_node_id = $translations[$language->language]->nid;
-    }
-  }
-  $node = node_load($terms_of_use_node_id);
+function terms_of_use_user($type, $edit, &$user, $category = NULL) {
+  if ($type == 'register') {
+    // Adding the fieldset.
+    $form['terms_of_use'] = array(
+      '#type' => 'fieldset',
+      '#title' => check_plain(variable_get('terms_of_use_fieldset_name', t('Terms of Use'))),
+      '#weight' => 10,
+    );
   
-  // Will we show the full text of the Terms or only provide a link to the Terms.
-  // Reading the checkbox label to find out.
-  $show_terms = TRUE;
-  $checkbox_label = check_plain(variable_get('terms_of_use_checkbox_label', t('I agree with these terms.')));
-  if (strpos($checkbox_label, '@link') !== FALSE) {
-    $checkbox_label = str_replace('@link', l(check_plain($node->title), 'node/'. $node->nid), $checkbox_label);
-    $show_terms = FALSE;
-  }  
+    // Getting the node that contains the Terms of Use.
+    $terms_of_use_node_id = variable_get('terms_of_use_node_id', '');
+    if (module_exists('translation')) {
+      global $language;
+      $translations = translation_node_get_translations($terms_of_use_node_id);
+      if ($translations[$language->language]) {
+        $terms_of_use_node_id = $translations[$language->language]->nid;
+      }
+    }
+    $node = node_load($terms_of_use_node_id);
     
-  // Adding the Terms of Use to the fieldset. 
-  if ($show_terms && $node) {
-    $terms = node_prepare($node);
-    $form['terms_of_use']['terms_of_use_text'] = array(
-      '#value' => theme('terms_of_use', $terms->body, $node),
+    // Will we show the full text of the Terms or only provide a link to the Terms.
+    // Reading the checkbox label to find out.
+    $show_terms = TRUE;
+    $checkbox_label = check_plain(variable_get('terms_of_use_checkbox_label', t('I agree with these terms.')));
+    if (strpos($checkbox_label, '@link') !== FALSE) {
+      $checkbox_label = str_replace('@link', l(check_plain($node->title), 'node/'. $node->nid), $checkbox_label);
+      $show_terms = FALSE;
+    }  
+      
+    // Adding the Terms of Use to the fieldset. 
+    if ($show_terms && $node) {
+      $terms = node_prepare($node);
+      $form['terms_of_use']['terms_of_use_text'] = array(
+        '#value' => theme('terms_of_use', $terms->body, $node),
+      );
+    }
+  
+    // Adding the checkbox to the fieldset.
+    $form['terms_of_use']['I_agree'] = array(
+      '#type' => 'checkbox',
+      '#title' => $checkbox_label . '&nbsp;<span class="form-required" title="' . t('This field is required') . '">*</span>',
+      '#required' => TRUE,
+      '#element_validate' => array('_terms_of_use_validate_checkbox'),
     );
+  
+    return $form;
   }
-
-  // Adding the checkbox to the fieldset.
-  $form['terms_of_use']['I_agree'] = array(
-    '#type' => 'checkbox',
-    '#title' => $checkbox_label . '&nbsp;<span class="form-required" title="' . t('This field is required') . '">*</span>',
-    '#required' => TRUE,
-    '#element_validate' => array('_terms_of_use_validate_checkbox'),
-  );
-
-  return $form;
 }
 
 /**
