mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 00:53:21 +00:00 
			
		
		
		
	GUACAMOLE-394: Automatically update the end time of user history records upon logout.
This commit is contained in:
		| @@ -25,6 +25,7 @@ | ||||
|  | ||||
|     <!-- Result mapper for system permissions --> | ||||
|     <resultMap id="UserRecordResultMap" type="org.apache.guacamole.auth.jdbc.base.ActivityRecordModel"> | ||||
|         <id     column="history_id"  property="recordID"   jdbcType="INTEGER"/> | ||||
|         <result column="remote_host" property="remoteHost" jdbcType="VARCHAR"/> | ||||
|         <result column="user_id"     property="userID"     jdbcType="INTEGER"/> | ||||
|         <result column="username"    property="username"   jdbcType="VARCHAR"/> | ||||
| @@ -52,7 +53,8 @@ | ||||
|     </select> | ||||
|  | ||||
|     <!-- Insert the given user record --> | ||||
|     <insert id="insert" parameterType="org.apache.guacamole.auth.jdbc.base.ActivityRecordModel"> | ||||
|     <insert id="insert" useGeneratedKeys="true" keyProperty="record.recordID" | ||||
|             parameterType="org.apache.guacamole.auth.jdbc.base.ActivityRecordModel"> | ||||
|  | ||||
|         INSERT INTO guacamole_user_history ( | ||||
|             remote_host, | ||||
| @@ -72,6 +74,18 @@ | ||||
|  | ||||
|     </insert> | ||||
|  | ||||
|     <!-- Update the given user record --> | ||||
|     <update id="update" parameterType="org.apache.guacamole.auth.jdbc.base.ActivityRecordModel"> | ||||
|         UPDATE guacamole_user_history | ||||
|         SET remote_host = #{record.remoteHost,jdbcType=VARCHAR}, | ||||
|             user_id     = (SELECT user_id FROM guacamole_user | ||||
|                            WHERE username = #{record.username,jdbcType=VARCHAR}), | ||||
|             username    = #{record.username,jdbcType=VARCHAR}, | ||||
|             start_date  = #{record.startDate,jdbcType=TIMESTAMP}, | ||||
|             end_date    = #{record.endDate,jdbcType=TIMESTAMP} | ||||
|         WHERE history_id = #{record.recordID,jdbcType=INTEGER} | ||||
|     </update> | ||||
|  | ||||
|     <!-- Search for specific user records --> | ||||
|     <select id="search" resultMap="UserRecordResultMap"> | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user