mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-02 19:45:51 +01:00
use client messages
This commit is contained in:
@@ -38,6 +38,7 @@ import com.google.inject.Singleton;
|
||||
|
||||
import org.eclipse.jgit.http.server.GitSmartHttpTools;
|
||||
|
||||
import sonia.scm.ClientMessages;
|
||||
import sonia.scm.config.ScmConfiguration;
|
||||
import sonia.scm.repository.GitUtil;
|
||||
import sonia.scm.web.filter.AutoLoginModule;
|
||||
@@ -60,12 +61,6 @@ import javax.servlet.http.HttpServletResponse;
|
||||
public class GitBasicAuthenticationFilter extends BasicAuthenticationFilter
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
private static final String MESSAGE_FAILED_AUTHENTICATION =
|
||||
"Invalid username or password.";
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
@@ -96,10 +91,12 @@ public class GitBasicAuthenticationFilter extends BasicAuthenticationFilter
|
||||
HttpServletResponse response)
|
||||
throws IOException
|
||||
{
|
||||
System.out.println(ClientMessages.get(request).failedAuthentication());
|
||||
if (GitUtil.isGitClient(request))
|
||||
{
|
||||
GitSmartHttpTools.sendError(request, response,
|
||||
HttpServletResponse.SC_FORBIDDEN, MESSAGE_FAILED_AUTHENTICATION);
|
||||
HttpServletResponse.SC_FORBIDDEN,
|
||||
ClientMessages.get(request).failedAuthentication());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -40,6 +40,7 @@ import com.google.inject.Singleton;
|
||||
|
||||
import org.eclipse.jgit.http.server.GitSmartHttpTools;
|
||||
|
||||
import sonia.scm.ClientMessages;
|
||||
import sonia.scm.config.ScmConfiguration;
|
||||
import sonia.scm.repository.GitUtil;
|
||||
import sonia.scm.repository.RepositoryProvider;
|
||||
@@ -72,10 +73,6 @@ public class GitPermissionFilter extends ProviderPermissionFilter
|
||||
/** Field description */
|
||||
public static final String URI_REF_INFO = "/info/refs";
|
||||
|
||||
/** Field description */
|
||||
private static final String MESSAGE_NOT_ENOUGH_PRIVILEGES =
|
||||
"You do not have enough access privileges for this operation.";
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
/**
|
||||
@@ -110,7 +107,8 @@ public class GitPermissionFilter extends ProviderPermissionFilter
|
||||
if (GitUtil.isGitClient(request))
|
||||
{
|
||||
GitSmartHttpTools.sendError(request, response,
|
||||
HttpServletResponse.SC_FORBIDDEN, MESSAGE_NOT_ENOUGH_PRIVILEGES);
|
||||
HttpServletResponse.SC_FORBIDDEN,
|
||||
ClientMessages.get(request).notEnoughPrivileges());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user