Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-adminpanel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
laravel-adminpanel
Commits
595f1cbe
Unverified
Commit
595f1cbe
authored
Apr 29, 2018
by
Viral Solani
Committed by
GitHub
Apr 29, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #215 from viralsolani/analysis-z4MYPk
Apply fixes from StyleCI
parents
c7921f4a
5aefb559
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
SessionTimeout.php
app/Http/Middleware/SessionTimeout.php
+5
-6
No files found.
app/Http/Middleware/SessionTimeout.php
View file @
595f1cbe
...
...
@@ -42,14 +42,13 @@ class SessionTimeout
{
//Cookie Name for when 'remember me' is checked
$remember_cookie
=
\Auth
::
guard
()
->
getRecallerName
();
if
(
!
Cookie
::
has
(
$remember_cookie
)
&&
config
(
'session.timeout_status'
))
{
if
(
!
Cookie
::
has
(
$remember_cookie
)
&&
config
(
'session.timeout_status'
))
{
$isLoggedIn
=
$request
->
path
()
!=
'/logout'
;
if
(
!
session
(
'lastActivityTime'
))
{
$this
->
session
->
put
(
'lastActivityTime'
,
time
());
}
else
if
(
time
()
-
$this
->
session
->
get
(
'lastActivityTime'
)
>
$this
->
timeout
)
{
}
elseif
(
time
()
-
$this
->
session
->
get
(
'lastActivityTime'
)
>
$this
->
timeout
)
{
$this
->
session
->
forget
(
'lastActivityTime'
);
$cookie
=
cookie
(
'intend'
,
$isLoggedIn
?
url
()
->
current
()
:
'admin/dashboard'
);
$email
=
$request
->
user
()
->
email
;
...
...
@@ -58,7 +57,7 @@ class SessionTimeout
return
redirect
()
->
route
(
'frontend.auth.login'
)
->
withFlashWarning
(
trans
(
'strings.backend.general.timeout'
)
.
$this
->
timeout
/
60
.
trans
(
'strings.backend.general.minutes'
))
->
withInput
(
compact
(
'email'
))
->
withCookie
(
$cookie
);
}
$isLoggedIn
?
$this
->
session
->
put
(
'lastActivityTime'
,
time
())
:
$this
->
session
->
forget
(
'lastActivityTime'
);
$isLoggedIn
?
$this
->
session
->
put
(
'lastActivityTime'
,
time
())
:
$this
->
session
->
forget
(
'lastActivityTime'
);
}
return
$next
(
$request
);
...
...
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