Skip to content

Instantly share code, notes, and snippets.

@csakiistvan
Created September 22, 2016 07:52
Show Gist options
  • Save csakiistvan/340bef16c1b22a892eaf0ed02c7742c1 to your computer and use it in GitHub Desktop.
Save csakiistvan/340bef16c1b22a892eaf0ed02c7742c1 to your computer and use it in GitHub Desktop.
Redirect drupal user to url, if he/she has a specific role
<?php
/**
* @file
* Code for the My custom module.
*/
/**
* Implements hook_user_login().
*/
function mymodule_user_login(&$edit, $account) {
if (in_array('Press', $account->roles)) {
drupal_goto('press');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment