Skip to content

Commit

Permalink
Added some minor changes to PR #26
Browse files Browse the repository at this point in the history
  • Loading branch information
SaschaDens committed Dec 12, 2015
1 parent 49d5d99 commit b09c744
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Laravel documentation: [Authentication Quickstart](http://laravel.com/docs/maste
- `Auth::user()->inGroup('GROUPNAME')` returns `boolean` if user belongs to `GROUPNAME`

### Ldap User Information
- `Auth::user()->getUsername()` returns authenticated users username.
- `Auth::user()->getFirstname()` returns authenticated users first name.
- `Auth::user()->getLastname()` returns authenticated users last name.
- `Auth::user()->getEmail()` returns authenticated users email address.
- `Auth::user()->getUsername()` returns authenticated username.
- `Auth::user()->getFirstname()` returns authenticated first name.
- `Auth::user()->getLastname()` returns authenticated last name.
- `Auth::user()->getEmail()` returns authenticated email address.
7 changes: 4 additions & 3 deletions src/Dsdevbe/LdapConnector/Adapter/Adldap.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Dsdevbe\LdapConnector\Adapter;

use adLDAP\adLDAP as adLDAPService;
use adLDAP\collections\adLDAPUserCollection as adLDAPUserCollection;
use Dsdevbe\LdapConnector\Model\User as UserModel;

class Adldap implements LdapInterface
Expand All @@ -13,7 +14,7 @@ class Adldap implements LdapInterface

protected $_password;

protected function mapDataToUserModel($user, array $groups)
protected function mapDataToUserModel(adLDAPUserCollection $user, array $groups)
{
$model = new UserModel([
'username' => $user->samaccountname,
Expand Down Expand Up @@ -54,7 +55,7 @@ public function connect($username, $password)
*/
public function isConnected()
{
return !!$this->_ldap->getLdapBind();
return (bool) $this->_ldap->getLdapBind();
}

/**
Expand All @@ -64,7 +65,7 @@ public function isConnected()
*/
public function getUserInfo($username)
{
$user = $this->_ldap->user()->infoCollection($username, ['samaccountname','givenname','sn','mail']);
$user = $this->_ldap->user()->infoCollection($username, ['samaccountname', 'givenname', 'sn', 'mail']);

if (!$user) {
return;
Expand Down
4 changes: 2 additions & 2 deletions src/Dsdevbe/LdapConnector/Adapter/LdapInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
interface LdapInterface
{
/**
* @param String $username
* @param String $password
* @param string $username
* @param string $password
*
* @return bool
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Dsdevbe/LdapConnector/LdapConnectorServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class LdapConnectorServiceProvider extends ServiceProvider
*/
public function boot()
{
Auth::extend('ldap', function ($app) {
Auth::extend('ldap', function($app) {
$ldap = new Adldap(
$this->getLdapAdapterConfig('adldap')
);
Expand All @@ -40,7 +40,7 @@ public function boot()
*/
public function register()
{
$ldapConfig = __DIR__.'/Config/ldap.php';
$ldapConfig = __DIR__ . '/Config/ldap.php';
$this->publishConfig($ldapConfig);
}

Expand Down
1 change: 0 additions & 1 deletion src/Dsdevbe/LdapConnector/Model/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,4 @@ public function getEmail()
{
return $this->_user['email'];
}

}

0 comments on commit b09c744

Please sign in to comment.