Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
9dd964c3
Commit
9dd964c3
authored
Jul 09, 2012
by
Jeffrey Way
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend Auth::laravel to accept multiple params to verify
Signed-off-by: Jeffrey Way <jeffrey@envato.com>
parent
ebcbbbb8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
10 deletions
+22
-10
laravel/auth/drivers/eloquent.php
+9
-3
laravel/auth/drivers/fluent.php
+13
-7
No files found.
laravel/auth/drivers/eloquent.php
View file @
9dd964c3
...
...
@@ -26,12 +26,18 @@ class Eloquent extends Driver {
*/
public
function
attempt
(
$arguments
=
array
())
{
$user
=
$this
->
model
()
->
where
(
function
(
$query
)
use
(
$arguments
)
{
$username
=
Config
::
get
(
'auth.username'
);
$user
=
$this
->
model
()
->
where
(
$username
,
'='
,
$arguments
[
'username'
])
->
first
(
);
$query
->
where
(
$username
,
'='
,
$arguments
[
'username'
]
);
// This driver uses a basic username and password authentication scheme
// so if the credentials match what is in the database we will just
foreach
(
array_except
(
$arguments
,
array
(
'username'
,
'password'
))
as
$column
=>
$val
)
{
$query
->
where
(
$column
,
'='
,
$val
);
}
})
->
first
();
// 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'
];
...
...
laravel/auth/drivers/fluent.php
View file @
9dd964c3
...
...
@@ -30,10 +30,9 @@ class Fluent extends Driver {
*/
public
function
attempt
(
$arguments
=
array
())
{
$user
=
$this
->
get_user
(
$arguments
[
'username'
]
);
$user
=
$this
->
get_user
(
$arguments
);
// This driver uses a basic username and password authentication scheme
// so if the credentials match what is in the database we will just
// 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'
];
...
...
@@ -48,18 +47,25 @@ class Fluent extends Driver {
}
/**
* Get the user from the database table
by username
.
* Get the user from the database table.
*
* @param mixed $
value
* @param mixed $
array
* @return mixed
*/
protected
function
get_user
(
$
value
)
protected
function
get_user
(
$
arguments
)
{
$table
=
Config
::
get
(
'auth.table'
);
return
DB
::
table
(
$table
)
->
where
(
function
(
$query
)
use
(
$arguments
)
{
$username
=
Config
::
get
(
'auth.username'
);
return
DB
::
table
(
$table
)
->
where
(
$username
,
'='
,
$value
)
->
first
();
$query
->
where
(
$username
,
'='
,
$arguments
[
'username'
]);
foreach
(
array_except
(
$arguments
,
array
(
'username'
,
'password'
))
as
$column
=>
$val
)
{
$query
->
where
(
$column
,
'='
,
$val
);
}
})
->
first
();
}
}
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