mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 00:53:21 +00:00 
			
		
		
		
	GUAC-1101: Implement connection and group duplicate checks. Fix username duplicate check.
This commit is contained in:
		| @@ -107,6 +107,22 @@ | ||||
|  | ||||
|     </select> | ||||
|  | ||||
|     <!-- Select single connection by name --> | ||||
|     <select id="selectOneByName" resultMap="ConnectionResultMap"> | ||||
|  | ||||
|         SELECT | ||||
|             connection_id, | ||||
|             connection_name, | ||||
|             parent_id, | ||||
|             protocol  | ||||
|         FROM guacamole_connection | ||||
|         WHERE  | ||||
|             <if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=VARCHAR}</if> | ||||
|             <if test="parentIdentifier == null">parent_id IS NULL</if> | ||||
|             AND connection_name = #{name,jdbcType=VARCHAR} | ||||
|  | ||||
|     </select> | ||||
|  | ||||
|     <!-- Delete single connection by identifier --> | ||||
|     <delete id="delete"> | ||||
|         DELETE FROM guacamole_connection | ||||
|   | ||||
| @@ -108,6 +108,22 @@ | ||||
|  | ||||
|     </select> | ||||
|  | ||||
|     <!-- Select single connection group by name --> | ||||
|     <select id="selectOneByName" resultMap="ConnectionGroupResultMap"> | ||||
|  | ||||
|         SELECT | ||||
|             connection_group_id, | ||||
|             connection_group_name, | ||||
|             parent_id, | ||||
|             type | ||||
|         FROM guacamole_connection_group | ||||
|         WHERE  | ||||
|             <if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=VARCHAR}</if> | ||||
|             <if test="parentIdentifier == null">parent_id IS NULL</if> | ||||
|             AND connection_group_name = #{name,jdbcType=VARCHAR} | ||||
|  | ||||
|     </select> | ||||
|  | ||||
|     <!-- Delete single connection group by identifier --> | ||||
|     <delete id="delete"> | ||||
|         DELETE FROM guacamole_connection_group | ||||
|   | ||||
| @@ -87,8 +87,8 @@ | ||||
|  | ||||
|     </select> | ||||
|  | ||||
|  | ||||
|     <select id="selectByCredentials" resultMap="UserResultMap"> | ||||
|     <!-- Select single user by credentials --> | ||||
|     <select id="selectOneByCredentials" resultMap="UserResultMap"> | ||||
|         SELECT | ||||
|             user_id, | ||||
|             username, | ||||
| @@ -100,6 +100,20 @@ | ||||
|             AND password_hash = UNHEX(SHA2(CONCAT(#{password,jdbcType=VARCHAR}, HEX(password_salt)), 256)) | ||||
|     </select> | ||||
|  | ||||
|     <!-- Select single user by username --> | ||||
|     <select id="selectOne" resultMap="UserResultMap"> | ||||
|  | ||||
|         SELECT | ||||
|             user_id, | ||||
|             username, | ||||
|             password_hash, | ||||
|             password_salt | ||||
|         FROM guacamole_user | ||||
|         WHERE | ||||
|             username = #{identifier,jdbcType=VARCHAR} | ||||
|  | ||||
|     </select> | ||||
|  | ||||
|     <!-- Delete single user by username --> | ||||
|     <delete id="delete"> | ||||
|         DELETE FROM guacamole_user | ||||
|   | ||||
		Reference in New Issue
	
	Block a user