You are here

function janrain_capture_menu_alter in Janrain Registration 7

Same name and namespace in other branches
  1. 7.4 janrain_capture.module \janrain_capture_menu_alter()
  2. 7.2 janrain_capture.module \janrain_capture_menu_alter()
  3. 7.3 janrain_capture.module \janrain_capture_menu_alter()

Implements hook_menu_alter().

File

./janrain_capture.module, line 289
This module implements authentication endpoints for Janrain Capture.

Code

function janrain_capture_menu_alter(&$items) {
  if (variable_get('janrain_capture_enforce', FALSE)) {

    // Make capture the only way to log in to the site.
    foreach (array(
      'user/login',
      'user/register',
    ) as $key) {
      $items[$key]['page callback'] = 'janrain_capture_signin';
      unset($items[$key]['page arguments']);
      unset($items[$key]['file']);

      // Override to be callbacks instead of tabs.
      $items[$key]['type'] = MENU_CALLBACK;
    }

    // Let logged in users use the shortcut to their profile.
    $items['user']['access callback'] = 'user_is_logged_in';

    // All password reset requests should go via Capture.
    $items['user/password']['access callback'] = FALSE;
  }
}