Ooops ... I included a function from the notify module that I used for the hook_user reference that shouldn&#39;t be in there ... create autoassignrole.module with this code and not the previous ... Sorry about that<br><br>
&lt;?php<br>define(&quot;AUTOASSIGNROLE_ROLE&quot;, &quot;&quot;);<br>/**<br>&nbsp;* Implementation of hook_menu().<br>&nbsp;*<br>&nbsp;* @return array<br>&nbsp;*/<br>function autoassignrole_menu($may_cache) {<br>&nbsp; $items = array();<br>&nbsp; if ($may_cache) {
<br>&nbsp;&nbsp;&nbsp; $items[] = array(<br>&nbsp;&nbsp;&nbsp; &#39;path&#39; =&gt; &#39;admin/settings/autoassignrole&#39;,<br>&nbsp;&nbsp;&nbsp; &#39;title&#39; =&gt; t(&#39;Auto Assign Role Settings&#39;),<br>&nbsp;&nbsp;&nbsp; &#39;description&#39; =&gt; t(&#39;Auto Assign Role Settings page.&#39;),
<br>&nbsp;&nbsp;&nbsp; &#39;callback&#39; =&gt; &#39;drupal_get_form&#39;,<br>&nbsp;&nbsp;&nbsp; &#39;callback arguments&#39; =&gt; &#39;autoassignrole_settings&#39;,<br>&nbsp;&nbsp;&nbsp; &#39;access&#39; =&gt; user_access(&#39;administer autoassignrole&#39;),<br>&nbsp;&nbsp;&nbsp; );
<br>&nbsp; }<br>&nbsp; return $items;<br>}<br>function autoassignrole_settings() {<br>&nbsp; $form[&#39;autoassignrole_settings&#39;] = array(<br>&nbsp; &#39;#type&#39; =&gt; &#39;fieldset&#39;,<br>&nbsp; &#39;#title&#39; =&gt; t(&#39;Auto Assign Role Settings&#39;),
<br>&nbsp; &#39;#collapsible&#39; =&gt; FALSE,<br>&nbsp; &#39;#collapsed&#39; =&gt; FALSE,<br>&nbsp; );<br>&nbsp; $form[&#39;autoassignrole_settings&#39;][&#39;AUTOASSIGNROLE_ROLE&#39;] = array(<br>&nbsp; &#39;#type&#39; =&gt; &#39;textfield&#39;,
<br>&nbsp; &#39;#title&#39; =&gt; t(&#39;.&#39;),<br>&nbsp; &#39;#default_value&#39; =&gt; variable_get(&#39;AUTOASSIGNROLE_ROLE&#39;, &#39;&#39;),<br>&nbsp; &#39;#size&#39; =&gt; 70,<br>&nbsp; &#39;#maxlength&#39; =&gt; 255,<br>&nbsp; &#39;#description&#39; =&gt; t(&#39;The role you want new users assigned to.&#39;)
<br>&nbsp; );<br>&nbsp; return system_settings_form($form);<br>}<br>/**<br>&nbsp;* Implementation of hook_perm().<br>&nbsp;* @return array<br>&nbsp;*/<br>function autoassignrole_perm() {<br>&nbsp; return array(&#39;administer autoassignrole&#39;);<br>
}<br><br>/**<br>&nbsp;* Implementation of hook_user().<br>&nbsp;*/<br>function autoassignrole_user($type, &amp;$edit, &amp;$user, $category = NULL) {<br>&nbsp; switch ($type) {<br>&nbsp;&nbsp;&nbsp; case &#39;insert&#39;:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $sql = &quot;SELECT 
r.rid FROM {role} r WHERE <a href="http://r.name">r.name</a> = &#39;%s&#39;&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $role = db_fetch_object(db_query($sql,variable_get(&#39;AUTOASSIGNROLE_ROLE&#39;,&#39;&#39;)));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; db_query(&#39;INSERT INTO {users_roles} (uid, rid) values (%d, %d)&#39;, $user-&gt;uid, $role-&gt;rid );
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>&nbsp; }<br>}<br><br><br><br>