In functions.php, onelogin_saml_auth:
This currently returns 0 or 1: $matcher = variable_get('saml_options_account_matcher');
But the code expects 'username' or 'email'
$matcher == 'username' is always false, so email is always used.
Please change either the form code or the logic here in onelogin_saml_auth()
Later on, you have this code:
// Query for active users given an usermail.
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'user')
->propertyCondition('status', 1)
->propertyCondition('usermail', $usermail);
This will not work, because 'usermail' is not a thing and $usermail is not a defined variable. In Drupal, username is simply 'name' . I think this code should be:
// Query for active users given an username.
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'user')
->propertyCondition('status', 1)
->propertyCondition('name', $username);
In functions.php, onelogin_saml_auth: This currently returns 0 or 1: $matcher = variable_get('saml_options_account_matcher'); But the code expects 'username' or 'email' $matcher == 'username' is always false, so email is always used. Please change either the form code or the logic here in onelogin_saml_auth()
Later on, you have this code: // Query for active users given an usermail. $query = new EntityFieldQuery(); $query->entityCondition('entity_type', 'user') ->propertyCondition('status', 1) ->propertyCondition('usermail', $usermail);
This will not work, because 'usermail' is not a thing and $usermail is not a defined variable. In Drupal, username is simply 'name' . I think this code should be: