mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
Merge changes from patch branch back to main.
This commit is contained in:
@@ -29,6 +29,7 @@ import org.apache.guacamole.GuacamoleException;
|
||||
import org.apache.guacamole.auth.mysql.conf.MySQLDriver;
|
||||
import org.apache.guacamole.auth.mysql.conf.MySQLEnvironment;
|
||||
import org.apache.guacamole.auth.mysql.conf.MySQLSSLMode;
|
||||
import org.apache.guacamole.properties.CaseSensitivity;
|
||||
import org.mybatis.guice.datasource.helper.JdbcHelper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -145,14 +146,15 @@ public class MySQLAuthenticationProviderModule implements Module {
|
||||
if (serverTz != null)
|
||||
driverProperties.setProperty("serverTimezone", serverTz.getID());
|
||||
|
||||
// Check for case-sensitivity and warn admin
|
||||
if (environment.getCaseSensitiveUsernames())
|
||||
// Check for case sensitivity and warn admin
|
||||
if (environment.getCaseSensitivity() != CaseSensitivity.DISABLED)
|
||||
LOGGER.warn("The MySQL module is currently configured to support "
|
||||
+ "case-sensitive username comparisons, however, the default "
|
||||
+ "collations for MySQL databases do not support "
|
||||
+ "case-sensitive string comparisons. If you want usernames "
|
||||
+ "within Guacamole to be treated as case-sensitive, further "
|
||||
+ "database configuration may be required.");
|
||||
+ "case-sensitive username and/or group name comparisons, "
|
||||
+ "however, the default collations for MySQL databases do "
|
||||
+ "not support case-sensitive string comparisons. If you "
|
||||
+ "want identifiers within Guacamole to be treated as "
|
||||
+ "case-sensitive, further database configuration may be "
|
||||
+ "required.");
|
||||
|
||||
}
|
||||
|
||||
|
@@ -442,17 +442,6 @@ public class MySQLEnvironment extends JDBCEnvironment {
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getCaseSensitiveUsernames() throws GuacamoleException {
|
||||
|
||||
// Return the configured value for the property, or the global value.
|
||||
return getProperty(
|
||||
MySQLGuacamoleProperties.MYSQL_CASE_SENSITIVE_USERNAMES,
|
||||
super.getCaseSensitiveUsernames()
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the absolute path to the public key for the server being connected to,
|
||||
|
@@ -326,18 +326,4 @@ public class MySQLGuacamoleProperties {
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* A property used to configure whether or not usernames within the MySQL
|
||||
* JDBC module should be treated as case-sensitive. Be aware that MySQL's
|
||||
* default database collations do not do case-sensitive comparisons, so in
|
||||
* many cases they will effectively be case-insensitive.
|
||||
*/
|
||||
public static final BooleanGuacamoleProperty MYSQL_CASE_SENSITIVE_USERNAMES =
|
||||
new BooleanGuacamoleProperty() {
|
||||
|
||||
@Override
|
||||
public String getName() { return "mysql-case-sensitive-usernames"; }
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@@ -51,11 +51,24 @@
|
||||
JOIN guacamole_user_group ON guacamole_user_group.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
type = 'USER_GROUP'
|
||||
AND name IN
|
||||
<foreach collection="${groups}" item="effectiveGroup"
|
||||
open="(" separator="," close=")">
|
||||
#{effectiveGroup,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
name IN
|
||||
<foreach collection="${groups}" item="effectiveGroup"
|
||||
open="(" separator="," close=")">
|
||||
#{effectiveGroup,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(name) IN
|
||||
<foreach collection="${groups}" item="effectiveGroup"
|
||||
open="(" separator="," close=")">
|
||||
LOWER(#{effectiveGroup,jdbcType=VARCHAR})
|
||||
</foreach>
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
AND disabled = false
|
||||
)
|
||||
</if>
|
||||
@@ -83,20 +96,44 @@
|
||||
JOIN guacamole_entity member_entity ON guacamole_user_group_member.member_entity_id = member_entity.entity_id
|
||||
WHERE
|
||||
guacamole_user_group.disabled = false
|
||||
AND member_entity.type = 'USER_GROUP' AND member_entity.name IN
|
||||
<foreach collection="effectiveGroups" item="effectiveGroup"
|
||||
open="(" separator="," close=")">
|
||||
#{effectiveGroup,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
AND member_entity.type = 'USER_GROUP' AND
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
member_entity.name IN
|
||||
<foreach collection="effectiveGroups" item="effectiveGroup"
|
||||
open="(" separator="," close=")">
|
||||
#{effectiveGroup,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(member_entity.name) IN
|
||||
<foreach collection="effectiveGroups" item="effectiveGroup"
|
||||
open="(" separator="," close=")">
|
||||
LOWER(#{effectiveGroup,jdbcType=VARCHAR})
|
||||
</foreach>
|
||||
</otherwise>
|
||||
</choose>
|
||||
UNION SELECT
|
||||
guacamole_entity.name
|
||||
FROM guacamole_user_group
|
||||
JOIN guacamole_entity ON guacamole_user_group.entity_id = guacamole_entity.entity_id
|
||||
WHERE type = 'USER_GROUP' AND name IN
|
||||
<foreach collection="effectiveGroups" item="effectiveGroup"
|
||||
open="(" separator="," close=")">
|
||||
#{effectiveGroup,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
WHERE type = 'USER_GROUP' AND
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
name IN
|
||||
<foreach collection="effectiveGroups" item="effectiveGroup"
|
||||
open="(" separator="," close=")">
|
||||
#{effectiveGroup,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(name) IN
|
||||
<foreach collection="effectiveGroups" item="effectiveGroup"
|
||||
open="(" separator="," close=")">
|
||||
LOWER(#{effectiveGroup,jdbcType=VARCHAR})
|
||||
</foreach>
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
</if>
|
||||
|
||||
@@ -117,11 +154,23 @@
|
||||
JOIN guacamole_user_group ON guacamole_user_group.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
type = 'USER_GROUP'
|
||||
AND name IN
|
||||
<foreach collection="effectiveGroups" item="effectiveGroup"
|
||||
open="(" separator="," close=")">
|
||||
#{effectiveGroup,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
name IN
|
||||
<foreach collection="effectiveGroups" item="effectiveGroup"
|
||||
open="(" separator="," close=")">
|
||||
#{effectiveGroup,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(name) IN
|
||||
<foreach collection="effectiveGroups" item="effectiveGroup"
|
||||
open="(" separator="," close=")">
|
||||
LOWER(#{effectiveGroup,jdbcType=VARCHAR})
|
||||
</foreach>
|
||||
</otherwise>
|
||||
</choose>
|
||||
AND guacamole_user_group.disabled = false
|
||||
</if>
|
||||
UNION
|
||||
|
@@ -82,9 +82,10 @@
|
||||
FROM guacamole_connection_permission
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="${entityID}"/>
|
||||
<property name="groups" value="${groups}"/>
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="${entityID}"/>
|
||||
<property name="groups" value="${groups}"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
AND permission = 'READ'
|
||||
</sql>
|
||||
@@ -194,8 +195,9 @@
|
||||
</foreach>
|
||||
AND guacamole_connection.connection_id IN (
|
||||
<include refid="org.apache.guacamole.auth.jdbc.connection.ConnectionMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
)
|
||||
GROUP BY guacamole_connection.connection_id;
|
||||
@@ -209,8 +211,9 @@
|
||||
</foreach>
|
||||
AND guacamole_sharing_profile.sharing_profile_id IN (
|
||||
<include refid="org.apache.guacamole.auth.jdbc.sharingprofile.SharingProfileMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
);
|
||||
|
||||
@@ -226,8 +229,9 @@
|
||||
</foreach>
|
||||
AND guacamole_connection_attribute.connection_id IN (
|
||||
<include refid="org.apache.guacamole.auth.jdbc.connection.ConnectionMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
);
|
||||
|
||||
|
@@ -62,7 +62,7 @@
|
||||
JOIN guacamole_entity ON guacamole_user.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
guacamole_entity.name = #{record.username,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -121,7 +121,7 @@
|
||||
FROM guacamole_user
|
||||
WHERE
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
POSITION(#{term.term,jdbcType=VARCHAR} IN username) > 0
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -190,16 +190,18 @@
|
||||
<!-- Restrict to readable connections -->
|
||||
AND guacamole_connection_history.connection_id IN (
|
||||
<include refid="org.apache.guacamole.auth.jdbc.connection.ConnectionMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
)
|
||||
|
||||
<!-- Restrict to readable users -->
|
||||
AND guacamole_connection_history.user_id IN (
|
||||
<include refid="org.apache.guacamole.auth.jdbc.user.UserMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
)
|
||||
|
||||
@@ -216,7 +218,7 @@
|
||||
JOIN guacamole_entity ON guacamole_user.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
POSITION(#{term.term,jdbcType=VARCHAR} IN guacamole_entity.name) > 0
|
||||
</when>
|
||||
<otherwise>
|
||||
|
@@ -83,9 +83,10 @@
|
||||
FROM guacamole_connection_group_permission
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="${entityID}"/>
|
||||
<property name="groups" value="${groups}"/>
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="${entityID}"/>
|
||||
<property name="groups" value="${groups}"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
AND permission = 'READ'
|
||||
</sql>
|
||||
@@ -93,8 +94,9 @@
|
||||
<!-- Select identifiers of all readable connection groups -->
|
||||
<select id="selectReadableIdentifiers" resultType="string">
|
||||
<include refid="org.apache.guacamole.auth.jdbc.connectiongroup.ConnectionGroupMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
</select>
|
||||
|
||||
@@ -116,8 +118,9 @@
|
||||
<if test="parentIdentifier == null">parent_id IS NULL</if>
|
||||
AND connection_group_id IN (
|
||||
<include refid="org.apache.guacamole.auth.jdbc.connectiongroup.ConnectionGroupMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
)
|
||||
</select>
|
||||
@@ -190,8 +193,9 @@
|
||||
</foreach>
|
||||
AND guacamole_connection_group.connection_group_id IN (
|
||||
<include refid="org.apache.guacamole.auth.jdbc.connectiongroup.ConnectionGroupMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
);
|
||||
|
||||
@@ -204,8 +208,9 @@
|
||||
</foreach>
|
||||
AND guacamole_connection_group.connection_group_id IN (
|
||||
<include refid="org.apache.guacamole.auth.jdbc.connectiongroup.ConnectionGroupMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
);
|
||||
|
||||
@@ -218,8 +223,9 @@
|
||||
</foreach>
|
||||
AND guacamole_connection.connection_id IN (
|
||||
<include refid="org.apache.guacamole.auth.jdbc.connection.ConnectionMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
);
|
||||
|
||||
@@ -235,8 +241,9 @@
|
||||
</foreach>
|
||||
AND guacamole_connection_group_attribute.connection_group_id IN (
|
||||
<include refid="org.apache.guacamole.auth.jdbc.connectiongroup.ConnectionGroupMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
);
|
||||
|
||||
|
@@ -41,9 +41,10 @@
|
||||
FROM guacamole_connection_group_permission
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
|
||||
</select>
|
||||
@@ -58,9 +59,10 @@
|
||||
FROM guacamole_connection_group_permission
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
AND permission = #{type,jdbcType=VARCHAR}
|
||||
AND connection_group_id = #{identifier,jdbcType=VARCHAR}
|
||||
@@ -74,9 +76,10 @@
|
||||
FROM guacamole_connection_group_permission
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
AND connection_group_id IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
|
@@ -41,9 +41,10 @@
|
||||
FROM guacamole_connection_permission
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
|
||||
</select>
|
||||
@@ -58,9 +59,10 @@
|
||||
FROM guacamole_connection_permission
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
AND permission = #{type,jdbcType=VARCHAR}
|
||||
AND connection_id = #{identifier,jdbcType=VARCHAR}
|
||||
@@ -74,9 +76,10 @@
|
||||
FROM guacamole_connection_permission
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
AND connection_id IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
|
@@ -41,9 +41,10 @@
|
||||
FROM guacamole_sharing_profile_permission
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
|
||||
</select>
|
||||
@@ -58,9 +59,10 @@
|
||||
FROM guacamole_sharing_profile_permission
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
AND permission = #{type,jdbcType=VARCHAR}
|
||||
AND sharing_profile_id = #{identifier,jdbcType=VARCHAR}
|
||||
@@ -74,9 +76,10 @@
|
||||
FROM guacamole_sharing_profile_permission
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
AND sharing_profile_id IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
|
@@ -39,9 +39,10 @@
|
||||
FROM guacamole_system_permission
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
|
||||
</select>
|
||||
@@ -55,9 +56,10 @@
|
||||
FROM guacamole_system_permission
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
AND permission = #{type,jdbcType=VARCHAR}
|
||||
|
||||
|
@@ -43,9 +43,10 @@
|
||||
JOIN guacamole_entity affected_entity ON affected_group.entity_id = affected_entity.entity_id
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="guacamole_user_group_permission.entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="column" value="guacamole_user_group_permission.entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
AND affected_entity.type = 'USER_GROUP'
|
||||
|
||||
@@ -63,13 +64,22 @@
|
||||
JOIN guacamole_entity affected_entity ON affected_group.entity_id = affected_entity.entity_id
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="guacamole_user_group_permission.entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="column" value="guacamole_user_group_permission.entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
AND permission = #{type,jdbcType=VARCHAR}
|
||||
AND affected_entity.name = #{identifier,jdbcType=VARCHAR}
|
||||
AND affected_entity.type = 'USER_GROUP'
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
affected_entity.name = #{identifier,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(affected_entity.name) = LOWER(#{identifier,jdbcType=VARCHAR})
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
@@ -82,21 +92,35 @@
|
||||
JOIN guacamole_entity affected_entity ON affected_group.entity_id = affected_entity.entity_id
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="guacamole_user_group_permission.entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="column" value="guacamole_user_group_permission.entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
AND affected_entity.name IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
AND affected_entity.type = 'USER_GROUP'
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
affected_entity.name IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(affected_entity.name) IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
LOWER(#{identifier,jdbcType=VARCHAR})
|
||||
</foreach>
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
AND permission IN
|
||||
<foreach collection="permissions" item="permission"
|
||||
open="(" separator="," close=")">
|
||||
#{permission,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
AND affected_entity.type = 'USER_GROUP'
|
||||
|
||||
</select>
|
||||
|
||||
@@ -108,15 +132,29 @@
|
||||
JOIN guacamole_user_group affected_group ON guacamole_user_group_permission.affected_user_group_id = affected_group.user_group_id
|
||||
JOIN guacamole_entity affected_entity ON affected_group.entity_id = affected_entity.entity_id
|
||||
WHERE
|
||||
(guacamole_user_group_permission.entity_id, permission, affected_entity.name) IN
|
||||
<foreach collection="permissions" item="permission"
|
||||
open="(" separator="," close=")">
|
||||
(#{permission.entityID,jdbcType=INTEGER},
|
||||
#{permission.type,jdbcType=VARCHAR},
|
||||
#{permission.objectIdentifier,jdbcType=VARCHAR})
|
||||
</foreach>
|
||||
AND affected_entity.type = 'USER_GROUP'
|
||||
|
||||
affected_entity.type = 'USER_GROUP'
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
(guacamole_user_group_permission.entity_id, permission, affected_entity.name) IN
|
||||
<foreach collection="permissions" item="permission"
|
||||
open="(" separator="," close=")">
|
||||
(#{permission.entityID,jdbcType=INTEGER},
|
||||
#{permission.type,jdbcType=VARCHAR},
|
||||
#{permission.objectIdentifier,jdbcType=VARCHAR})
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
(guacamole_user_group_permission.entity_id, permission, LOWER(affected_entity.name)) IN
|
||||
<foreach collection="permissions" item="permission"
|
||||
open="(" separator="," close=")">
|
||||
(#{permission.entityID,jdbcType=INTEGER},
|
||||
#{permission.type,jdbcType=VARCHAR},
|
||||
LOWER(#{permission.objectIdentifier,jdbcType=VARCHAR}))
|
||||
</foreach>
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</delete>
|
||||
|
||||
<!-- Insert all given permissions -->
|
||||
@@ -140,8 +178,16 @@
|
||||
</foreach>
|
||||
AS permissions
|
||||
JOIN guacamole_entity affected_entity ON
|
||||
affected_entity.name = permissions.affected_name
|
||||
AND affected_entity.type = 'USER_GROUP'
|
||||
affected_entity.type = 'USER_GROUP'
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
affected_entity.name = permissions.affected_name
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(affected_entity.name) = LOWER(permissions.affected_name)
|
||||
</otherwise>
|
||||
</choose>
|
||||
JOIN guacamole_user_group affected_group ON affected_group.entity_id = affected_entity.entity_id
|
||||
|
||||
</insert>
|
||||
|
@@ -43,9 +43,10 @@
|
||||
JOIN guacamole_entity affected_entity ON affected_user.entity_id = affected_entity.entity_id
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="guacamole_user_permission.entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="column" value="guacamole_user_permission.entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
AND affected_entity.type = 'USER'
|
||||
|
||||
@@ -63,14 +64,15 @@
|
||||
JOIN guacamole_entity affected_entity ON affected_user.entity_id = affected_entity.entity_id
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="guacamole_user_permission.entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="column" value="guacamole_user_permission.entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
AND permission = #{type,jdbcType=VARCHAR}
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
affected_entity.name = #{identifier,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -90,13 +92,15 @@
|
||||
JOIN guacamole_entity affected_entity ON affected_user.entity_id = affected_entity.entity_id
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="guacamole_user_permission.entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="column" value="guacamole_user_permission.entity_id"/>
|
||||
<property name="entityID" value="#{entity.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
AND affected_entity.type = 'USER'
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
affected_entity.name IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
@@ -116,7 +120,6 @@
|
||||
open="(" separator="," close=")">
|
||||
#{permission,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
AND affected_entity.type = 'USER'
|
||||
|
||||
</select>
|
||||
|
||||
@@ -129,7 +132,7 @@
|
||||
JOIN guacamole_entity affected_entity ON affected_user.entity_id = affected_entity.entity_id
|
||||
WHERE
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
(guacamole_user_permission.entity_id, permission, affected_entity.name) IN
|
||||
<foreach collection="permissions" item="permission"
|
||||
open="(" separator="," close=")">
|
||||
@@ -139,7 +142,7 @@
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
AND (guacamole_user_permission.entity_id, permission, LOWER(affected_entity.name)) IN
|
||||
(guacamole_user_permission.entity_id, permission, LOWER(affected_entity.name)) IN
|
||||
<foreach collection="permissions" item="permission"
|
||||
open="(" separator="," close=")">
|
||||
(#{permission.entityID,jdbcType=INTEGER},
|
||||
@@ -174,7 +177,7 @@
|
||||
AS permissions
|
||||
JOIN guacamole_entity affected_entity ON
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
affected_entity.name = permissions.affected_name
|
||||
</when>
|
||||
<otherwise>
|
||||
|
@@ -66,9 +66,10 @@
|
||||
FROM guacamole_sharing_profile_permission
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="${entityID}"/>
|
||||
<property name="groups" value="${groups}"/>
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="${entityID}"/>
|
||||
<property name="groups" value="${groups}"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
AND permission = 'READ'
|
||||
</sql>
|
||||
@@ -76,8 +77,9 @@
|
||||
<!-- Select identifiers of all readable sharing profiles -->
|
||||
<select id="selectReadableIdentifiers" resultType="string">
|
||||
<include refid="org.apache.guacamole.auth.jdbc.sharingprofile.SharingProfileMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
</select>
|
||||
|
||||
@@ -125,8 +127,9 @@
|
||||
</foreach>
|
||||
AND guacamole_sharing_profile.sharing_profile_id IN (
|
||||
<include refid="org.apache.guacamole.auth.jdbc.sharingprofile.SharingProfileMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
);
|
||||
|
||||
@@ -142,8 +145,9 @@
|
||||
</foreach>
|
||||
AND guacamole_sharing_profile_attribute.sharing_profile_id IN (
|
||||
<include refid="org.apache.guacamole.auth.jdbc.sharingprofile.SharingProfileMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
);
|
||||
|
||||
|
@@ -44,7 +44,7 @@
|
||||
JOIN guacamole_entity ON guacamole_user.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
guacamole_entity.name = #{username,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
|
@@ -82,9 +82,10 @@
|
||||
FROM guacamole_user_permission
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="${entityID}"/>
|
||||
<property name="groups" value="${groups}"/>
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="${entityID}"/>
|
||||
<property name="groups" value="${groups}"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
AND permission = 'READ'
|
||||
</sql>
|
||||
@@ -97,8 +98,9 @@
|
||||
WHERE
|
||||
guacamole_user.user_id IN (
|
||||
<include refid="org.apache.guacamole.auth.jdbc.user.UserMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
)
|
||||
AND guacamole_entity.type = 'USER'
|
||||
@@ -132,7 +134,7 @@
|
||||
LEFT JOIN guacamole_user_history ON guacamole_user_history.user_id = guacamole_user.user_id
|
||||
WHERE
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
guacamole_entity.name
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -143,7 +145,7 @@
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -163,7 +165,7 @@
|
||||
JOIN guacamole_entity ON guacamole_user.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
guacamole_entity.name
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -174,7 +176,7 @@
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -214,7 +216,7 @@
|
||||
LEFT JOIN guacamole_user_history ON guacamole_user_history.user_id = guacamole_user.user_id
|
||||
WHERE
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
guacamole_entity.name
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -225,7 +227,7 @@
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -236,8 +238,9 @@
|
||||
AND guacamole_entity.type = 'USER'
|
||||
AND guacamole_user.user_id IN (
|
||||
<include refid="org.apache.guacamole.auth.jdbc.user.UserMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
)
|
||||
GROUP BY guacamole_user.user_id, guacamole_entity.entity_id;
|
||||
@@ -251,7 +254,7 @@
|
||||
JOIN guacamole_entity ON guacamole_user.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
guacamole_entity.name
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -262,7 +265,7 @@
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -273,8 +276,9 @@
|
||||
AND guacamole_entity.type = 'USER'
|
||||
AND guacamole_user.user_id IN (
|
||||
<include refid="org.apache.guacamole.auth.jdbc.user.UserMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
);
|
||||
|
||||
@@ -308,7 +312,7 @@
|
||||
LEFT JOIN guacamole_user_history ON guacamole_user_history.user_id = guacamole_user.user_id
|
||||
WHERE
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
guacamole_entity.name = #{username,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -327,7 +331,7 @@
|
||||
JOIN guacamole_entity ON guacamole_user.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
guacamole_entity.name = #{username,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -343,7 +347,7 @@
|
||||
DELETE FROM guacamole_entity
|
||||
WHERE
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
name = #{identifier,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
|
@@ -43,8 +43,9 @@
|
||||
WHERE
|
||||
guacamole_user_group.user_group_id IN (
|
||||
<include refid="org.apache.guacamole.auth.jdbc.usergroup.UserGroupMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
)
|
||||
AND guacamole_user_group_member.member_entity_id = #{parent.entityID,jdbcType=INTEGER}
|
||||
@@ -60,10 +61,26 @@
|
||||
WHERE
|
||||
member_entity_id = #{parent.entityID,jdbcType=INTEGER}
|
||||
AND guacamole_entity.type = 'USER_GROUP'
|
||||
AND guacamole_entity.name IN
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
guacamole_entity.name
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(guacamole_entity.name)
|
||||
</otherwise>
|
||||
</choose>
|
||||
IN
|
||||
<foreach collection="children" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(#{identifier,jdbcType=VARCHAR})
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
@@ -79,12 +96,28 @@
|
||||
FROM guacamole_user_group
|
||||
JOIN guacamole_entity ON guacamole_user_group.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
guacamole_entity.name IN
|
||||
guacamole_entity.type = 'USER_GROUP'
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
guacamole_entity.name
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(guacamole_entity.name)
|
||||
</otherwise>
|
||||
</choose>
|
||||
IN
|
||||
<foreach collection="children" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
#{identifier}
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(#{identifier})
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
AND guacamole_entity.type = 'USER_GROUP'
|
||||
AND guacamole_user_group.user_group_id NOT IN (
|
||||
SELECT guacamole_user_group_member.user_group_id
|
||||
FROM guacamole_user_group_member
|
||||
|
@@ -50,7 +50,7 @@
|
||||
JOIN guacamole_entity ON guacamole_user.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
guacamole_entity.name = #{record.username,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -89,7 +89,7 @@
|
||||
|
||||
<if test="identifier != null">
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
guacamole_user_history.username = #{identifier,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -107,7 +107,7 @@
|
||||
JOIN guacamole_entity ON guacamole_user.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
POSITION(#{term.term,jdbcType=VARCHAR} IN guacamole_entity.name) > 0
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -163,13 +163,14 @@
|
||||
<include refid="org.apache.guacamole.auth.jdbc.user.UserMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
)
|
||||
|
||||
<if test="identifier != null">
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
guacamole_entity.name = #{identifier,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -187,7 +188,7 @@
|
||||
JOIN guacamole_entity ON guacamole_user.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
POSITION(#{term.term,jdbcType=VARCHAR} IN guacamole_entity.name) > 0
|
||||
</when>
|
||||
<otherwise>
|
||||
|
@@ -68,9 +68,10 @@
|
||||
FROM guacamole_user_group_permission
|
||||
WHERE
|
||||
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="${entityID}"/>
|
||||
<property name="groups" value="${groups}"/>
|
||||
<property name="column" value="entity_id"/>
|
||||
<property name="entityID" value="${entityID}"/>
|
||||
<property name="groups" value="${groups}"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
AND permission = 'READ'
|
||||
</sql>
|
||||
@@ -83,8 +84,9 @@
|
||||
WHERE
|
||||
guacamole_user_group.user_group_id IN (
|
||||
<include refid="org.apache.guacamole.auth.jdbc.usergroup.UserGroupMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
)
|
||||
AND guacamole_entity.type = 'USER_GROUP'
|
||||
@@ -101,12 +103,30 @@
|
||||
disabled
|
||||
FROM guacamole_user_group
|
||||
JOIN guacamole_entity ON guacamole_user_group.entity_id = guacamole_entity.entity_id
|
||||
WHERE guacamole_entity.name IN
|
||||
WHERE
|
||||
guacamole_entity.type = 'USER_GROUP'
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
guacamole_entity.name
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(guacamole_entity.name)
|
||||
</otherwise>
|
||||
</choose>
|
||||
IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
open="(" separator="," close=")">
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(#{identifier,jdbcType=VARCHAR})
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
AND guacamole_entity.type = 'USER_GROUP';
|
||||
;
|
||||
|
||||
SELECT
|
||||
guacamole_user_group_attribute.user_group_id,
|
||||
@@ -115,12 +135,30 @@
|
||||
FROM guacamole_user_group_attribute
|
||||
JOIN guacamole_user_group ON guacamole_user_group.user_group_id = guacamole_user_group_attribute.user_group_id
|
||||
JOIN guacamole_entity ON guacamole_user_group.entity_id = guacamole_entity.entity_id
|
||||
WHERE guacamole_entity.name IN
|
||||
WHERE
|
||||
guacamole_entity.type = 'USER_GROUP'
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
guacamole_entity.name
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(guacamole_entity.name)
|
||||
</otherwise>
|
||||
</choose>
|
||||
IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
open="(" separator="," close=")">
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(#{identifier,jdbcType=VARCHAR})
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
AND guacamole_entity.type = 'USER_GROUP';
|
||||
;
|
||||
|
||||
</select>
|
||||
|
||||
@@ -135,16 +173,34 @@
|
||||
disabled
|
||||
FROM guacamole_user_group
|
||||
JOIN guacamole_entity ON guacamole_user_group.entity_id = guacamole_entity.entity_id
|
||||
WHERE guacamole_entity.name IN
|
||||
WHERE
|
||||
guacamole_entity.type = 'USER_GROUP'
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
guacamole_entity.name
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(guacamole_entity.name)
|
||||
</otherwise>
|
||||
</choose>
|
||||
IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(#{identifier,jdbcType=VARCHAR})
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
AND guacamole_entity.type = 'USER_GROUP'
|
||||
AND guacamole_user_group.user_group_id IN (
|
||||
<include refid="org.apache.guacamole.auth.jdbc.usergroup.UserGroupMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
);
|
||||
|
||||
@@ -155,16 +211,34 @@
|
||||
FROM guacamole_user_group_attribute
|
||||
JOIN guacamole_user_group ON guacamole_user_group.user_group_id = guacamole_user_group_attribute.user_group_id
|
||||
JOIN guacamole_entity ON guacamole_user_group.entity_id = guacamole_entity.entity_id
|
||||
WHERE guacamole_entity.name IN
|
||||
WHERE
|
||||
guacamole_entity.type = 'USER_GROUP'
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
guacamole_entity.name
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(guacamole_entity.name)
|
||||
</otherwise>
|
||||
</choose>
|
||||
IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(#{identifier,jdbcType=VARCHAR})
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
AND guacamole_entity.type = 'USER_GROUP'
|
||||
AND guacamole_user_group.user_group_id IN (
|
||||
AND guacamole_user_group.user_group_id IN (
|
||||
<include refid="org.apache.guacamole.auth.jdbc.usergroup.UserGroupMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
);
|
||||
|
||||
@@ -182,7 +256,14 @@
|
||||
FROM guacamole_user_group
|
||||
JOIN guacamole_entity ON guacamole_user_group.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
guacamole_entity.name = #{name,jdbcType=VARCHAR}
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
guacamole_entity.name = #{name,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(guacamole_entity.name) = LOWER(#{name,jdbcType=VARCHAR})
|
||||
</otherwise>
|
||||
</choose>
|
||||
AND guacamole_entity.type = 'USER_GROUP';
|
||||
|
||||
SELECT
|
||||
@@ -193,8 +274,16 @@
|
||||
JOIN guacamole_user_group ON guacamole_user_group.user_group_id = guacamole_user_group_attribute.user_group_id
|
||||
JOIN guacamole_entity ON guacamole_user_group.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
guacamole_entity.name = #{name,jdbcType=VARCHAR}
|
||||
AND guacamole_entity.type = 'USER_GROUP'
|
||||
guacamole_entity.type = 'USER_GROUP'
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
guacamole_entity.name = #{name,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(guacamole_entity.name) = LOWER(#{name,jdbcType=VARCHAR})
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
@@ -202,8 +291,15 @@
|
||||
<delete id="delete">
|
||||
DELETE FROM guacamole_entity
|
||||
WHERE
|
||||
name = #{identifier,jdbcType=VARCHAR}
|
||||
AND type = 'USER_GROUP'
|
||||
type = 'USER_GROUP'
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
name = #{identifier,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(name) = LOWER(#{identifier,jdbcType=VARCHAR})
|
||||
</otherwise>
|
||||
</choose>
|
||||
</delete>
|
||||
|
||||
<!-- Insert single group -->
|
||||
|
@@ -40,14 +40,15 @@
|
||||
JOIN guacamole_entity ON guacamole_entity.entity_id = guacamole_user_group_member.member_entity_id
|
||||
JOIN guacamole_user_group ON guacamole_user_group.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
guacamole_user_group.user_group_id IN (
|
||||
guacamole_entity.type = 'USER_GROUP'
|
||||
AND guacamole_user_group_member.user_group_id = #{parent.objectID,jdbcType=INTEGER}
|
||||
AND guacamole_user_group.user_group_id IN (
|
||||
<include refid="org.apache.guacamole.auth.jdbc.usergroup.UserGroupMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
)
|
||||
AND guacamole_user_group_member.user_group_id = #{parent.objectID,jdbcType=INTEGER}
|
||||
AND guacamole_entity.type = 'USER_GROUP'
|
||||
</select>
|
||||
|
||||
<!-- Delete member groups by name -->
|
||||
@@ -58,10 +59,26 @@
|
||||
WHERE
|
||||
user_group_id = #{parent.objectID,jdbcType=INTEGER}
|
||||
AND guacamole_entity.type = 'USER_GROUP'
|
||||
AND guacamole_entity.name IN
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
guacamole_entity.name
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(guacamole_entity.name)
|
||||
</otherwise>
|
||||
</choose>
|
||||
IN
|
||||
<foreach collection="children" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(#{identifier,jdbcType=VARCHAR})
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
@@ -76,12 +93,28 @@
|
||||
guacamole_entity.entity_id
|
||||
FROM guacamole_entity
|
||||
WHERE
|
||||
guacamole_entity.name IN
|
||||
guacamole_entity.type = 'USER_GROUP'
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitivity.caesSensitiveGroupNames()">
|
||||
guacamole_entity.name
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(guacamole_entity.name)
|
||||
</otherwise>
|
||||
</choose>
|
||||
IN
|
||||
<foreach collection="children" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
#{identifier}
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
#{identifier}
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(#{identifier})
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
AND guacamole_entity.type = 'USER_GROUP'
|
||||
AND guacamole_entity.entity_id NOT IN (
|
||||
SELECT guacamole_user_group_member.member_entity_id
|
||||
FROM guacamole_user_group_member
|
||||
|
@@ -44,6 +44,7 @@
|
||||
<include refid="org.apache.guacamole.auth.jdbc.user.UserMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
)
|
||||
AND guacamole_user_group_member.user_group_id = #{parent.objectID,jdbcType=INTEGER}
|
||||
@@ -60,7 +61,7 @@
|
||||
AND guacamole_entity.type = 'USER'
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
guacamole_entity.name
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -71,7 +72,7 @@
|
||||
<foreach collection="children" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -92,8 +93,10 @@
|
||||
guacamole_entity.entity_id
|
||||
FROM guacamole_entity
|
||||
WHERE
|
||||
guacamole_entity.type = 'USER'
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
guacamole_entity.name
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -104,15 +107,14 @@
|
||||
<foreach collection="children" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
<choose>
|
||||
<when test="caseSensitive">
|
||||
#{identifier}
|
||||
<when test="caseSensitivity.caseSensitiveUsernames()">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(#{identifier})
|
||||
LOWER(#{identifier,jdbcType=VARCHAR})
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
AND guacamole_entity.type = 'USER'
|
||||
AND guacamole_entity.entity_id NOT IN (
|
||||
SELECT guacamole_user_group_member.member_entity_id
|
||||
FROM guacamole_user_group_member
|
||||
|
@@ -41,14 +41,15 @@
|
||||
JOIN guacamole_user_group ON guacamole_user_group_member.user_group_id = guacamole_user_group.user_group_id
|
||||
JOIN guacamole_entity ON guacamole_entity.entity_id = guacamole_user_group.entity_id
|
||||
WHERE
|
||||
guacamole_user_group.user_group_id IN (
|
||||
guacamole_entity.type = 'USER_GROUP'
|
||||
AND guacamole_user_group_member.member_entity_id = #{parent.entityID,jdbcType=INTEGER}
|
||||
AND guacamole_user_group.user_group_id IN (
|
||||
<include refid="org.apache.guacamole.auth.jdbc.usergroup.UserGroupMapper.getReadableIDs">
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
|
||||
<property name="groups" value="effectiveGroups"/>
|
||||
<property name="caseSensitivity" value="${caseSensitivity}"/>
|
||||
</include>
|
||||
)
|
||||
AND guacamole_user_group_member.member_entity_id = #{parent.entityID,jdbcType=INTEGER}
|
||||
AND guacamole_entity.type = 'USER_GROUP'
|
||||
</select>
|
||||
|
||||
<!-- Delete parent groups by name -->
|
||||
@@ -60,10 +61,26 @@
|
||||
WHERE
|
||||
member_entity_id = #{parent.entityID,jdbcType=INTEGER}
|
||||
AND guacamole_entity.type = 'USER_GROUP'
|
||||
AND guacamole_entity.name IN
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
guacamole_entity.name
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(guacamole_entity.name)
|
||||
</otherwise>
|
||||
</choose>
|
||||
IN
|
||||
<foreach collection="children" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(#{identifier,jdbcType=VARCHAR})
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
@@ -79,12 +96,28 @@
|
||||
FROM guacamole_user_group
|
||||
JOIN guacamole_entity ON guacamole_user_group.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
guacamole_entity.name IN
|
||||
guacamole_entity.type = 'USER_GROUP'
|
||||
AND
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
guacamole_entity.name
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(guacamole_entity.name)
|
||||
</otherwise>
|
||||
</choose>
|
||||
IN
|
||||
<foreach collection="children" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
<choose>
|
||||
<when test="caseSensitivity.caseSensitiveGroupNames()">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
</when>
|
||||
<otherwise>
|
||||
LOWER(#{identifier,jdbcType=VARCHAR})
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
AND guacamole_entity.type = 'USER_GROUP'
|
||||
AND guacamole_user_group.user_group_id NOT IN (
|
||||
SELECT guacamole_user_group_member.user_group_id
|
||||
FROM guacamole_user_group_member
|
||||
|
Reference in New Issue
Block a user