Index: registration_role.module =================================================================== --- registration_role.module (revision 2603) +++ registration_role.module (working copy) @@ -64,6 +64,15 @@ } /** + * Implementation of hook_form_alter() + */ +function registration_role_form_alter(&$form_id, &$form) { + if ($form_id === 'user_register' && user_access('administer users')) { + $form['account']['roles']['#default_value'] = array(variable_get('registration_role_roles', '')); + } +} + +/** * Implementation of hook_user(). * * Catch every registration and insert role @@ -71,7 +80,7 @@ function registration_role_user ($op, &$edit, &$user, $category=null) { - if ($op == "insert" && $rid = variable_get('registration_role_roles', '')) + if ($op == 'insert' && !user_access('administer users') && $rid = variable_get('registration_role_roles', '')) { { // below does not seem safe! or necessary for insert. Commented out // clear first