Quota: fix
This commit is contained in:
parent
679a414f16
commit
f655620485
@ -197,7 +197,7 @@ public class EmployeeFullDtoHelper : EmployeeDtoHelper
|
||||
|
||||
await Init(result, userInfo);
|
||||
|
||||
result.UsedSpace = Math.Max(0, _userManager.FindUserQuotaRows(_context.Tenant.Id, userInfo.Id).Where(r => !string.IsNullOrEmpty(r.Tag)).Sum(r => r.Counter));
|
||||
result.UsedSpace = Math.Max(0, _userManager.FindUserQuotaRows(_context.Tenant.Id, userInfo.IsLDAP() ? Guid.Parse(userInfo.Sid) : userInfo.Id).Where(r => !string.IsNullOrEmpty(r.Tag)).Sum(r => r.Counter));
|
||||
|
||||
var quotaSettings = _settingsManager.Load<TenantUserQuotaSettings>();
|
||||
var userQuotaSettings = _settingsManager.LoadForUser<UserQuotaSettings>(userInfo);
|
||||
|
@ -426,7 +426,7 @@ internal class FileDao : AbstractDao, IFileDao<int>
|
||||
|
||||
if (quotaLimit != -1)
|
||||
{
|
||||
var userUsedSpace = Math.Max(0, _userManager.FindUserQuotaRows(TenantID, user.Id).Where(r => !string.IsNullOrEmpty(r.Tag)).Sum(r => r.Counter));
|
||||
var userUsedSpace = Math.Max(0, _userManager.FindUserQuotaRows(TenantID,user.IsLDAP() ? Guid.Parse(user.Sid) : user.Id).Where(r => !string.IsNullOrEmpty(r.Tag)).Sum(r => r.Counter));
|
||||
|
||||
if (quotaLimit - userUsedSpace < file.ContentLength)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user