Index: autoassignrole-admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/autoassignrole/autoassignrole-admin.inc,v
retrieving revision 1.1.2.10
diff -u -p -r1.1.2.10 autoassignrole-admin.inc
--- autoassignrole-admin.inc	12 Aug 2009 17:35:28 -0000	1.1.2.10
+++ autoassignrole-admin.inc	14 Aug 2009 12:17:06 -0000
@@ -62,6 +62,21 @@ function autoassignrole_admin_form() {
     '#collapsible' => TRUE,
     '#collapsed' => TRUE,
   );
+  $form['autoassignrole_settings_page']['redirect_register'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Redirect User Register'),
+    '#default_value' => _autoassignrole_get_settings('redirect_register'),
+    '#description' => t('Enable to hide user/register and redirect to the path 
+      listed below when accessed.')
+  );
+  $form['autoassignrole_settings_page']['redirect_register_path'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Redirect User Register Path'),
+    '#default_value' => _autoassignrole_get_settings('redirect_register_path'),
+    '#size' => 60,
+    '#description' => t('The path to redirect the user to instead of 
+      user/register. Page should contain links to all role registration paths.')
+  );
   $result = db_query("SELECT rid, display, path, title, description, format, weight, menu FROM {autoassignrole_page}");
   $defaults = array();
   while ($setting = db_fetch_object($result)) {
@@ -225,7 +240,7 @@ function autoassignrole_admin_form() {
     '#type' => 'textarea',
     '#title' => t('User Role Description'),
     '#description' => t('The description displayed to the end user when they are
-      selecting thier role during registration.'),
+      selecting their role during registration.'),
     '#default_value' => _autoassignrole_get_settings('user_description'),
     '#required' => FALSE,
   );
@@ -305,6 +320,13 @@ function autoassignrole_admin_form_valid
       form_set_error('user_title', t('Enter the title of the form fields the user will be presented with.'));
     }
   }
+  
+  //If user/register redirect is enabled, path must not be empty
+  if($form_values['values']['redirect_register']) {
+    if (strlen(trim($form_values['values']['redirect_register_path'])) == 0) {
+      form_set_error('redirect_register_path', t('Registration redirect is enabled, path cannot be empty.'));
+    }
+  }
 }
 function autoassignrole_admin_form_submit($form_id, $form_values) {
   $sql = "UPDATE {autoassignrole} set value = '%s' where arid = '%s'";
@@ -319,6 +341,8 @@ function autoassignrole_admin_form_submi
   db_query($sql, $form_values['values']['user_sort'], 'user_sort');
   db_query($sql, $form_values['values']['user_description'], 'user_description');
   db_query($sql, $form_values['values']['user_selection'], 'user_selection');
+  db_query($sql, $form_values['values']['redirect_register'], 'redirect_register');
+  db_query($sql, $form_values['values']['redirect_register_path'], 'redirect_register_path');
 
 
   // Role assignment based on path
Index: autoassignrole.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/autoassignrole/autoassignrole.install,v
retrieving revision 1.7.2.8
diff -u -p -r1.7.2.8 autoassignrole.install
--- autoassignrole.install	13 Aug 2009 13:29:03 -0000	1.7.2.8
+++ autoassignrole.install	14 Aug 2009 12:17:06 -0000
@@ -51,6 +51,12 @@ function autoassignrole_install() {
   db_query("INSERT into {autoassignrole} (arid,value) VALUES ('%s', '%s')",
     'page_active', 0
   );
+  db_query("INSERT into {autoassignrole} (arid,value) VALUES ('%s', '%s')",
+    'redirect_register', 0
+  );
+  db_query("INSERT into {autoassignrole} (arid,value) VALUES ('%s', '%s')",
+    'redirect_register_path', 'register'
+  );  
 }
 
 /**
@@ -156,3 +162,10 @@ function autoassignrole_update_6001() {
   $ret[] = update_sql('ALTER TABLE {autoassignrole_page} ADD menu VARCHAR(255)');
   return $ret;
 }
+
+function autoassignrole_update_6002() {
+  $ret = array();
+  $ret[] = update_sql("INSERT into {autoassignrole} (arid,value) VALUES ('redirect_register', 0)");
+  $ret[] = update_sql("INSERT into {autoassignrole} (arid,value) VALUES ('redirect_register_path', 'register')");
+  return $ret;
+}
Index: autoassignrole.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/autoassignrole/autoassignrole.module,v
retrieving revision 1.9.2.23
diff -u -p -r1.9.2.23 autoassignrole.module
--- autoassignrole.module	13 Aug 2009 18:57:01 -0000	1.9.2.23
+++ autoassignrole.module	14 Aug 2009 12:17:06 -0000
@@ -545,3 +545,20 @@ function autoassignrole_get_roles($op = 
   
   return $roles;
 }
+
+/**
+ * Implementation of hook_menu_alter().
+ */
+function autoassignrole_menu_alter(&$items) {
+  //if user/register redirect is enabled, change the callback
+  if(_autoassignrole_get_settings('redirect_register')) {
+    $items['user/register']['page callback'] = 'autoassignrole_redirect_register';
+  }
+}
+
+/**
+ * Replacement user/register callback
+ */
+function autoassignrole_redirect_register() {
+  drupal_goto(_autoassignrole_get_settings('redirect_register_path'));
+}
