PHP Trait Adldap\Laravel\Traits\ImportsUsers

Show file Open project: adldap2/adldap2-laravel

Public Methods

Method Description
createModel ( ) : Model Returns the authentication users model instance.

Protected Methods

Method Description
bindAdldapToModel ( User $user, Model $model ) : Model Binds the Adldap User instance to the Eloquent model instance by setting its adldapUser public property.
findOrCreateModelFromAdldap ( User $user ) : Model Finds an Eloquent model from the specified Adldap user.
getBindUserToModel ( ) : boolean Returns the configured bind user to model option for binding the Adldap user model instance to the laravel model.
getModelFromAdldap ( User $user, string | null $password = null ) : Model Returns an existing or new Eloquent user from the specified Adldap user instance.
getOnlyAllowImportedUsers ( ) : mixed Returns the configured option for only allowing manually imported users to authenticate.
getPasswordSync ( ) : boolean Returns the configured password sync configuration option.
getSyncAttributes ( ) : array Returns the configured sync attributes for filling the Laravel user model with active directory fields.
handleAttributeCallback ( User $user, string $callback ) : mixed Handles retrieving the value from an attribute callback.
handleAttributeRetrieval ( User $user, string $field ) : string | null Handles retrieving the specified field from the User model.
isAttributeCallback ( string $string ) : boolean Returns true / false if the specified string is a callback for an attribute handler.
newEloquentQuery ( string $key, string $username ) : Builder Returns a new Eloquent user query.
syncModelFromAdldap ( User $user, Model $model ) : Model Fills a models attributes by the specified Users attributes.
syncModelPassword ( Model $model, string $password ) : Model Syncs the models password with the specified password.

Method Details

bindAdldapToModel() protected method

Binds the Adldap User instance to the Eloquent model instance by setting its adldapUser public property.
protected bindAdldapToModel ( User $user, Model $model ) : Model
$user Adldap\Models\User
$model Illuminate\Database\Eloquent\Model
return Illuminate\Database\Eloquent\Model

createModel() abstract public method

Returns the authentication users model instance.
abstract public createModel ( ) : Model
return Illuminate\Database\Eloquent\Model

findOrCreateModelFromAdldap() protected method

Finds an Eloquent model from the specified Adldap user.
protected findOrCreateModelFromAdldap ( User $user ) : Model
$user Adldap\Models\User
return Illuminate\Database\Eloquent\Model

getBindUserToModel() protected method

Returns the configured bind user to model option for binding the Adldap user model instance to the laravel model.
protected getBindUserToModel ( ) : boolean
return boolean

getModelFromAdldap() protected method

Returns an existing or new Eloquent user from the specified Adldap user instance.
protected getModelFromAdldap ( User $user, string | null $password = null ) : Model
$user Adldap\Models\User
$password string | null
return Illuminate\Database\Eloquent\Model

getOnlyAllowImportedUsers() protected method

Returns the configured option for only allowing manually imported users to authenticate.
protected getOnlyAllowImportedUsers ( ) : mixed
return mixed

getPasswordSync() protected method

Returns the configured password sync configuration option.
protected getPasswordSync ( ) : boolean
return boolean

getSyncAttributes() protected method

Returns the configured sync attributes for filling the Laravel user model with active directory fields.
protected getSyncAttributes ( ) : array
return array

handleAttributeCallback() protected method

Handles retrieving the value from an attribute callback.
protected handleAttributeCallback ( User $user, string $callback ) : mixed
$user Adldap\Models\User
$callback string
return mixed

handleAttributeRetrieval() protected method

Handles retrieving the specified field from the User model.
protected handleAttributeRetrieval ( User $user, string $field ) : string | null
$user Adldap\Models\User
$field string
return string | null

isAttributeCallback() protected method

Returns true / false if the specified string is a callback for an attribute handler.
protected isAttributeCallback ( string $string ) : boolean
$string string
return boolean

newEloquentQuery() protected method

Returns a new Eloquent user query.
protected newEloquentQuery ( string $key, string $username ) : Builder
$key string
$username string
return Illuminate\Database\Eloquent\Builder

syncModelFromAdldap() protected method

Fills a models attributes by the specified Users attributes.
protected syncModelFromAdldap ( User $user, Model $model ) : Model
$user Adldap\Models\User
$model Illuminate\Database\Eloquent\Model
return Illuminate\Database\Eloquent\Model

syncModelPassword() protected method

Syncs the models password with the specified password.
protected syncModelPassword ( Model $model, string $password ) : Model
$model Illuminate\Database\Eloquent\Model
$password string
return Illuminate\Database\Eloquent\Model