diff --git a/alma.install b/alma.install index 356ebc2..a37b560 100644 --- a/alma.install +++ b/alma.install @@ -16,6 +16,29 @@ function alma_requirements($phase) { ); } + if ($phase == 'runtime') { + $requirements['alma'] = array( + 'title' => $t('Alma'), + 'value' => $t('Alma configured'), + 'severity' => REQUIREMENT_OK, + ); + if (!variable_get('alma_base_url', FALSE) || !variable_get('ting_agency', FALSE)) { + $requirements['alma']['value'] = $t('Alma not configured'); + $requirements['alma']['description'] = $t('Alma is not properly configured, please visit the settings page.', array('@link' => url('admin/config/ding/provider/alma'))); + $requirements['alma']['severity'] = REQUIREMENT_ERROR; + } + $requirements['alma_wayf'] = array( + 'title' => $t('Alma WAYF'), + 'value' => $t('Alma WAYF configured'), + 'severity' => REQUIREMENT_OK, + ); + if (!variable_get('wayf_hash', FALSE)) { + $requirements['alma']['value'] = $t('Alma WAYF not configured'); + $requirements['alma']['description'] = $t('Alma WAYF is not properly configured, you need to set $conf[\'wayf_hash\'] in setttings.php.'); + $requirements['alma']['severity'] = REQUIREMENT_ERROR; + } + } + return $requirements; } diff --git a/includes/alma.wayf.inc b/includes/alma.wayf.inc index a057bc3..fa477a4 100644 --- a/includes/alma.wayf.inc +++ b/includes/alma.wayf.inc @@ -11,7 +11,7 @@ * login. */ function alma_wayf_login_credentials($authentication_attributes) { - $hash = variable_get('alma_wayf_hash', ''); + $hash = variable_get('wayf_hash', ''); $credentials = array(); if ($hash) { @@ -22,7 +22,7 @@ function alma_wayf_login_credentials($authentication_attributes) { } else { // Set message that hash value was not found. - watchdog('alma', 'The WAYF hash value has not been set in setting.php as $conf[\'alma_wayf_hash\'] and WAYF login will fail', WATCHDOG_ERROR); + watchdog('alma', 'The WAYF hash value has not been set in setting.php as $conf[\'wayf_hash\'] and WAYF login will fail.', WATCHDOG_ERROR); } return $credentials;