@@ -927,3 +937,106 @@ function _ocio_simplesamlphp_auth_authcheck() {
returnFALSE;
}
/**
* Page callback for /saml_login
*/
functionocio_simplesamlphp_auth_loginpage(){
global$user;
global$base_url;
global$_simplesamlphp_auth_as;
global$_simplesamlphp_auth_saml_attributes;
$fail=NULL;
$output=NULL;
if(!_simplesamlphp_auth_isEnabled()){
// Exit without initializing.
drupal_set_message(t('We\'re sorry this feature is not yet enabled.'));
return'';
}
// Do some sanity checking before attempting anything.
$config=SimpleSAML_Configuration::getInstance();
$configStoreType=$config->getValue('store.type');
// Make sure phpsession is NOT being used.
if($configStoreType=='phpsession'){
watchdog('ocio_simplesamlphp_auth','A user attempted to login using simplesamlphp but the store.type is phpsession, use memcache or sql for simplesamlphp session storage. See: simplesamlphp/config/config.php.',NULL,WATCHDOG_WARNING);
$fail=TRUE;
}
// Make sure there is an instance of SimpleSAML_Auth_Simple.
if(!$_simplesamlphp_auth_as){
watchdog('ocio_simplesamlphp_auth','A user attempted to login using this module but there was a problem.',NULL,WATCHDOG_WARNING);
$fail=TRUE;
}
// There was a problem, we can't go on, but we don't want to tell the user any specifics either.
if($fail){
drupal_set_message(t('We\'re sorry. There was a problem. The issue has been logged for the administrator.'));
drupal_goto(base_path());
}
$returnto=NULL;
// Support for deep linking.
// See if a URL has been explicitly provided in ReturnTo. If so, use it (as long as it points to this site).