function simplesamlphp_auth_requirements in simpleSAMLphp Authentication 7.3
Same name and namespace in other branches
- 8.3 simplesamlphp_auth.install \simplesamlphp_auth_requirements()
- 7.2 simplesamlphp_auth.install \simplesamlphp_auth_requirements()
Implements hook_requirements().
File
- ./
simplesamlphp_auth.install, line 57 - The install file for the simplesamlphp_auth module.
Code
function simplesamlphp_auth_requirements($phase) {
$t = get_t();
$requirements = array();
if ($phase == 'runtime') {
if (!variable_get('simplesamlphp_auth_activate', 0)) {
$requirements['simplesamlphp_auth'] = array(
'severity' => REQUIREMENT_WARNING,
'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', '/usr/share/simplesamlphp');
if (!file_exists($basedir . '/lib/_autoload.php')) {
$requirements['simplesamlphp_auth'] = array(
'severity' => REQUIREMENT_ERROR,
'title' => 'SimpleSAMLphp authentication',
'value' => $t('SimpleSAMLphp authentication is missing the required SimpleSAMLphp library.'),
'description' => $t('Please download and install the !simplesamlphp library.', array(
'!simplesamlphp' => l($t('SimpleSAMLphp'), 'https://simplesamlphp.org/download'),
)),
);
}
else {
if (_simplesaml_auth_autoload()) {
// If autoloading was successful we should have these variables.
global $_simplesamlphp_auth_saml_config;
global $_simplesamlphp_auth_saml_version;
if (!empty($_simplesamlphp_auth_saml_version)) {
$ver = explode('.', $_simplesamlphp_auth_saml_version);
$requirements['simplesamlphp_auth_version'] = array(
'title' => $t('SimpleSAMLphp authentication'),
'value' => $_simplesamlphp_auth_saml_version,
);
if ($ver[0] < 1 || $ver[0] == 1 && $ver[1] < 6) {
$requirements['simplesamlphp_auth_version']['description'] = $t('Your version of SimpleSAMLphp is too old. The minimum version is 1.6.');
$requirements['simplesamlphp_auth_version']['severity'] = REQUIREMENT_ERROR;
}
else {
$requirements['simplesamlphp_auth_version']['severity'] = REQUIREMENT_OK;
}
}
}
}
}
return $requirements;
}