You are here

function simplesamlphp_auth_requirements in simpleSAMLphp Authentication 7.2

Same name and namespace in other branches
  1. 8.3 simplesamlphp_auth.install \simplesamlphp_auth_requirements()
  2. 7.3 simplesamlphp_auth.install \simplesamlphp_auth_requirements()

Implements hook_requirements().

File

./simplesamlphp_auth.install, line 53
the install file for the simplesamlphp_auth module

Code

function simplesamlphp_auth_requirements($phase) {
  $requirements = array();
  if ($phase == 'runtime') {
    if (!variable_get('simplesamlphp_auth_activate', 0)) {
      $requirements['simplesamlphp_auth'] = array(
        'severity' => REQUIREMENT_INFO,
        'title' => 'simpleSAMLphp_auth',
        'value' => t('SimpleSAMLphp authentication is NOT activated'),
        'description' => t('It can be activated on the !admin_page.', array(
          '!admin_page' => l(t('configuration page'), 'admin/config/people/simplesamlphp_auth'),
        )),
      );
    }
    $basedir = variable_get('simplesamlphp_auth_installdir', '/var/simplesamlphp');
    if (!file_exists($basedir . '/lib/_autoload.php')) {
      $requirements['simplesamlphp_auth'] = array(
        'severity' => REQUIREMENT_WARNING,
        'title' => 'simpleSAMLphp_auth',
        'value' => t('SimpleSAMLphp authentication is missing the required SimpleSAMLphp library'),
        'description' => t('Please download and install the !simplesamlphp library.', array(
          '!simplesamlphp' => l(t('SimpeSAMLphp'), 'https://simplesamlphp.org/download'),
        )),
      );
    }
  }
  return $requirements;
}