You are here

function auth0_enabled in Auth0 Single Sign On 7.2

Determine if Auth0 is enabled and can be used.

4 calls to auth0_enabled()
auth0_callback in ./auth0.module
User login API callback.
auth0_form_alter in ./auth0.module
Implements hook_form_alter().
auth0_verify_email_page in ./auth0.module
Verify email page callback.
template_preprocess_auth0_lock in ./auth0.module
Preprocess the login widget.

File

./auth0.module, line 1079

Code

function auth0_enabled($operation = '') {
  if (!auth0_check_dependencies()) {
    return FALSE;
  }
  $out = FALSE;

  // Check that the module has been configured.
  if (variable_get("auth0_domain", '') && variable_get("auth0_client_id", '') && variable_get('auth0_client_secret', '')) {

    // Default to on if the module is configured.
    $out = TRUE;

    // See if our settings allow us to override the registration form.
    if ($operation == 'signup' || $operation == 'reset') {
      $out = (bool) variable_get('auth0_allow_signup', '');
    }
  }

  // Allow other modules to override the status.
  drupal_alter('auth0_enabled', $out, $operation);
  return $out;
}