GUAC-1213: Map date/time restriction columns to UserModel properties.

This commit is contained in:
Michael Jumper
2015-07-30 12:05:23 -07:00
parent c97769e1da
commit db422d1fb0
2 changed files with 93 additions and 24 deletions

View File

@@ -33,7 +33,11 @@
<result column="password_hash" property="passwordHash" jdbcType="BINARY"/> <result column="password_hash" property="passwordHash" jdbcType="BINARY"/>
<result column="password_salt" property="passwordSalt" jdbcType="BINARY"/> <result column="password_salt" property="passwordSalt" jdbcType="BINARY"/>
<result column="disabled" property="disabled" jdbcType="BOOLEAN"/> <result column="disabled" property="disabled" jdbcType="BOOLEAN"/>
<result column="expired" property="expired" jdbcType="BOOLEAN"/> <result column="access_window_start" property="accessWindowStart" jdbcType="TIME"/>
<result column="access_window_end" property="accessWindowEnd" jdbcType="TIME"/>
<result column="valid_from" property="validFrom" jdbcType="DATE"/>
<result column="valid_until" property="validUntil" jdbcType="DATE"/>
<result column="timezone" property="timeZone" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<!-- Select all usernames --> <!-- Select all usernames -->
@@ -61,7 +65,12 @@
password_hash, password_hash,
password_salt, password_salt,
disabled, disabled,
expired expired,
access_window_start,
access_window_end,
valid_from,
valid_until,
timezone
FROM guacamole_user FROM guacamole_user
WHERE username IN WHERE username IN
<foreach collection="identifiers" item="identifier" <foreach collection="identifiers" item="identifier"
@@ -80,7 +89,12 @@
password_hash, password_hash,
password_salt, password_salt,
disabled, disabled,
expired expired,
access_window_start,
access_window_end,
valid_from,
valid_until,
timezone
FROM guacamole_user FROM guacamole_user
JOIN guacamole_user_permission ON affected_user_id = guacamole_user.user_id JOIN guacamole_user_permission ON affected_user_id = guacamole_user.user_id
WHERE username IN WHERE username IN
@@ -102,7 +116,12 @@
password_hash, password_hash,
password_salt, password_salt,
disabled, disabled,
expired expired,
access_window_start,
access_window_end,
valid_from,
valid_until,
timezone
FROM guacamole_user FROM guacamole_user
WHERE WHERE
username = #{username,jdbcType=VARCHAR} username = #{username,jdbcType=VARCHAR}
@@ -124,14 +143,24 @@
password_hash, password_hash,
password_salt, password_salt,
disabled, disabled,
expired expired,
access_window_start,
access_window_end,
valid_from,
valid_until,
timezone
) )
VALUES ( VALUES (
#{object.identifier,jdbcType=VARCHAR}, #{object.identifier,jdbcType=VARCHAR},
#{object.passwordHash,jdbcType=BINARY}, #{object.passwordHash,jdbcType=BINARY},
#{object.passwordSalt,jdbcType=BINARY}, #{object.passwordSalt,jdbcType=BINARY},
#{object.disabled,jdbcType=BOOLEAN}, #{object.disabled,jdbcType=BOOLEAN},
#{object.expired,jdbcType=BOOLEAN} #{object.expired,jdbcType=BOOLEAN},
#{object.accessWindowStart,jdbcType=TIME},
#{object.accessWindowEnd,jdbcType=TIME},
#{object.validFrom,jdbcType=DATE},
#{object.validUntil,jdbcType=DATE},
#{object.timeZone,jdbcType=VARCHAR}
) )
</insert> </insert>
@@ -142,7 +171,12 @@
SET password_hash = #{object.passwordHash,jdbcType=BINARY}, SET password_hash = #{object.passwordHash,jdbcType=BINARY},
password_salt = #{object.passwordSalt,jdbcType=BINARY}, password_salt = #{object.passwordSalt,jdbcType=BINARY},
disabled = #{object.disabled,jdbcType=BOOLEAN}, disabled = #{object.disabled,jdbcType=BOOLEAN},
expired = #{object.expired,jdbcType=BOOLEAN} expired = #{object.expired,jdbcType=BOOLEAN},
access_window_start = #{object.accessWindowStart,jdbcType=TIME},
access_window_end = #{object.accessWindowEnd,jdbcType=TIME},
valid_from = #{object.validFrom,jdbcType=DATE},
valid_until = #{object.validUntil,jdbcType=DATE},
timezone = #{object.timeZone,jdbcType=VARCHAR}
WHERE user_id = #{object.objectID,jdbcType=VARCHAR} WHERE user_id = #{object.objectID,jdbcType=VARCHAR}
</update> </update>

