Posts

Showing posts from August, 2013

Drupal 7 - First Time Login Redirection

I was trying tocome up with a solution for first time login redirection and after that redirection to user profile edit page every time a user logged in. For that I created a role, "First Time Login". Then created a rule using rules module. It will assign role "First Time Login" to a newly created user. Then in the following code, in module "custom_login_redirections" using hook_user_login redirected user to the "Welcome Page" of it has role "First Time Login". // Comment function custom_login_redirections_user_login(&$edit, $account) { if (!isset($_POST['form_id']) || $_POST['form_id'] != 'user_pass_reset') { if(isset($account->roles[30])){ if(in_array($account->roles[30], $account->roles)) { $options = array( 'absolute' => TRUE, 'query' => array('destination' => '#overlay=node/17973') ); $redirec