You are here

function janrain_capture_url_outbound_alter in Janrain Registration 7.4

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

Implements hook_url_outbound_alter().

File

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

Code

function janrain_capture_url_outbound_alter(&$path, &$options, $original_path) {

  // Override logout link
  switch ($path) {
    case 'user/logout':
      $ver = variable_get('janrain_capture_ver', JANRAIN_CAPTURE_VERSION_DEFAULT);
      if ($ver == JANRAIN_CAPTURE_VERSION_LEGACY) {
        $janrain_capture_optional = variable_get('janrain_capture_optional', array());
        if (!empty($janrain_capture_optional['capture_sso_enabled']) && !empty($janrain_capture_optional['capture_sso_address']) && !empty($janrain_capture_optional['real_logout'])) {
          $path = 'javascript:CAPTURE.logout()';
          $options['external'] = TRUE;
        }
      }
      break;
  }
}