Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Commit

Permalink
Merge pull request #111 from Adldap2/analysis-8b0a2a
Browse files Browse the repository at this point in the history
Applied fixes from StyleCI
  • Loading branch information
stevebauman committed May 22, 2016
2 parents 51f4ca4 + 73d1fd2 commit ff97b61
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/AdldapAuthUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ protected function authenticate($username, $password)
protected function authenticateWithCredentials(array $credentials = [])
{
$username = $this->getUsernameFromCredentials($credentials);

// Make sure we're connected to our LDAP server before we run any operations.
if ($this->isConnected() && !empty($username)) {
// Due to having the ability of choosing which attribute we login users
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/ImportsUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ protected function getAdldap($provider = null)
protected function getUsernameFromAdUser(User $user)
{
$username = $user->{$this->getLoginAttribute()};

if (is_array($username)) {
// We'll make sure we retrieve the users first username
// attribute if it's contained in an array.
Expand Down
16 changes: 8 additions & 8 deletions tests/AdldapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Adldap\Laravel\Tests;

use Adldap\Models\User;
use Adldap\Connections\Ldap;
use Adldap\Contracts\AdldapInterface;
use Adldap\Laravel\Facades\Adldap;
use Adldap\Laravel\Tests\Models\User as EloquentUser;
use Adldap\Models\User;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
Expand Down Expand Up @@ -40,8 +40,8 @@ public function test_auth_passes($credentials = null)
$credentials = $credentials ?: ['email' => '[email protected]', 'password' => '12345'];

$user = $this->getMockUser([
'cn' => '',
'mail' => '[email protected]',
'cn' => '',
'mail' => '[email protected]',
'samaccountname' => 'jdoe',
]);

Expand Down Expand Up @@ -90,8 +90,8 @@ public function test_auth_passes_without_persistent_adldap_user()
public function test_auth_fails_when_user_found()
{
$user = $this->getMockUser([
'cn' => '',
'mail' => '[email protected]',
'cn' => '',
'mail' => '[email protected]',
'samaccountname' => 'jdoe',
]);

Expand Down Expand Up @@ -229,8 +229,8 @@ public function test_config_password_sync_disabled()
$this->app['config']->set('adldap_auth.password_sync', false);

$user = $this->getMockUser([
'cn' => '',
'mail' => '[email protected]',
'cn' => '',
'mail' => '[email protected]',
'samaccountname' => 'jdoe',
]);

Expand Down Expand Up @@ -258,7 +258,7 @@ public function test_config_password_sync_disabled()
$this->assertTrue(Auth::attempt(compact('email', 'password')));

$user = Auth::user();

// This check will fail due to password synchronization being disabled.
$this->assertFalse(Hash::check($password, $user->password));
}
Expand Down

0 comments on commit ff97b61

Please sign in to comment.