Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ARSnova Backend
Manage
Activity
Members
Labels
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
Paul-Christian Volkmer
ARSnova Backend
Commits
7ddbd438
There was an error fetching the commit references. Please try again later.
Commit
7ddbd438
authored
12 years ago
by
Daniel Gerhardt
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'dgrh99/master'
parents
01c6b6f9
445fe267
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/thm/arsnova/controller/LoginController.java
+10
-1
10 additions, 1 deletion
src/main/java/de/thm/arsnova/controller/LoginController.java
with
10 additions
and
1 deletion
src/main/java/de/thm/arsnova/controller/LoginController.java
+
10
−
1
View file @
7ddbd438
...
...
@@ -42,6 +42,7 @@ import org.springframework.security.core.authority.SimpleGrantedAuthority;
import
org.springframework.security.core.context.SecurityContextHolder
;
import
org.springframework.security.core.token.Sha512DigestUtils
;
import
org.springframework.security.web.context.HttpSessionSecurityContextRepository
;
import
org.springframework.security.web.util.UrlUtils
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
...
...
@@ -79,10 +80,18 @@ public class LoginController extends AbstractController {
public
final
View
doLogin
(
@RequestParam
(
"type"
)
final
String
type
,
@RequestParam
(
value
=
"user"
,
required
=
false
)
final
String
guestName
,
@RequestParam
(
value
=
"referer"
,
required
=
false
)
final
String
forcedReferer
,
final
HttpServletRequest
request
,
final
HttpServletResponse
response
)
throws
IOException
,
ServletException
{
String
referer
=
request
.
getHeader
(
"referer"
);
if
(
referer
==
null
)
{
/* Use a url from a request parameter as referer as long as the url is not absolute (to prevent
* abuse of the redirection). */
if
(
null
==
(
referer
=
forcedReferer
)
||
UrlUtils
.
isAbsoluteUrl
(
referer
))
{
referer
=
"/"
;
}
}
request
.
getSession
().
setAttribute
(
"ars-referer"
,
referer
);
if
(
"cas"
.
equals
(
type
))
{
casEntryPoint
.
commence
(
request
,
response
,
null
);
...
...
@@ -113,7 +122,7 @@ public class LoginController extends AbstractController {
SecurityContextHolder
.
getContext
().
setAuthentication
(
token
);
request
.
getSession
(
true
).
setAttribute
(
HttpSessionSecurityContextRepository
.
SPRING_SECURITY_CONTEXT_KEY
,
SecurityContextHolder
.
getContext
());
return
new
RedirectView
(
(
referer
!=
null
?
referer
:
"/"
)
+
"#auth/checkLogin"
);
return
new
RedirectView
(
referer
+
"#auth/checkLogin"
);
}
return
null
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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