mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Fixed username update or user delete does not cause asset ownership update
This commit is contained in:
@@ -51,7 +51,9 @@ public class UsersController : Controller
|
||||
{
|
||||
try
|
||||
{
|
||||
var syncAssetOwnership = SynchronizationHelper.SyncAssetOwnership(_ldap, uid, "");
|
||||
await _ldap.DeleteUserAsync(uid);
|
||||
await syncAssetOwnership;
|
||||
return new UsersDeleteRequestModel(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -122,8 +124,10 @@ public class UsersController : Controller
|
||||
UserModel? user = null;
|
||||
if (requestModel.NewUid is not null && requestModel.NewUid.Length > 0)
|
||||
{
|
||||
var syncAssetOwnership = SynchronizationHelper.SyncAssetOwnership(_ldap, uid, requestModel.NewUid);
|
||||
await _ldap.UpdateUser(uid, "uid", requestModel.NewUid);
|
||||
uid = requestModel.NewUid;
|
||||
await syncAssetOwnership;
|
||||
}
|
||||
if (requestModel.Title is not null)
|
||||
{
|
||||
@@ -166,8 +170,10 @@ public class UsersController : Controller
|
||||
}
|
||||
if (newUid != uid)
|
||||
{
|
||||
var syncAssetOwnership = SynchronizationHelper.SyncAssetOwnership(_ldap, uid, newUid);
|
||||
await _ldap.UpdateUser(uid, "uid", newUid);
|
||||
uid = newUid;
|
||||
await syncAssetOwnership;
|
||||
}
|
||||
return new() { Success = true, NewUid = uid };
|
||||
} catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user