GUACAMOLE-36: Record and maintain password history.

This commit is contained in:
Michael Jumper
2016-08-22 22:06:44 -07:00
parent ae695ef17b
commit a943077d40
7 changed files with 111 additions and 2 deletions

View File

@@ -63,7 +63,19 @@
#{record.passwordHash,jdbcType=BINARY},
#{record.passwordSalt,jdbcType=BINARY},
#{record.passwordDate,jdbcType=TIMESTAMP}
)
);
DELETE FROM guacamole_user_password_history
WHERE password_history_id <= (
SELECT password_history_id
FROM (
SELECT password_history_id
FROM guacamole_user_password_history
WHERE user_id = #{record.userID,jdbcType=INTEGER}
ORDER BY password_date DESC
LIMIT 1 OFFSET #{maxHistorySize}
) old_password_record
);
</insert>