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
0d2cfd24
Commit
0d2cfd24
authored
Jul 11, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor Auth class to use Auth config closures.
parent
9ec8f4a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
14 deletions
+2
-14
auth.php
system/auth.php
+2
-14
No files found.
system/auth.php
View file @
0d2cfd24
...
...
@@ -42,7 +42,7 @@ class Auth {
if
(
is_null
(
static
::
$user
)
and
Session
::
has
(
static
::
$key
))
{
static
::
$user
=
forward_static_call
(
array
(
static
::
model
(),
'fin
d'
),
Session
::
get
(
static
::
$key
));
static
::
$user
=
call_user_func
(
Config
::
get
(
'auth.by_i
d'
),
Session
::
get
(
static
::
$key
));
}
return
static
::
$user
;
...
...
@@ -59,9 +59,7 @@ class Auth {
*/
public
static
function
login
(
$username
,
$password
)
{
$user
=
forward_static_call
(
array
(
static
::
model
(),
'where'
),
Config
::
get
(
'auth.username'
),
'='
,
$username
)
->
first
();
if
(
!
is_null
(
$user
))
if
(
!
is_null
(
$user
=
call_user_func
(
Config
::
get
(
'auth.by_username'
),
$username
)))
{
if
(
Hash
::
check
(
$password
,
$user
->
password
))
{
...
...
@@ -88,14 +86,4 @@ class Auth {
static
::
$user
=
null
;
}
/**
* Get the authentication model.
*
* @return string
*/
private
static
function
model
()
{
return
'\\'
.
Config
::
get
(
'auth.model'
);
}
}
\ No newline at end of file
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