You are here

ldap_api.module in Lightweight Directory Access Protocol (LDAP) 6

This this the main LDAP API module.

This module will make the ldap API available to other modules. Designed to provide a light but flexible assortment of functions and constants, with more functionality in additional files that are not loaded unless other modules specifically include them.

File

ldap_api.module
View source
<?php

/**
 * @file
 * This this the main LDAP API module.
 *
 * This module will make the ldap API available to other modules.
 * Designed to provide a light but flexible assortment of functions
 * and constants, with more functionality in additional files that
 * are not loaded unless other modules specifically include them.
 *
 * @see http://datatracker.ietf.org/doc/rfc4510/
 * @see http://datatracker.ietf.org/doc/rfc4511/
 * @see http://datatracker.ietf.org/doc/rfc4512/
 * @see http://datatracker.ietf.org/doc/rfc4513/
 * @see http://datatracker.ietf.org/doc/rfc4514/
 * @see http://datatracker.ietf.org/doc/rfc4515/
 * @see http://datatracker.ietf.org/doc/rfc4516/
 * @see http://datatracker.ietf.org/doc/rfc4517/
 * @see http://datatracker.ietf.org/doc/rfc4518/
 * @see http://datatracker.ietf.org/doc/rfc4519/
 */

/**
 * Implementation of hook_init().
 */

/**
 * Implementation of hook_theme().
 */
function ldap_api_theme() {
  return array(
    'ldap_api_list_servers_form' => array(
      'arguments' => array(
        'form' => NULL,
      ),
      'file' => 'ldap_server.theme.inc',
    ),
  );
}

/**
 * Implementation of hook_perm().
 */
function ldap_api_perm() {
  return array(
    'Add/Edit LDAP Servers',
    'Delete LDAP Servers',
    '(De-)Activate LDAP Servers',
  );
}

/**
 * Implementation of hook_cron().
 */
function ldap_api_cron() {
}

/**
 * Implementation of hook_menu().
 */
function ldap_api_menu() {
  $items = array();
  $items['admin/settings/ldap'] = array(
    'title' => 'LDAP',
    'page callback' => 'ldap_api_info',
    'access arguments' => array(
      'administer site configuration',
    ),
    'file' => 'ldap_api.admin.inc',
  );
  $items['admin/settings/ldap/info'] = array(
    'title' => 'Information',
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'ldap_api_info',
    'access arguments' => array(
      'administer site configuration',
    ),
    'file' => 'ldap_api.admin.inc',
    'weight' => 1,
  );
  $items['admin/settings/ldap/help'] = array(
    'title' => 'Help',
    'type' => MENU_LOCAL_TASK,
    'file' => 'ldap_api.help.inc',
    'page callback' => 'ldap_api_help_index',
    'weight' => 10,
  );
  $items['admin/settings/ldap/servers'] = array(
    'title' => 'Servers',
    'description' => 'Configure LDAP Servers',
    'type' => MENU_LOCAL_TASK,
    'file' => 'ldap_server.admin.inc',
    'page callback' => 'ldap_api_list_servers',
    'access arguments' => array(
      'administer site configuration',
    ),
    'weight' => 1,
  );
  $items['admin/settings/ldap/servers/list'] = array(
    'title' => 'List',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -1,
  );
  $items['admin/settings/ldap/servers/add'] = array(
    'title' => 'New',
    'description' => 'Add an LDAP Server',
    'type' => MENU_LOCAL_TASK,
    'file' => 'ldap_server.admin.inc',
    'page callback' => 'ldap_api_add_server',
    'access arguments' => array(
      'Add/Edit LDAP Servers',
    ),
    'weight' => 1,
  );
  $items['admin/settings/ldap/servers/%'] = array(
    'title' => 'Server Configuration',
    'description' => 'Edit an LDAP Server',
    'type' => MENU_CALLBACK,
    'file' => 'ldap_server.admin.inc',
    'page callback' => 'ldap_api_edit_server',
    'page arguments' => array(
      4,
    ),
    'access arguments' => array(
      'Add/Edit LDAP Servers',
    ),
    'weight' => -1,
  );
  $items['admin/settings/ldap/servers/%/edit'] = array(
    'title' => 'General',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -1,
  );
  $items['admin/settings/ldap/servers/%/delete'] = array(
    'title' => 'Delete',
    'description' => 'Delete an LDAP Server',
    'type' => MENU_CALLBACK,
    'file' => 'ldap_server.admin.inc',
    'page callback' => 'ldap_api_delete_server',
    'page arguments' => array(
      4,
    ),
    'access arguments' => array(
      'Add/Edit LDAP Servers',
    ),
    'weight' => -1,
  );
  $items['admin/settings/ldap/servers/%/activate'] = array(
    'title' => 'Activate',
    'description' => 'Activate an LDAP Server',
    'type' => MENU_CALLBACK,
    'file' => 'ldap_server.admin.inc',
    'page callback' => 'ldap_api_activate_server',
    'page arguments' => array(
      4,
    ),
    'access arguments' => array(
      '(De-)Activate LDAP Servers',
    ),
    'weight' => -1,
  );
  $items['admin/settings/ldap/servers/%/deactivate'] = array(
    'title' => 'Deactivate',
    'description' => 'Deactivate an LDAP Server',
    'type' => MENU_CALLBACK,
    'file' => 'ldap_server.admin.inc',
    'page callback' => 'ldap_api_deactivate_server',
    'page arguments' => array(
      4,
    ),
    'access arguments' => array(
      '(De-)Activate LDAP Servers',
    ),
    'weight' => -1,
  );
  return $items;
}

/**
 * Implementation of hook_flush_caches().
 * 
 * This hook is also invoked on every cron run by system_cron(), so it may be 
 * called a lot more often than you'd think.
 */
function ldap_api_flush_caches() {
  return array(
    'ldap_cache',
  );
}

/**
 * Implementation of hook_simpletest().
 */
function ldap_api_simpletest() {
  $dir = drupal_get_path('module', 'ldap_api') . '/tests';
  $tests = file_scan_directory($dir, '\\.test$');
  return array_keys($tests);
}

// vim:fenc=utf-8:ft=php:ai:si:ts=2:sw=2:et:

Functions

Namesort descending Description
ldap_api_cron Implementation of hook_cron().
ldap_api_flush_caches Implementation of hook_flush_caches().
ldap_api_menu Implementation of hook_menu().
ldap_api_perm Implementation of hook_perm().
ldap_api_simpletest Implementation of hook_simpletest().
ldap_api_theme Implementation of hook_theme().