Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
docker
osticket
Commits
d16d8c18
Commit
d16d8c18
authored
12 years ago
by
Peter Rotich
Browse files
Options
Downloads
Patches
Plain Diff
CSRF protect logout links
parent
7a2768a3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
include/client/header.inc.php
+1
-1
1 addition, 1 deletion
include/client/header.inc.php
include/staff/header.inc.php
+1
-1
1 addition, 1 deletion
include/staff/header.inc.php
logout.php
+4
-1
4 additions, 1 deletion
logout.php
scp/logout.php
+3
-3
3 additions, 3 deletions
scp/logout.php
with
9 additions
and
6 deletions
include/client/header.inc.php
+
1
−
1
View file @
d16d8c18
...
@@ -30,7 +30,7 @@ header("Content-Type: text/html; charset=UTF-8\r\n");
...
@@ -30,7 +30,7 @@ header("Content-Type: text/html; charset=UTF-8\r\n");
<a
href=
"
<?php
echo
ROOT_PATH
;
?>
tickets.php"
>
My Tickets
<b>
(
<?php
echo
$thisclient
->
getNumTickets
();
?>
)
</b></a>
-
<a
href=
"
<?php
echo
ROOT_PATH
;
?>
tickets.php"
>
My Tickets
<b>
(
<?php
echo
$thisclient
->
getNumTickets
();
?>
)
</b></a>
-
<?php
<?php
}
?>
}
?>
<a
href=
"
<?php
echo
ROOT_PATH
;
?>
logout.php"
>
Log Out
</a>
<a
href=
"
<?php
echo
ROOT_PATH
;
?>
logout.php
?auth=
<?php
echo
$ost
->
getLinkToken
();
?>
"
>
Log Out
</a>
<?php
<?php
}
elseif
(
$nav
){
?>
}
elseif
(
$nav
){
?>
Guest User -
<a
href=
"
<?php
echo
ROOT_PATH
;
?>
login.php"
>
Log In
</a>
Guest User -
<a
href=
"
<?php
echo
ROOT_PATH
;
?>
login.php"
>
Log In
</a>
...
...
This diff is collapsed.
Click to expand it.
include/staff/header.inc.php
+
1
−
1
View file @
d16d8c18
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
|
<a
href=
"index.php"
>
Staff Panel
</a>
|
<a
href=
"index.php"
>
Staff Panel
</a>
<?php
}
?>
<?php
}
?>
|
<a
href=
"profile.php"
>
My Preferences
</a>
|
<a
href=
"profile.php"
>
My Preferences
</a>
|
<a
href=
"logout.php?auth=
<?php
echo
md5
(
$ost
->
get
CSRF
Token
()
.
SECRET_SALT
.
session_id
())
;
?>
"
>
Log Out
</a>
|
<a
href=
"logout.php?auth=
<?php
echo
$ost
->
get
Link
Token
();
?>
"
>
Log Out
</a>
</p>
</p>
</div>
</div>
<ul
id=
"nav"
>
<ul
id=
"nav"
>
...
...
This diff is collapsed.
Click to expand it.
logout.php
+
4
−
1
View file @
d16d8c18
...
@@ -15,7 +15,10 @@
...
@@ -15,7 +15,10 @@
**********************************************************************/
**********************************************************************/
require
(
'client.inc.php'
);
require
(
'client.inc.php'
);
//We are checking to make sure the user is logged in before a logout to avoid session reset tricks on excess logins
//Check token: Make sure the user actually clicked on the link to logout.
if
(
!
$_GET
[
'auth'
]
||
!
$ost
->
validateLinkToken
(
$_GET
[
'auth'
]))
@
header
(
'Location: index.php'
);
$_SESSION
[
'_client'
]
=
array
();
$_SESSION
[
'_client'
]
=
array
();
session_unset
();
session_unset
();
session_destroy
();
session_destroy
();
...
...
This diff is collapsed.
Click to expand it.
scp/logout.php
+
3
−
3
View file @
d16d8c18
...
@@ -15,9 +15,9 @@
...
@@ -15,9 +15,9 @@
vim: expandtab sw=4 ts=4 sts=4:
vim: expandtab sw=4 ts=4 sts=4:
**********************************************************************/
**********************************************************************/
require
(
'staff.inc.php'
);
require
(
'staff.inc.php'
);
//C
SRF Check
: Make sure the user actually clicked on the link to logout.
//C
heck token
: Make sure the user actually clicked on the link to logout.
if
(
!
$_GET
[
'auth'
]
||
$_GET
[
'auth'
]
!=
md5
(
$ost
->
getCSRFToken
()
.
SECRET_SALT
.
session_id
()
))
if
(
!
$_GET
[
'auth'
]
||
!
$ost
->
validateLinkToken
(
$_GET
[
'auth'
]
))
@
header
(
'Location: index.php'
);
@
header
(
'Location: index.php'
);
$ost
->
logDebug
(
'Staff logout'
,
$ost
->
logDebug
(
'Staff logout'
,
sprintf
(
"%s logged out [%s]"
,
sprintf
(
"%s logged out [%s]"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment