You are here

function bakery_get_bakery in Bakery Single Sign-On System 7.3

Helper function to retrieve the instance of Bakery.

Return value

Bakery Instansiated Bakery object.

10 calls to bakery_get_bakery()
bakery_boot in ./bakery.module
Implements hook_boot().
bakery_login_handler in ./bakery.module
Special Bakery login callback authenticates the user and returns to slave.
bakery_login_return in ./bakery.module
Custom return for errors during slave login process.
bakery_register_handler in ./bakery.module
Special Bakery register callback registers the user and returns to slave.
bakery_register_return in ./bakery.module
Custom return for slave registration process.

... See full list

File

./bakery.module, line 91

Code

function bakery_get_bakery() {
  $context_set =& drupal_static(__FUNCTION__, FALSE);
  if (!$context_set) {
    $config = array(
      'is_master' => variable_get('bakery_is_master', 0),
      'domain' => variable_get('bakery_domain', 'http://example.com'),
      'key' => variable_get('bakery_key', ''),
      'sso_cookie' => _bakery_cookie_name('SSO'),
      'sub_cookie' => _bakery_cookie_name('SUB'),
      'lifetime' => variable_get('bakery_freshness', 3600),
      'expiration' => variable_get('bakery_expiration', 3600 * 24 * 7),
      'debug' => variable_get('bakery_debug', FALSE),
    );
    $context_set = TRUE;
    return Bakery::instance($config);
  }
  return Bakery::instance();
}