<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>We Rock Your Web Forum Topic: Drupal PHP Check User Role?</title>
<link>http://forum.werockyourweb.com/</link>
<description>We Rock Your Web Forum Topic: Drupal PHP Check User Role?</description>
<language>en</language>
<pubDate>Thu, 17 May 2012 23:28:16 +0000</pubDate>

<item>
<title>cwd on "Drupal PHP Check User Role?"</title>
<link>http://forum.werockyourweb.com/drupal/drupal-php-check-user-role#post-437</link>
<pubDate>Fri, 23 Jul 2010 11:39:18 +0000</pubDate>
<dc:creator>cwd</dc:creator>
<guid isPermaLink="false">437@http://forum.werockyourweb.com/</guid>
<description>&#60;p&#62;Yes, you can use the following PHP snippet to check a Drupal user's role. Basically this searches the user role array to see if that user has the specified role &#34;initial signup.&#34; If it does, then they get redirected to the &#34;registration-success&#34; page. If not (this assumes they're an authenticated user), they get redirected to the &#34;welcome&#34; page.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;global $user;
if (in_array(&#38;quot;initial signup&#38;quot;, array_values($user-&#38;gt;roles))) {
    return &#38;#39;registration-success&#38;#39;;
} else { return &#38;#39;welcome&#38;#39;; }&#60;/code&#62;&#60;/pre&#62;
</description>
</item>
<item>
<title>DrupalJunkie on "Drupal PHP Check User Role?"</title>
<link>http://forum.werockyourweb.com/drupal/drupal-php-check-user-role#post-436</link>
<pubDate>Fri, 23 Jul 2010 11:36:40 +0000</pubDate>
<dc:creator>DrupalJunkie</dc:creator>
<guid isPermaLink="false">436@http://forum.werockyourweb.com/</guid>
<description>&#60;p&#62;Is there a way to check a user's role using a php snippet in Drupal 6.x? I basically want to redirect the user on login based on their role. I have an &#34;initial signup&#34; role that gets created immediately after signup, and upgraded to &#34;authenticated user&#34; when they confirm their email address (to prevent spam).
&#60;/p&#62;
</description>
</item>

</channel>
</rss>

