You are here

function cas_phpcas_load in CAS 6.3

Same name and namespace in other branches
  1. 7 cas.module \cas_phpcas_load()

Loads the phpCAS library.

Parameters

$path: Attempt to load phpCAS using this path. If omitted, phpCAS will be loaded using Libraries API or the configured value.

Return value

The phpCAS version if the phpCAS was successfully loaded, FALSE otherwise.

4 calls to cas_phpcas_load()
cas_library_version_check in ./cas.admin.inc
Checks that the library is installed in the location specified by loading the class and extracting the version.
cas_login_check in ./cas.module
Checks to see if the user needs to be logged in.
cas_phpcas_init in ./cas.module
Initialize phpCAS.
cas_requirements in ./cas.install
Implements hook_requirements().

File

./cas.module, line 209
Enables users to authenticate via a Central Authentication Service (CAS) Cas will currently work if the auto registration is turned on and will create user accounts automatically.

Code

function cas_phpcas_load($path = NULL) {
  if (!isset($path)) {
    if (module_exists('libraries')) {
      $path = libraries_get_path('CAS');
    }
    else {
      $path = variable_get('cas_library_dir', 'CAS');
    }
  }

  // Build the name of the file to load.
  if ($path != '') {
    $path = rtrim($path, '/') . '/';
  }
  $filename = $path . 'CAS.php';
  include_once $filename;
  if (!defined('PHPCAS_VERSION') || !class_exists('phpCAS')) {

    // The file could not be loaded successfully.
    return FALSE;
  }
  return PHPCAS_VERSION;
}