mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
GUAC-1193: Do not use <bind> within <foreach>, as it only substitutes the last bound value for *ALL* usages of the created variable. Do not use LIKE, as we would then have to escape the search term in Java.
This commit is contained in:
@@ -88,19 +88,18 @@
|
|||||||
<!-- Search terms -->
|
<!-- Search terms -->
|
||||||
<foreach collection="terms" item="term"
|
<foreach collection="terms" item="term"
|
||||||
open="WHERE " separator=" AND ">
|
open="WHERE " separator=" AND ">
|
||||||
<bind name="termPattern" value="'%' + term.term + '%'" />
|
|
||||||
(
|
(
|
||||||
|
|
||||||
guacamole_connection_history.user_id IN (
|
guacamole_connection_history.user_id IN (
|
||||||
SELECT user_id
|
SELECT user_id
|
||||||
FROM guacamole_user
|
FROM guacamole_user
|
||||||
WHERE username LIKE #{termPattern,jdbcType=VARCHAR}
|
WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN username) > 0
|
||||||
)
|
)
|
||||||
|
|
||||||
OR guacamole_connection_history.connection_id IN (
|
OR guacamole_connection_history.connection_id IN (
|
||||||
SELECT connection_id
|
SELECT connection_id
|
||||||
FROM guacamole_connection
|
FROM guacamole_connection
|
||||||
WHERE connection_name LIKE #{termPattern,jdbcType=VARCHAR}
|
WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN connection_name) > 0
|
||||||
)
|
)
|
||||||
|
|
||||||
<if test="term.startDate != null and term.endDate != null">
|
<if test="term.startDate != null and term.endDate != null">
|
||||||
@@ -164,19 +163,18 @@
|
|||||||
<!-- Search terms -->
|
<!-- Search terms -->
|
||||||
<foreach collection="terms" item="term"
|
<foreach collection="terms" item="term"
|
||||||
open="WHERE " separator=" AND ">
|
open="WHERE " separator=" AND ">
|
||||||
<bind name="termPattern" value="'%' + term.term + '%'" />
|
|
||||||
(
|
(
|
||||||
|
|
||||||
guacamole_connection_history.user_id IN (
|
guacamole_connection_history.user_id IN (
|
||||||
SELECT user_id
|
SELECT user_id
|
||||||
FROM guacamole_user
|
FROM guacamole_user
|
||||||
WHERE username LIKE #{termPattern,jdbcType=VARCHAR}
|
WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN username) > 0
|
||||||
)
|
)
|
||||||
|
|
||||||
OR guacamole_connection_history.connection_id IN (
|
OR guacamole_connection_history.connection_id IN (
|
||||||
SELECT connection_id
|
SELECT connection_id
|
||||||
FROM guacamole_connection
|
FROM guacamole_connection
|
||||||
WHERE connection_name LIKE #{termPattern,jdbcType=VARCHAR}
|
WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN connection_name) > 0
|
||||||
)
|
)
|
||||||
|
|
||||||
<if test="term.startDate != null and term.endDate != null">
|
<if test="term.startDate != null and term.endDate != null">
|
||||||
|
@@ -88,19 +88,18 @@
|
|||||||
<!-- Search terms -->
|
<!-- Search terms -->
|
||||||
<foreach collection="terms" item="term"
|
<foreach collection="terms" item="term"
|
||||||
open="WHERE " separator=" AND ">
|
open="WHERE " separator=" AND ">
|
||||||
<bind name="termPattern" value="'%' + term.term + '%'" />
|
|
||||||
(
|
(
|
||||||
|
|
||||||
guacamole_connection_history.user_id IN (
|
guacamole_connection_history.user_id IN (
|
||||||
SELECT user_id
|
SELECT user_id
|
||||||
FROM guacamole_user
|
FROM guacamole_user
|
||||||
WHERE username LIKE #{termPattern,jdbcType=VARCHAR}
|
WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN username) > 0
|
||||||
)
|
)
|
||||||
|
|
||||||
OR guacamole_connection_history.connection_id IN (
|
OR guacamole_connection_history.connection_id IN (
|
||||||
SELECT connection_id
|
SELECT connection_id
|
||||||
FROM guacamole_connection
|
FROM guacamole_connection
|
||||||
WHERE connection_name LIKE #{termPattern,jdbcType=VARCHAR}
|
WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN connection_name) > 0
|
||||||
)
|
)
|
||||||
|
|
||||||
<if test="term.startDate != null and term.endDate != null">
|
<if test="term.startDate != null and term.endDate != null">
|
||||||
@@ -164,19 +163,18 @@
|
|||||||
<!-- Search terms -->
|
<!-- Search terms -->
|
||||||
<foreach collection="terms" item="term"
|
<foreach collection="terms" item="term"
|
||||||
open="WHERE " separator=" AND ">
|
open="WHERE " separator=" AND ">
|
||||||
<bind name="termPattern" value="'%' + term.term + '%'" />
|
|
||||||
(
|
(
|
||||||
|
|
||||||
guacamole_connection_history.user_id IN (
|
guacamole_connection_history.user_id IN (
|
||||||
SELECT user_id
|
SELECT user_id
|
||||||
FROM guacamole_user
|
FROM guacamole_user
|
||||||
WHERE username LIKE #{termPattern,jdbcType=VARCHAR}
|
WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN username) > 0
|
||||||
)
|
)
|
||||||
|
|
||||||
OR guacamole_connection_history.connection_id IN (
|
OR guacamole_connection_history.connection_id IN (
|
||||||
SELECT connection_id
|
SELECT connection_id
|
||||||
FROM guacamole_connection
|
FROM guacamole_connection
|
||||||
WHERE connection_name LIKE #{termPattern,jdbcType=VARCHAR}
|
WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN connection_name) > 0
|
||||||
)
|
)
|
||||||
|
|
||||||
<if test="term.startDate != null and term.endDate != null">
|
<if test="term.startDate != null and term.endDate != null">
|
||||||
|
Reference in New Issue
Block a user