onelogin / drupal-saml

MIT License
14 stars 17 forks source link

Not correctly matching Drupal accounts by username #7

Closed cagedartist closed 9 years ago

cagedartist commented 9 years ago

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);
pitbulk commented 9 years ago

Thanks for report this issue, I will take a look on this tomorrow