mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 14:35:52 +01:00
Fix TODO
This commit is contained in:
@@ -36,18 +36,16 @@ abstract class ControllerBase extends ScalatraFilter
|
|||||||
|
|
||||||
if(path.startsWith("/console/")){
|
if(path.startsWith("/console/")){
|
||||||
val account = httpRequest.getSession.getAttribute(Keys.Session.LoginAccount).asInstanceOf[Account]
|
val account = httpRequest.getSession.getAttribute(Keys.Session.LoginAccount).asInstanceOf[Account]
|
||||||
|
val baseUrl = this.baseUrl(httpRequest)
|
||||||
if(account == null){
|
if(account == null){
|
||||||
// Redirect to login form
|
// Redirect to login form
|
||||||
// TODO Should use the configured base url.
|
httpResponse.sendRedirect(baseUrl + "/signin?redirect=" + StringUtil.urlEncode(path))
|
||||||
httpResponse.sendRedirect(context + "/signin?" + StringUtil.urlEncode(path))
|
|
||||||
} else if(account.isAdmin){
|
} else if(account.isAdmin){
|
||||||
// H2 Console (administrators only)
|
// H2 Console (administrators only)
|
||||||
// TODO Should use the configured base url.
|
|
||||||
chain.doFilter(request, response)
|
chain.doFilter(request, response)
|
||||||
} else {
|
} else {
|
||||||
// Redirect to dashboard
|
// Redirect to dashboard
|
||||||
// TODO Should use the configured base url.
|
httpResponse.sendRedirect(baseUrl + "/")
|
||||||
httpResponse.sendRedirect(context + "/")
|
|
||||||
}
|
}
|
||||||
} else if(path.startsWith("/git/")){
|
} else if(path.startsWith("/git/")){
|
||||||
// Git repository
|
// Git repository
|
||||||
|
|||||||
Reference in New Issue
Block a user