From 6b74aa9f4c8de39dd40560dd1f4e5360ebc0e2ca Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Mon, 3 Oct 2016 09:05:59 +0200 Subject: [PATCH] Check organisationemail --- main/inc/local.inc.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/main/inc/local.inc.php b/main/inc/local.inc.php index 6e133b1716..e3347fe839 100755 --- a/main/inc/local.inc.php +++ b/main/inc/local.inc.php @@ -523,6 +523,36 @@ if (!empty($_SESSION['_user']['user_id']) && !($login || $logout)) { ); } } else { + + $extraFieldValue = new ExtraFieldValue('user'); + $uData = $extraFieldValue->get_item_id_from_field_variable_and_field_value( + 'organisationemail', + $login + ); + if (!empty($uData)) { + $uData = api_get_user_info($uData['item_id']); + + if (!empty($extAuthSource[$uData['auth_source']]['login']) + && file_exists($extAuthSource[$uData['auth_source']]['login']) + ) { + /* + * Process external authentication + * on the basis of the given login name + */ + $loginFailed = true; // Default initialisation. It could + // change after the external authentication + $key = $uData['auth_source']; //'ldap','shibboleth'... + + /* >>>>>>>> External authentication modules <<<<<<<<< */ + // see configuration.php to define these + include_once($extAuthSource[$key]['login']); + } + } else { + // change after the external authentication + // login failed, Database::num_rows($result) <= 0 + $loginFailed = true; // Default initialisation. It could + } + // login failed, Database::num_rows($result) <= 0 $loginFailed = true; // Default initialisation. It could // change after the external authentication