Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
62afdf3f
Commit
62afdf3f
authored
May 24, 2012
by
Colin Viebrock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow password field to be configured.
Signed-off-by:
Colin Viebrock
<
colin@viebrock.ca
>
parent
8edd8fcb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
5 deletions
+22
-5
auth.php
application/config/auth.php
+13
-0
eloquent.php
laravel/auth/drivers/eloquent.php
+4
-2
fluent.php
laravel/auth/drivers/fluent.php
+5
-3
No files found.
application/config/auth.php
View file @
62afdf3f
...
...
@@ -31,6 +31,19 @@ return array(
'username'
=>
'email'
,
/*
|--------------------------------------------------------------------------
| Authentication Password
|--------------------------------------------------------------------------
|
| Here you may specify the database column that should be considered the
| "password" for your users. Typically, this will be "password" but, again
| you're free to change the value to anything.
|
*/
'password'
=>
'password'
,
/*
|--------------------------------------------------------------------------
| Authentication Model
...
...
laravel/auth/drivers/eloquent.php
View file @
62afdf3f
...
...
@@ -15,7 +15,7 @@ class Eloquent extends Driver {
if
(
filter_var
(
$id
,
FILTER_VALIDATE_INT
)
!==
false
)
{
return
$this
->
model
()
->
find
(
$id
);
}
}
}
/**
...
...
@@ -35,7 +35,9 @@ class Eloquent extends Driver {
// log the user into the application and remember them if asked.
$password
=
$arguments
[
'password'
];
if
(
!
is_null
(
$user
)
and
Hash
::
check
(
$password
,
$user
->
password
))
$password_field
=
Config
::
get
(
'auth.password'
);
if
(
!
is_null
(
$user
)
and
Hash
::
check
(
$password
,
$user
->
get_attribute
(
$password_field
)))
{
return
$this
->
login
(
$user
->
id
,
array_get
(
$arguments
,
'remember'
));
}
...
...
laravel/auth/drivers/fluent.php
View file @
62afdf3f
...
...
@@ -19,7 +19,7 @@ class Fluent extends Driver {
if
(
filter_var
(
$id
,
FILTER_VALIDATE_INT
)
!==
false
)
{
return
DB
::
table
(
Config
::
get
(
'auth.table'
))
->
find
(
$id
);
}
}
}
/**
...
...
@@ -33,11 +33,13 @@ class Fluent extends Driver {
$user
=
$this
->
get_user
(
$arguments
[
'username'
]);
// This driver uses a basic username and password authentication scheme
// so if the credentials m
m
atch what is in the database we will just
// so if the credentials match what is in the database we will just
// log the user into the application and remember them if asked.
$password
=
$arguments
[
'password'
];
if
(
!
is_null
(
$user
)
and
Hash
::
check
(
$password
,
$user
->
password
))
$password_field
=
Config
::
get
(
'auth.password'
);
if
(
!
is_null
(
$user
)
and
Hash
::
check
(
$password
,
$user
->
get_attribute
(
$password_field
)))
{
return
$this
->
login
(
$user
->
id
,
array_get
(
$arguments
,
'remember'
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment