From 97c2e3ceb91a9366816ecdf3c2fbe59c2782c265 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 25 Feb 2013 02:07:45 -0800 Subject: [PATCH] Ticket #269: Clean up MySQLUser, handle null username. Move mybatis XMLs to proper package within resources, fix SQL syntax (guacamole.TABLE, not guacamole..TABLE - likely need to fix generator). --- .../mysql/MySQLAuthenticationProvider.java | 5 ++++ .../guacamole/net/auth/mysql/MySQLUser.java | 30 ++++++++++++++----- .../mysql/dao}/ConnectionHistoryMapper.xml | 22 +++++++------- .../net/auth/mysql/dao}/ConnectionMapper.xml | 22 +++++++------- .../mysql/dao}/ConnectionParameterMapper.xml | 22 +++++++------- .../mysql/dao}/ConnectionPermissionMapper.xml | 16 +++++----- .../mysql/dao}/SystemPermissionMapper.xml | 16 +++++----- .../net/auth/mysql/dao}/UserMapper.xml | 28 ++++++++--------- .../auth/mysql/dao}/UserPermissionMapper.xml | 16 +++++----- 9 files changed, 98 insertions(+), 79 deletions(-) rename extensions/guacamole-auth-mysql/src/main/{java/net/sourceforge/guacamole/net/auth/mysql/xml => resources/net/sourceforge/guacamole/net/auth/mysql/dao}/ConnectionHistoryMapper.xml (94%) rename extensions/guacamole-auth-mysql/src/main/{java/net/sourceforge/guacamole/net/auth/mysql/xml => resources/net/sourceforge/guacamole/net/auth/mysql/dao}/ConnectionMapper.xml (94%) rename extensions/guacamole-auth-mysql/src/main/{java/net/sourceforge/guacamole/net/auth/mysql/xml => resources/net/sourceforge/guacamole/net/auth/mysql/dao}/ConnectionParameterMapper.xml (93%) rename extensions/guacamole-auth-mysql/src/main/{java/net/sourceforge/guacamole/net/auth/mysql/xml => resources/net/sourceforge/guacamole/net/auth/mysql/dao}/ConnectionPermissionMapper.xml (94%) rename extensions/guacamole-auth-mysql/src/main/{java/net/sourceforge/guacamole/net/auth/mysql/xml => resources/net/sourceforge/guacamole/net/auth/mysql/dao}/SystemPermissionMapper.xml (94%) rename extensions/guacamole-auth-mysql/src/main/{java/net/sourceforge/guacamole/net/auth/mysql/xml => resources/net/sourceforge/guacamole/net/auth/mysql/dao}/UserMapper.xml (95%) rename extensions/guacamole-auth-mysql/src/main/{java/net/sourceforge/guacamole/net/auth/mysql/xml => resources/net/sourceforge/guacamole/net/auth/mysql/dao}/UserPermissionMapper.xml (94%) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java index c628ec68c..fef2ede46 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java @@ -89,6 +89,11 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { @Override public UserContext getUserContext(Credentials credentials) throws GuacamoleException { + + // No null users in database + if (credentials.getUsername() == null) + return null; + MySQLUserContext context = injector.getInstance(MySQLUserContext.class); context.init(credentials); return context; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java index be69486b3..a542c608d 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java @@ -86,20 +86,34 @@ public class MySQLUser implements User { * @param credentials * @throws GuacamoleException */ - void init (Credentials credentials) throws GuacamoleException { + void init(Credentials credentials) throws GuacamoleException { + + // Query user UserExample userExample = new UserExample(); userExample.createCriteria().andUsernameEqualTo(credentials.getUsername()); List users = userDAO.selectByExampleWithBLOBs(userExample); - if(users.size() > 1) // the unique constraint on the table should prevent this - throw new GuacamoleException("Multiple users found with the same username: " + credentials.getUsername()); - if(users.isEmpty()) - throw new GuacamoleException("No user found with the supplied credentials"); - user = users.get(0); - // check password - if(!passwordUtility.checkCredentials(credentials, user.getPassword_hash(), user.getUsername(), user.getPassword_salt())) + + // The unique constraint on the table should prevent this. + if (users.size() > 1) + throw new GuacamoleException( + "Multiple users found with the same username: " + + credentials.getUsername()); + + // Check that a user was found + if (users.isEmpty()) throw new GuacamoleException("No user found with the supplied credentials"); + // Get first (and only) user + user = users.get(0); + + // Check password + if (!passwordUtility.checkCredentials(credentials, + user.getPassword_hash(), user.getUsername(), user.getPassword_salt())) + throw new GuacamoleException("No user found with the supplied credentials"); + + // Init permissions this.permissions = permissionCheckUtility.getAllPermissions(user.getUser_id()); + } /** diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionHistoryMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionHistoryMapper.xml similarity index 94% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionHistoryMapper.xml rename to extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionHistoryMapper.xml index 784d896fd..2a956575e 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionHistoryMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionHistoryMapper.xml @@ -100,7 +100,7 @@ distinct - from guacamole..guacamole_connection_history + from guacamole.guacamole_connection_history @@ -116,7 +116,7 @@ --> select - from guacamole..guacamole_connection_history + from guacamole.guacamole_connection_history where history_id = #{history_id,jdbcType=INTEGER} @@ -125,7 +125,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_connection_history + delete from guacamole.guacamole_connection_history where history_id = #{history_id,jdbcType=INTEGER} @@ -134,7 +134,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_connection_history + delete from guacamole.guacamole_connection_history @@ -145,7 +145,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_connection_history (history_id, user_id, connection_id, + insert into guacamole.guacamole_connection_history (history_id, user_id, connection_id, start_date, end_date) values (#{history_id,jdbcType=INTEGER}, #{user_id,jdbcType=INTEGER}, #{connection_id,jdbcType=INTEGER}, #{start_date,jdbcType=TIMESTAMP}, #{end_date,jdbcType=TIMESTAMP}) @@ -156,7 +156,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_connection_history + insert into guacamole.guacamole_connection_history history_id, @@ -198,7 +198,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - select count(*) from guacamole..guacamole_connection_history + select count(*) from guacamole.guacamole_connection_history @@ -209,7 +209,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection_history + update guacamole.guacamole_connection_history history_id = #{record.history_id,jdbcType=INTEGER}, @@ -237,7 +237,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection_history + update guacamole.guacamole_connection_history set history_id = #{record.history_id,jdbcType=INTEGER}, user_id = #{record.user_id,jdbcType=INTEGER}, connection_id = #{record.connection_id,jdbcType=INTEGER}, @@ -253,7 +253,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection_history + update guacamole.guacamole_connection_history user_id = #{user_id,jdbcType=INTEGER}, @@ -276,7 +276,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection_history + update guacamole.guacamole_connection_history set user_id = #{user_id,jdbcType=INTEGER}, connection_id = #{connection_id,jdbcType=INTEGER}, start_date = #{start_date,jdbcType=TIMESTAMP}, diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.xml similarity index 94% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionMapper.xml rename to extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.xml index 80646bd9d..c1265a13d 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.xml @@ -98,7 +98,7 @@ distinct - from guacamole..guacamole_connection + from guacamole.guacamole_connection @@ -114,7 +114,7 @@ --> select - from guacamole..guacamole_connection + from guacamole.guacamole_connection where connection_id = #{connection_id,jdbcType=INTEGER} @@ -123,7 +123,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_connection + delete from guacamole.guacamole_connection where connection_id = #{connection_id,jdbcType=INTEGER} @@ -132,7 +132,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_connection + delete from guacamole.guacamole_connection @@ -143,7 +143,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_connection (connection_id, connection_name, protocol + insert into guacamole.guacamole_connection (connection_id, connection_name, protocol ) values (#{connection_id,jdbcType=INTEGER}, #{connection_name,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR} ) @@ -154,7 +154,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_connection + insert into guacamole.guacamole_connection connection_id, @@ -184,7 +184,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - select count(*) from guacamole..guacamole_connection + select count(*) from guacamole.guacamole_connection @@ -195,7 +195,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection + update guacamole.guacamole_connection connection_id = #{record.connection_id,jdbcType=INTEGER}, @@ -217,7 +217,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection + update guacamole.guacamole_connection set connection_id = #{record.connection_id,jdbcType=INTEGER}, connection_name = #{record.connection_name,jdbcType=VARCHAR}, protocol = #{record.protocol,jdbcType=VARCHAR} @@ -231,7 +231,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection + update guacamole.guacamole_connection connection_name = #{connection_name,jdbcType=VARCHAR}, @@ -248,7 +248,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection + update guacamole.guacamole_connection set connection_name = #{connection_name,jdbcType=VARCHAR}, protocol = #{protocol,jdbcType=VARCHAR} where connection_id = #{connection_id,jdbcType=INTEGER} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionParameterMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.xml similarity index 93% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionParameterMapper.xml rename to extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.xml index 146622a62..b609b0f4d 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionParameterMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.xml @@ -98,7 +98,7 @@ distinct - from guacamole..guacamole_connection_parameter + from guacamole.guacamole_connection_parameter @@ -114,7 +114,7 @@ --> select - from guacamole..guacamole_connection_parameter + from guacamole.guacamole_connection_parameter where connection_id = #{connection_id,jdbcType=INTEGER} and parameter_name = #{parameter_name,jdbcType=VARCHAR} @@ -124,7 +124,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_connection_parameter + delete from guacamole.guacamole_connection_parameter where connection_id = #{connection_id,jdbcType=INTEGER} and parameter_name = #{parameter_name,jdbcType=VARCHAR} @@ -134,7 +134,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_connection_parameter + delete from guacamole.guacamole_connection_parameter @@ -145,7 +145,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_connection_parameter (connection_id, parameter_name, parameter_value + insert into guacamole.guacamole_connection_parameter (connection_id, parameter_name, parameter_value ) values (#{connection_id,jdbcType=INTEGER}, #{parameter_name,jdbcType=VARCHAR}, #{parameter_value,jdbcType=VARCHAR} ) @@ -156,7 +156,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_connection_parameter + insert into guacamole.guacamole_connection_parameter connection_id, @@ -186,7 +186,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - select count(*) from guacamole..guacamole_connection_parameter + select count(*) from guacamole.guacamole_connection_parameter @@ -197,7 +197,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection_parameter + update guacamole.guacamole_connection_parameter connection_id = #{record.connection_id,jdbcType=INTEGER}, @@ -219,7 +219,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection_parameter + update guacamole.guacamole_connection_parameter set connection_id = #{record.connection_id,jdbcType=INTEGER}, parameter_name = #{record.parameter_name,jdbcType=VARCHAR}, parameter_value = #{record.parameter_value,jdbcType=VARCHAR} @@ -233,7 +233,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection_parameter + update guacamole.guacamole_connection_parameter parameter_value = #{parameter_value,jdbcType=VARCHAR}, @@ -248,7 +248,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection_parameter + update guacamole.guacamole_connection_parameter set parameter_value = #{parameter_value,jdbcType=VARCHAR} where connection_id = #{connection_id,jdbcType=INTEGER} and parameter_name = #{parameter_name,jdbcType=VARCHAR} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.xml similarity index 94% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionPermissionMapper.xml rename to extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.xml index 240d868bb..3e7afd7ff 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionPermissionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.xml @@ -98,7 +98,7 @@ distinct - from guacamole..guacamole_connection_permission + from guacamole.guacamole_connection_permission @@ -112,7 +112,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_connection_permission + delete from guacamole.guacamole_connection_permission where user_id = #{user_id,jdbcType=INTEGER} and connection_id = #{connection_id,jdbcType=INTEGER} and permission = #{permission,jdbcType=CHAR} @@ -123,7 +123,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_connection_permission + delete from guacamole.guacamole_connection_permission @@ -134,7 +134,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_connection_permission (user_id, connection_id, permission + insert into guacamole.guacamole_connection_permission (user_id, connection_id, permission ) values (#{user_id,jdbcType=INTEGER}, #{connection_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR} ) @@ -145,7 +145,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_connection_permission + insert into guacamole.guacamole_connection_permission user_id, @@ -175,7 +175,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - select count(*) from guacamole..guacamole_connection_permission + select count(*) from guacamole.guacamole_connection_permission @@ -186,7 +186,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection_permission + update guacamole.guacamole_connection_permission user_id = #{record.user_id,jdbcType=INTEGER}, @@ -208,7 +208,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection_permission + update guacamole.guacamole_connection_permission set user_id = #{record.user_id,jdbcType=INTEGER}, connection_id = #{record.connection_id,jdbcType=INTEGER}, permission = #{record.permission,jdbcType=CHAR} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/SystemPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.xml similarity index 94% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/SystemPermissionMapper.xml rename to extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.xml index 2ca6297ac..8de2c4992 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/SystemPermissionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.xml @@ -97,7 +97,7 @@ distinct - from guacamole..guacamole_system_permission + from guacamole.guacamole_system_permission @@ -111,7 +111,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_system_permission + delete from guacamole.guacamole_system_permission where user_id = #{user_id,jdbcType=INTEGER} and permission = #{permission,jdbcType=CHAR} @@ -121,7 +121,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_system_permission + delete from guacamole.guacamole_system_permission @@ -132,7 +132,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_system_permission (user_id, permission) + insert into guacamole.guacamole_system_permission (user_id, permission) values (#{user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR}) @@ -141,7 +141,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_system_permission + insert into guacamole.guacamole_system_permission user_id, @@ -165,7 +165,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - select count(*) from guacamole..guacamole_system_permission + select count(*) from guacamole.guacamole_system_permission @@ -176,7 +176,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_system_permission + update guacamole.guacamole_system_permission user_id = #{record.user_id,jdbcType=INTEGER}, @@ -195,7 +195,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_system_permission + update guacamole.guacamole_system_permission set user_id = #{record.user_id,jdbcType=INTEGER}, permission = #{record.permission,jdbcType=CHAR} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.xml similarity index 95% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserMapper.xml rename to extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.xml index 5fe55f665..47758e3bb 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.xml @@ -116,7 +116,7 @@ , - from guacamole..guacamole_user + from guacamole.guacamole_user @@ -135,7 +135,7 @@ distinct - from guacamole..guacamole_user + from guacamole.guacamole_user @@ -153,7 +153,7 @@ , - from guacamole..guacamole_user + from guacamole.guacamole_user where user_id = #{user_id,jdbcType=INTEGER} @@ -162,7 +162,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_user + delete from guacamole.guacamole_user where user_id = #{user_id,jdbcType=INTEGER} @@ -171,7 +171,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_user + delete from guacamole.guacamole_user @@ -182,7 +182,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_user (user_id, username, password_hash, + insert into guacamole.guacamole_user (user_id, username, password_hash, password_salt) values (#{user_id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password_hash,jdbcType=BINARY}, #{password_salt,jdbcType=BINARY}) @@ -193,7 +193,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_user + insert into guacamole.guacamole_user user_id, @@ -229,7 +229,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - select count(*) from guacamole..guacamole_user + select count(*) from guacamole.guacamole_user @@ -240,7 +240,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_user + update guacamole.guacamole_user user_id = #{record.user_id,jdbcType=INTEGER}, @@ -265,7 +265,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_user + update guacamole.guacamole_user set user_id = #{record.user_id,jdbcType=INTEGER}, username = #{record.username,jdbcType=VARCHAR}, password_hash = #{record.password_hash,jdbcType=BINARY}, @@ -280,7 +280,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_user + update guacamole.guacamole_user set user_id = #{record.user_id,jdbcType=INTEGER}, username = #{record.username,jdbcType=VARCHAR} @@ -293,7 +293,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_user + update guacamole.guacamole_user username = #{username,jdbcType=VARCHAR}, @@ -313,7 +313,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_user + update guacamole.guacamole_user set username = #{username,jdbcType=VARCHAR}, password_hash = #{password_hash,jdbcType=BINARY}, password_salt = #{password_salt,jdbcType=BINARY} @@ -325,7 +325,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_user + update guacamole.guacamole_user set username = #{username,jdbcType=VARCHAR} where user_id = #{user_id,jdbcType=INTEGER} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.xml similarity index 94% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserPermissionMapper.xml rename to extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.xml index 97f86bbe5..e8836b833 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserPermissionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.xml @@ -98,7 +98,7 @@ distinct - from guacamole..guacamole_user_permission + from guacamole.guacamole_user_permission @@ -112,7 +112,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_user_permission + delete from guacamole.guacamole_user_permission where user_id = #{user_id,jdbcType=INTEGER} and affected_user_id = #{affected_user_id,jdbcType=INTEGER} and permission = #{permission,jdbcType=CHAR} @@ -123,7 +123,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_user_permission + delete from guacamole.guacamole_user_permission @@ -134,7 +134,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_user_permission (user_id, affected_user_id, permission + insert into guacamole.guacamole_user_permission (user_id, affected_user_id, permission ) values (#{user_id,jdbcType=INTEGER}, #{affected_user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR} ) @@ -145,7 +145,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_user_permission + insert into guacamole.guacamole_user_permission user_id, @@ -175,7 +175,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - select count(*) from guacamole..guacamole_user_permission + select count(*) from guacamole.guacamole_user_permission @@ -186,7 +186,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_user_permission + update guacamole.guacamole_user_permission user_id = #{record.user_id,jdbcType=INTEGER}, @@ -208,7 +208,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_user_permission + update guacamole.guacamole_user_permission set user_id = #{record.user_id,jdbcType=INTEGER}, affected_user_id = #{record.affected_user_id,jdbcType=INTEGER}, permission = #{record.permission,jdbcType=CHAR}