mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 09:03:21 +00:00 
			
		
		
		
	Ticket
This commit is contained in:
		| @@ -117,6 +117,7 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { | |||||||
|     public MySQLAuthenticationProvider() throws GuacamoleException { |     public MySQLAuthenticationProvider() throws GuacamoleException { | ||||||
|  |  | ||||||
|         final Properties myBatisProperties = new Properties(); |         final Properties myBatisProperties = new Properties(); | ||||||
|  |         final Properties driverProperties = new Properties(); | ||||||
|  |  | ||||||
|         // Set the mysql properties for MyBatis. |         // Set the mysql properties for MyBatis. | ||||||
|         myBatisProperties.setProperty("mybatis.environment.id", "guacamole"); |         myBatisProperties.setProperty("mybatis.environment.id", "guacamole"); | ||||||
| @@ -126,6 +127,7 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { | |||||||
|         myBatisProperties.setProperty("JDBC.username", GuacamoleProperties.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_USERNAME)); |         myBatisProperties.setProperty("JDBC.username", GuacamoleProperties.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_USERNAME)); | ||||||
|         myBatisProperties.setProperty("JDBC.password", GuacamoleProperties.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_PASSWORD)); |         myBatisProperties.setProperty("JDBC.password", GuacamoleProperties.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_PASSWORD)); | ||||||
|         myBatisProperties.setProperty("JDBC.autoCommit", "false"); |         myBatisProperties.setProperty("JDBC.autoCommit", "false"); | ||||||
|  |         driverProperties.setProperty("characterEncoding","UTF-8"); | ||||||
|  |  | ||||||
|         // Set up Guice injector. |         // Set up Guice injector. | ||||||
|         injector = Guice.createInjector( |         injector = Guice.createInjector( | ||||||
| @@ -135,6 +137,9 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { | |||||||
|                 @Override |                 @Override | ||||||
|                 public void configure(Binder binder) { |                 public void configure(Binder binder) { | ||||||
|                     Names.bindProperties(binder, myBatisProperties); |                     Names.bindProperties(binder, myBatisProperties); | ||||||
|  |                     binder.bind(Properties.class) | ||||||
|  |                         .annotatedWith(Names.named("JDBC.driverProperties")) | ||||||
|  |                         .toInstance(driverProperties); | ||||||
|                 } |                 } | ||||||
|             }, |             }, | ||||||
|  |  | ||||||
|   | |||||||
| @@ -20,6 +20,7 @@ package net.sourceforge.guacamole.net.basic; | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| import java.io.IOException; | import java.io.IOException; | ||||||
|  | import java.io.UnsupportedEncodingException; | ||||||
| import java.util.Collection; | import java.util.Collection; | ||||||
| import javax.servlet.ServletException; | import javax.servlet.ServletException; | ||||||
| import javax.servlet.http.HttpServlet; | import javax.servlet.http.HttpServlet; | ||||||
| @@ -227,6 +228,15 @@ public abstract class AuthenticatingHttpServlet extends HttpServlet { | |||||||
|     protected void service(HttpServletRequest request, HttpServletResponse response) |     protected void service(HttpServletRequest request, HttpServletResponse response) | ||||||
|     throws IOException, ServletException { |     throws IOException, ServletException { | ||||||
|          |          | ||||||
|  |         // Set character encoding to UTF-8 if it's not already set | ||||||
|  |         if(request.getCharacterEncoding() == null) { | ||||||
|  |             try { | ||||||
|  |                 request.setCharacterEncoding("UTF-8"); | ||||||
|  |             } catch (UnsupportedEncodingException exception) { | ||||||
|  |                throw new ServletException(exception); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |  | ||||||
|         HttpSession httpSession = request.getSession(true); |         HttpSession httpSession = request.getSession(true); | ||||||
|  |  | ||||||
|         // Try to get user context from session |         // Try to get user context from session | ||||||
|   | |||||||
| @@ -93,6 +93,9 @@ public class List extends AuthenticatingHttpServlet { | |||||||
|         // Write XML content type |         // Write XML content type | ||||||
|         response.setHeader("Content-Type", "text/xml"); |         response.setHeader("Content-Type", "text/xml"); | ||||||
|          |          | ||||||
|  |         // Set encoding | ||||||
|  |         response.setCharacterEncoding("UTF-8"); | ||||||
|  |  | ||||||
|         // Get connection directory |         // Get connection directory | ||||||
|         Directory<String, Connection> directory = context.getConnectionDirectory(); |         Directory<String, Connection> directory = context.getConnectionDirectory(); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -102,6 +102,9 @@ public class List extends AuthenticatingHttpServlet { | |||||||
|         // Do not cache |         // Do not cache | ||||||
|         response.setHeader("Cache-Control", "no-cache"); |         response.setHeader("Cache-Control", "no-cache"); | ||||||
|          |          | ||||||
|  |         // Set encoding | ||||||
|  |         response.setCharacterEncoding("UTF-8"); | ||||||
|  |  | ||||||
|         // Write actual XML |         // Write actual XML | ||||||
|         try { |         try { | ||||||
|  |  | ||||||
|   | |||||||
| @@ -200,6 +200,9 @@ public class List extends AuthenticatingHttpServlet { | |||||||
|         // Do not cache |         // Do not cache | ||||||
|         response.setHeader("Cache-Control", "no-cache"); |         response.setHeader("Cache-Control", "no-cache"); | ||||||
|          |          | ||||||
|  |         // Set encoding | ||||||
|  |         response.setCharacterEncoding("UTF-8"); | ||||||
|  |  | ||||||
|         // Map of all available protocols |         // Map of all available protocols | ||||||
|         Map<String, ProtocolInfo> protocols = new HashMap<String, ProtocolInfo>(); |         Map<String, ProtocolInfo> protocols = new HashMap<String, ProtocolInfo>(); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -51,6 +51,9 @@ public class List extends AuthenticatingHttpServlet { | |||||||
|         // Write XML content type |         // Write XML content type | ||||||
|         response.setHeader("Content-Type", "text/xml"); |         response.setHeader("Content-Type", "text/xml"); | ||||||
|          |          | ||||||
|  |         // Set encoding | ||||||
|  |         response.setCharacterEncoding("UTF-8"); | ||||||
|  |  | ||||||
|         // Write actual XML |         // Write actual XML | ||||||
|         try { |         try { | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user