View File

@@ -34,6 +34,11 @@
<result column="password_salt" property="passwordSalt" jdbcType="BINARY"/> <result column="password_salt" property="passwordSalt" jdbcType="BINARY"/>
<result column="disabled" property="disabled" jdbcType="BOOLEAN"/> <result column="disabled" property="disabled" jdbcType="BOOLEAN"/>
<result column="expired" property="expired" jdbcType="BOOLEAN"/> <result column="expired" property="expired" jdbcType="BOOLEAN"/>
<result column="access_window_start" property="accessWindowStart" jdbcType="TIME"/>
<result column="access_window_end" property="accessWindowEnd" jdbcType="TIME"/>
<result column="valid_from" property="validFrom" jdbcType="DATE"/>
<result column="valid_until" property="validUntil" jdbcType="DATE"/>
<result column="timezone" property="timeZone" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<!-- Select all usernames --> <!-- Select all usernames -->
@@ -61,7 +66,12 @@
password_hash, password_hash,
password_salt, password_salt,
disabled, disabled,
expired expired,
access_window_start,
access_window_end,
valid_from,
valid_until,
timezone
FROM guacamole_user FROM guacamole_user
WHERE username IN WHERE username IN
<foreach collection="identifiers" item="identifier" <foreach collection="identifiers" item="identifier"
@@ -80,7 +90,12 @@
password_hash, password_hash,
password_salt, password_salt,
disabled, disabled,
expired expired,
access_window_start,
access_window_end,
valid_from,
valid_until,
timezone
FROM guacamole_user FROM guacamole_user
JOIN guacamole_user_permission ON affected_user_id = guacamole_user.user_id JOIN guacamole_user_permission ON affected_user_id = guacamole_user.user_id
WHERE username IN WHERE username IN
@@ -102,7 +117,12 @@
password_hash, password_hash,
password_salt, password_salt,
disabled, disabled,
expired expired,
access_window_start,
access_window_end,
valid_from,
valid_until,
timezone
FROM guacamole_user FROM guacamole_user
WHERE WHERE
username = #{username,jdbcType=VARCHAR} username = #{username,jdbcType=VARCHAR}
@@ -124,14 +144,24 @@
password_hash, password_hash,
password_salt, password_salt,
disabled, disabled,
expired expired,
access_window_start,
access_window_end,
valid_from,
valid_until,
timezone
) )
VALUES ( VALUES (
#{object.identifier,jdbcType=VARCHAR}, #{object.identifier,jdbcType=VARCHAR},
#{object.passwordHash,jdbcType=BINARY}, #{object.passwordHash,jdbcType=BINARY},
#{object.passwordSalt,jdbcType=BINARY}, #{object.passwordSalt,jdbcType=BINARY},
#{object.disabled,jdbcType=BOOLEAN}, #{object.disabled,jdbcType=BOOLEAN},
#{object.expired,jdbcType=BOOLEAN} #{object.expired,jdbcType=BOOLEAN},
#{object.accessWindowStart,jdbcType=TIME},
#{object.accessWindowEnd,jdbcType=TIME},
#{object.validFrom,jdbcType=DATE},
#{object.validUntil,jdbcType=DATE},
#{object.timeZone,jdbcType=VARCHAR}
) )
</insert> </insert>
@@ -142,7 +172,12 @@
SET password_hash = #{object.passwordHash,jdbcType=BINARY}, SET password_hash = #{object.passwordHash,jdbcType=BINARY},
password_salt = #{object.passwordSalt,jdbcType=BINARY}, password_salt = #{object.passwordSalt,jdbcType=BINARY},
disabled = #{object.disabled,jdbcType=BOOLEAN}, disabled = #{object.disabled,jdbcType=BOOLEAN},
expired = #{object.expired,jdbcType=BOOLEAN} expired = #{object.expired,jdbcType=BOOLEAN},
access_window_start = #{object.accessWindowStart,jdbcType=TIME},
access_window_end = #{object.accessWindowEnd,jdbcType=TIME},
valid_from = #{object.validFrom,jdbcType=DATE},
valid_until = #{object.validUntil,jdbcType=DATE},
timezone = #{object.timeZone,jdbcType=VARCHAR}
WHERE user_id = #{object.objectID,jdbcType=VARCHAR} WHERE user_id = #{object.objectID,jdbcType=VARCHAR}
</update> </update>