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
6abdb157
Commit
6abdb157
authored
Sep 23, 2014
by
crynobone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use tabs, always.
Signed-off-by:
crynobone
<
crynobone@gmail.com
>
parent
d45ff68f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
59 deletions
+59
-59
AuthFilter.php
app/Http/Filters/AuthFilter.php
+46
-46
GuestFilter.php
app/Http/Filters/GuestFilter.php
+7
-7
MaintenanceFilter.php
app/Http/Filters/MaintenanceFilter.php
+6
-6
No files found.
app/Http/Filters/AuthFilter.php
View file @
6abdb157
...
...
@@ -7,54 +7,54 @@ use Illuminate\Contracts\Routing\ResponseFactory;
class
AuthFilter
{
/**
* The authenticator implementation.
*
* @var Authenticator
*/
protected
$auth
;
/**
* The authenticator implementation.
*
* @var Authenticator
*/
protected
$auth
;
/**
* The response factory implementation.
*
* @var ResponseFactory
*/
protected
$response
;
/**
* The response factory implementation.
*
* @var ResponseFactory
*/
protected
$response
;
/**
* Create a new filter instance.
*
* @param Authenticator $auth
* @param ResponseFactory $response
* @return void
*/
public
function
__construct
(
Authenticator
$auth
,
ResponseFactory
$response
)
{
$this
->
auth
=
$auth
;
$this
->
response
=
$response
;
}
/**
* Create a new filter instance.
*
* @param Authenticator $auth
* @param ResponseFactory $response
* @return void
*/
public
function
__construct
(
Authenticator
$auth
,
ResponseFactory
$response
)
{
$this
->
auth
=
$auth
;
$this
->
response
=
$response
;
}
/**
* Run the request filter.
*
* @param \Illuminate\Routing\Route $route
* @param \Illuminate\Http\Request $request
* @return mixed
*/
public
function
filter
(
Route
$route
,
Request
$request
)
{
if
(
$this
->
auth
->
guest
())
{
if
(
$request
->
ajax
())
{
return
$this
->
response
->
make
(
'Unauthorized'
,
401
);
}
else
{
return
$this
->
response
->
redirectGuest
(
'auth/login'
);
}
}
}
/**
* Run the request filter.
*
* @param \Illuminate\Routing\Route $route
* @param \Illuminate\Http\Request $request
* @return mixed
*/
public
function
filter
(
Route
$route
,
Request
$request
)
{
if
(
$this
->
auth
->
guest
())
{
if
(
$request
->
ajax
())
{
return
$this
->
response
->
make
(
'Unauthorized'
,
401
);
}
else
{
return
$this
->
response
->
redirectGuest
(
'auth/login'
);
}
}
}
}
app/Http/Filters/GuestFilter.php
View file @
6abdb157
...
...
@@ -11,12 +11,12 @@ class GuestFilter {
*/
protected
$auth
;
/**
* The response factory implementation.
*
* @var ResponseFactory
*/
protected
$response
;
/**
* The response factory implementation.
*
* @var ResponseFactory
*/
protected
$response
;
/**
* Create a new filter instance.
...
...
@@ -25,7 +25,7 @@ class GuestFilter {
* @return void
*/
public
function
__construct
(
Authenticator
$auth
,
ResponseFacotry
$response
)
ResponseFacotry
$response
)
{
$this
->
auth
=
$auth
;
$this
->
response
=
$response
;
...
...
app/Http/Filters/MaintenanceFilter.php
View file @
6abdb157
...
...
@@ -12,12 +12,12 @@ class MaintenanceFilter {
*/
protected
$app
;
/**
* The response factory implementation.
*
* @var ResponseFactory
*/
protected
$response
;
/**
* The response factory implementation.
*
* @var ResponseFactory
*/
protected
$response
;
/**
* Create a new filter instance.
...
...
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