You are here

function bakery_menu in Bakery Single Sign-On System 7.2

Same name and namespace in other branches
  1. 6.2 bakery.module \bakery_menu()
  2. 6 bakery.module \bakery_menu()
  3. 7.4 bakery.module \bakery_menu()
  4. 7.3 bakery.module \bakery_menu()

Implements hook_menu().

File

./bakery.module, line 11
Module file for the Bakery.

Code

function bakery_menu() {
  $items = array();
  $items['admin/config/system/bakery'] = array(
    'title' => 'Bakery',
    'access arguments' => array(
      'administer bakery',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'bakery_settings',
    ),
    'description' => 'Infrastructure-wide single-sign-on system options.',
  );
  if (variable_get('bakery_is_master', 0)) {
    if (variable_get('bakery_subsite_login', 0)) {
      $items['bakery'] = array(
        'title' => 'Register',
        'access callback' => 'user_is_anonymous',
        'page callback' => 'bakery_register',
        'type' => MENU_CALLBACK,
      );
      $items['bakery/login'] = array(
        'title' => 'Login',
        'access callback' => 'user_is_anonymous',
        'page callback' => 'bakery_login',
        'type' => MENU_CALLBACK,
      );
    }
    $items['bakery/create'] = array(
      'title' => 'Bakery create',
      'access callback' => 'bakery_taste_gingerbread_cookie',
      'page callback' => 'bakery_eat_gingerbread_cookie',
      'type' => MENU_CALLBACK,
    );
  }
  else {
    if (variable_get('bakery_subsite_login', 0)) {
      $items['bakery'] = array(
        'title' => 'Register',
        'access callback' => TRUE,
        'page callback' => 'bakery_register_return',
        'type' => MENU_CALLBACK,
      );
      $items['bakery/login'] = array(
        'title' => 'Login',
        'access callback' => TRUE,
        'page callback' => 'bakery_login_return',
        'type' => MENU_CALLBACK,
      );
    }
    $items['bakery/update'] = array(
      'title' => 'Update',
      'access callback' => 'bakery_taste_stroopwafel_cookie',
      'page callback' => 'bakery_eat_stroopwafel_cookie',
      'type' => MENU_CALLBACK,
    );
    $items['bakery/repair'] = array(
      'title' => 'Repair account',
      'access callback' => 'bakery_uncrumble_access',
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'bakery_uncrumble',
      ),
      'type' => MENU_CALLBACK,
    );
    $items['admin/config/people/bakery'] = array(
      'title' => 'Pull Bakery user',
      'description' => 'Request an account from the master site',
      'access arguments' => array(
        'administer users',
      ),
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'bakery_pull_form',
      ),
      'type' => MENU_NORMAL_ITEM,
    );
  }
  return $items;
}