Skip to content

Commit

Permalink
Merge pull request #16 from strebl/fix-15
Browse files Browse the repository at this point in the history
Fix #15 - ErrorException if you try to login an account that don't exist and primarygroup is set to true
  • Loading branch information
strebl committed Jul 17, 2015
2 parents b74dec1 + a6d023b commit 3cc8d5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/LdapAuthUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ protected function getPrimaryGroup($groupList)
{
$groups = explode(',', $groupList);

return substr($groups[1], '3');
return isset($groups[1]) ? substr($groups[1], '3') : null;
}

/**
Expand Down
3 changes: 2 additions & 1 deletion tests/LdapAuthUserProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public function setUp()

$this->config = [
'fields' => [
'groups' => 'groups',
'groups' => 'groups',
'primarygroup' => 'primarygroup',
],
'userlist' => false,
'group' => [],
Expand Down

0 comments on commit 3cc8d5a

Please sign in to comment.