mirror of
https://github.com/lldap/lldap.git
synced 2026-03-31 15:07:48 +01:00
Update user modification time when changing password
Added modified_date update to OPAQUE password registration to ensure both password_modified_date and user modified_date are updated when passwords change. This provides better compatibility with LDAP clients that rely on modifyTimestamp for cache invalidation. Co-authored-by: nitnelave <796633+nitnelave@users.noreply.github.com>
This commit is contained in:
@@ -291,10 +291,11 @@ pub fn make_ldap_subschema_entry(schema: PublicSchema) -> LdapOp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn is_root_dse_request(request: &LdapSearchRequest) -> bool {
|
pub(crate) fn is_root_dse_request(request: &LdapSearchRequest) -> bool {
|
||||||
if request.base.is_empty()
|
if request.base.is_empty()
|
||||||
&& request.scope == LdapSearchScope::Base
|
&& request.scope == LdapSearchScope::Base
|
||||||
&& let LdapFilter::Present(attribute) = &request.filter
|
&& let LdapFilter::Present(attribute) = &request.filter
|
||||||
&& attribute.eq_ignore_ascii_case("objectclass") {
|
&& attribute.eq_ignore_ascii_case("objectclass")
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
|
|||||||
@@ -202,6 +202,7 @@ impl OpaqueHandler for SqlOpaqueHandler {
|
|||||||
user_id: ActiveValue::Set(username.clone()),
|
user_id: ActiveValue::Set(username.clone()),
|
||||||
password_hash: ActiveValue::Set(Some(password_file.serialize())),
|
password_hash: ActiveValue::Set(Some(password_file.serialize())),
|
||||||
password_modified_date: ActiveValue::Set(now),
|
password_modified_date: ActiveValue::Set(now),
|
||||||
|
modified_date: ActiveValue::Set(now),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
user_update.update(&self.sql_pool).await?;
|
user_update.update(&self.sql_pool).await?;
|
||||||
|
|||||||
Reference in New Issue
Block a user