rename and replace models

This commit is contained in:
Anton Suhorukov 2022-03-01 11:59:06 +03:00
parent c3742208cc
commit 0ff56392f8
35 changed files with 678 additions and 678 deletions

View File

@ -1,19 +1,19 @@
namespace ASC.Web.Api.Models
{
public class AuthModel
{
public string UserName { get; set; }
public string Password { get; set; }
public string PasswordHash { get; set; }
public string Provider { get; set; }
public string AccessToken { get; set; }
public string SerializedProfile { get; set; }
public string Code { get; set; }
public bool Session { get; set; }
}
public class MobileModel
{
public string MobilePhone { get; set; }
}
}
namespace ASC.Web.Api.Models
{
public class AuthModel
{
public string UserName { get; set; }
public string Password { get; set; }
public string PasswordHash { get; set; }
public string Provider { get; set; }
public string AccessToken { get; set; }
public string SerializedProfile { get; set; }
public string Code { get; set; }
public bool Session { get; set; }
}
public class MobileModel
{
public string MobilePhone { get; set; }
}
}

View File

@ -1,34 +1,34 @@
namespace ASC.Web.Api.Models
{
public class AuthServiceModel
{
public string Name { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public string Instruction { get; set; }
public bool CanSet { get; set; }
public List<AuthKey> Props { get; set; }
public AuthServiceModel()
{
}
public AuthServiceModel(Consumer consumer)
{
var authService = new AuthService(consumer);
Name = authService.Name;
Title = authService.Title;
Description = authService.Description;
Instruction = authService.Instruction;
CanSet = authService.CanSet;
if (consumer.CanSet)
{
Props = authService.Props;
CanSet = authService.CanSet;
}
}
}
}
namespace ASC.Web.Api.Models
{
public class AuthServiceModel
{
public string Name { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public string Instruction { get; set; }
public bool CanSet { get; set; }
public List<AuthKey> Props { get; set; }
public AuthServiceModel()
{
}
public AuthServiceModel(Consumer consumer)
{
var authService = new AuthService(consumer);
Name = authService.Name;
Title = authService.Title;
Description = authService.Description;
Instruction = authService.Instruction;
CanSet = authService.CanSet;
if (consumer.CanSet)
{
Props = authService.Props;
CanSet = authService.CanSet;
}
}
}
}

View File

@ -1,33 +1,33 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2018
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
namespace ASC.Web.Api.Models
{
public class IpRestrictionsModel
{
public IEnumerable<string> Ips { get; set; }
public bool Enable { get; set; }
}
}
/*
*
* (c) Copyright Ascensio System Limited 2010-2018
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
namespace ASC.Web.Api.Models
{
public class IpRestrictionsModel
{
public IEnumerable<string> Ips { get; set; }
public bool Enable { get; set; }
}
}

View File

@ -1,16 +1,16 @@
namespace ASC.Web.Api.Models
{
public class MailDomainSettingsModel
{
public TenantTrustedDomainsType Type { get; set; }
public List<string> Domains { get; set; }
public bool InviteUsersAsVisitors { get; set; }
}
public class AdminMessageSettingsModel
{
public string Email { get; set; }
public string Message { get; set; }
public bool TurnOn { get; set; }
}
}
namespace ASC.Web.Api.Models
{
public class MailDomainSettingsModel
{
public TenantTrustedDomainsType Type { get; set; }
public List<string> Domains { get; set; }
public bool InviteUsersAsVisitors { get; set; }
}
public class AdminMessageSettingsModel
{
public string Email { get; set; }
public string Message { get; set; }
public bool TurnOn { get; set; }
}
}

View File

@ -1,7 +1,7 @@
namespace ASC.Web.Api.Models
{
public class MobileAppModel
{
public MobileAppType Type { get; set; }
}
}
namespace ASC.Web.Api.Models
{
public class MobileAppModel
{
public MobileAppType Type { get; set; }
}
}

View File

@ -1,17 +1,17 @@
namespace ASC.Web.Api.Models
{
public class SchemaModel
{
public string Id { get; set; }
public string Name { get; set; }
public string UserCaption { get; set; }
public string UsersCaption { get; set; }
public string GroupCaption { get; set; }
public string GroupsCaption { get; set; }
public string UserPostCaption { get; set; }
public string RegDateCaption { get; set; }
public string GroupHeadCaption { get; set; }
public string GuestCaption { get; set; }
public string GuestsCaption { get; set; }
}
}
namespace ASC.Web.Api.Models
{
public class SchemaModel
{
public string Id { get; set; }
public string Name { get; set; }
public string UserCaption { get; set; }
public string UsersCaption { get; set; }
public string GroupCaption { get; set; }
public string GroupsCaption { get; set; }
public string UserPostCaption { get; set; }
public string RegDateCaption { get; set; }
public string GroupHeadCaption { get; set; }
public string GuestCaption { get; set; }
public string GuestsCaption { get; set; }
}
}

View File

@ -1,11 +1,11 @@
namespace ASC.Web.Api.Models
{
public class SecurityModel
{
public Guid ProductId { get; set; }
public Guid UserId { get; set; }
public bool Administrator { get; set; }
}
}
namespace ASC.Web.Api.Models
{
public class SecurityModel
{
public Guid ProductId { get; set; }
public Guid UserId { get; set; }
public bool Administrator { get; set; }
}
}

View File

@ -1,19 +1,19 @@
namespace ASC.Web.Api.Models
{
public class SettingsModel
{
public Guid DefaultProductID { get; set; }
public string Lng { get; set; }
public string TimeZoneID { get; set; }
public string Theme { get; set; }
public bool Show { get; set; } //tips
public int VersionId { get; set; }
public Guid OwnerId { get; set; }
}
}
namespace ASC.Web.Api.Models
{
public class SettingsModel
{
public Guid DefaultProductID { get; set; }
public string Lng { get; set; }
public string TimeZoneID { get; set; }
public string Theme { get; set; }
public bool Show { get; set; } //tips
public int VersionId { get; set; }
public Guid OwnerId { get; set; }
}
}

View File

@ -1,7 +1,7 @@
namespace ASC.Web.Api.Models
{
public class ShortenLinkModel
{
public string Link { get; set; }
}
}
namespace ASC.Web.Api.Models
{
public class ShortenLinkModel
{
public string Link { get; set; }
}
}

View File

@ -1,8 +1,8 @@
namespace ASC.Web.Api.Models
{
public class StorageModel
{
public string Module { get; set; }
public IEnumerable<ItemKeyValuePair<string, string>> Props { get; set; }
}
}
namespace ASC.Web.Api.Models
{
public class StorageModel
{
public string Module { get; set; }
public IEnumerable<ItemKeyValuePair<string, string>> Props { get; set; }
}
}

View File

@ -1,13 +1,13 @@
namespace ASC.Web.Api.Models
{
public class TfaModel
{
public string Type { get; set; }
public Guid? Id { get; set; }
}
public class TfaValidateModel
{
public string Code { get; set; }
}
}
namespace ASC.Web.Api.Models
{
public class TfaModel
{
public string Type { get; set; }
public Guid? Id { get; set; }
}
public class TfaValidateModel
{
public string Code { get; set; }
}
}

View File

@ -1,10 +1,10 @@
namespace ASC.Web.Api.Models
{
public class TfaSettings
{
public string Id { get; set; }
public string Title { get; set; }
public bool Enabled { get; set; }
public bool Avaliable { get; set; }
}
}
namespace ASC.Web.Api.Models
{
public class TfaSettings
{
public string Id { get; set; }
public string Title { get; set; }
public bool Enabled { get; set; }
public bool Avaliable { get; set; }
}
}

View File

@ -1,8 +1,8 @@
namespace ASC.Web.Api.Models
{
public class ThirdpartyModel
{
public string Code { get; set; }
public string Redirect { get; set; }
}
}
namespace ASC.Web.Api.Models
{
public class ThirdpartyModel
{
public string Code { get; set; }
public string Redirect { get; set; }
}
}

View File

@ -1,7 +1,7 @@
namespace ASC.Web.Api.Models
{
public class UploadLicenseModel
{
public IEnumerable<IFormFile> Files { get; set; }
}
}
namespace ASC.Web.Api.Models
{
public class UploadLicenseModel
{
public IEnumerable<IFormFile> Files { get; set; }
}
}

View File

@ -1,10 +1,10 @@
namespace ASC.Web.Api.Models
{
public class WebItemSecurityModel
{
public string Id { get; set; }
public bool Enabled { get; set; }
public IEnumerable<Guid> Subjects { get; set; }
public IEnumerable<ItemKeyValuePair<string, bool>> Items { get; set; }
}
}
namespace ASC.Web.Api.Models
{
public class WebItemSecurityModel
{
public string Id { get; set; }
public bool Enabled { get; set; }
public IEnumerable<Guid> Subjects { get; set; }
public IEnumerable<ItemKeyValuePair<string, bool>> Items { get; set; }
}
}

View File

@ -1,14 +1,14 @@
namespace ASC.Web.Api.Models
{
public class WhiteLabelModel
{
public string LogoText { get; set; }
public IEnumerable<ItemKeyValuePair<string, string>> Logo { get; set; }
}
public class WhiteLabelQuery
{
public bool IsDefault { get; set; }
public bool IsRetina { get; set; }
}
}
namespace ASC.Web.Api.Models
{
public class WhiteLabelModel
{
public string LogoText { get; set; }
public IEnumerable<ItemKeyValuePair<string, string>> Logo { get; set; }
}
public class WhiteLabelQuery
{
public bool IsDefault { get; set; }
public bool IsRetina { get; set; }
}
}

View File

@ -1,18 +1,18 @@
namespace ASC.Web.Api.Models
{
public class WizardModel
{
public string Email { get; set; }
public string PasswordHash { get; set; }
public string Lng { get; set; }
public string TimeZone { get; set; }
public string Promocode { get; set; }
public string AmiId { get; set; }
public bool SubscribeFromSite { get; set; }
public void Deconstruct(out string email, out string passwordHash, out string lng, out string timeZone, out string promocode, out string amiid, out bool subscribeFromSite)
{
(email, passwordHash, lng, timeZone, promocode, amiid, subscribeFromSite) = (Email, PasswordHash, Lng, TimeZone, Promocode, AmiId, SubscribeFromSite);
}
}
}
namespace ASC.Web.Api.Models
{
public class WizardModel
{
public string Email { get; set; }
public string PasswordHash { get; set; }
public string Lng { get; set; }
public string TimeZone { get; set; }
public string Promocode { get; set; }
public string AmiId { get; set; }
public bool SubscribeFromSite { get; set; }
public void Deconstruct(out string email, out string passwordHash, out string lng, out string timeZone, out string promocode, out string amiid, out bool subscribeFromSite)
{
(email, passwordHash, lng, timeZone, promocode, amiid, subscribeFromSite) = (Email, PasswordHash, Lng, TimeZone, Promocode, AmiId, SubscribeFromSite);
}
}
}

View File

@ -1,27 +1,27 @@
namespace ASC.Web.Api.Models
{
public class CapabilitiesData
{
public bool LdapEnabled { get; set; }
public List<string> Providers { get; set; }
public string SsoLabel { get; set; }
/// <summary>
/// if empty sso is disabled
/// </summary>
public string SsoUrl { get; set; }
public static CapabilitiesData GetSample()
{
return new CapabilitiesData
{
LdapEnabled = false,
// Providers = AccountLinkControl.AuthProviders,
SsoLabel = string.Empty,
SsoUrl = string.Empty,
};
}
}
}
namespace ASC.Web.Api.Models
{
public class CapabilitiesData
{
public bool LdapEnabled { get; set; }
public List<string> Providers { get; set; }
public string SsoLabel { get; set; }
/// <summary>
/// if empty sso is disabled
/// </summary>
public string SsoUrl { get; set; }
public static CapabilitiesData GetSample()
{
return new CapabilitiesData
{
LdapEnabled = false,
// Providers = AccountLinkControl.AuthProviders,
SsoLabel = string.Empty,
SsoUrl = string.Empty,
};
}
}
}

View File

@ -1,148 +1,148 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2018
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
using Constants = ASC.Core.Users.Constants;
namespace ASC.Web.Studio.Core.Quota
{
public class QuotaWrapper
{
public ulong StorageSize { get; set; }
public ulong MaxFileSize { get; set; }
public ulong UsedSize { get; set; }
public int MaxUsersCount { get; set; }
public int UsersCount { get; set; }
public ulong AvailableSize
{
get { return Math.Max(0, StorageSize > UsedSize ? StorageSize - UsedSize : 0); }
set { throw new NotImplementedException(); }
}
public int AvailableUsersCount
{
get { return Math.Max(0, MaxUsersCount - UsersCount); }
set { throw new NotImplementedException(); }
}
public IList<QuotaUsage> StorageUsage { get; set; }
public long UserStorageSize { get; set; }
public long UserUsedSize { get; set; }
public long UserAvailableSize
{
get { return Math.Max(0, UserStorageSize - UserUsedSize); }
set { throw new NotImplementedException(); }
}
public long MaxVisitors { get; set; }
public long VisitorsCount { get; set; }
[JsonIgnore]
private TenantExtra TenantExtra { get; }
[JsonIgnore]
private TenantStatisticsProvider TenantStatisticsProvider { get; }
[JsonIgnore]
private WebItemManager WebItemManager { get; }
public QuotaWrapper()
{
}
public QuotaWrapper(
Tenant tenant,
CoreBaseSettings coreBaseSettings,
CoreConfiguration configuration,
TenantExtra tenantExtra,
TenantStatisticsProvider tenantStatisticsProvider,
AuthContext authContext,
SettingsManager settingsManager,
WebItemManager webItemManager,
Constants constants)
{
TenantExtra = tenantExtra;
TenantStatisticsProvider = tenantStatisticsProvider;
WebItemManager = webItemManager;
var quota = TenantExtra.GetTenantQuota();
var quotaRows = TenantStatisticsProvider.GetQuotaRows(tenant.Id).ToList();
StorageSize = (ulong)Math.Max(0, quota.MaxTotalSize);
UsedSize = (ulong)Math.Max(0, quotaRows.Sum(r => r.Counter));
MaxUsersCount = quota.ActiveUsers;
UsersCount = coreBaseSettings.Personal ? 1 : TenantStatisticsProvider.GetUsersCount();
MaxVisitors = coreBaseSettings.Standalone ? -1 : constants.CoefficientOfVisitors * quota.ActiveUsers;
VisitorsCount = coreBaseSettings.Personal ? 0 : TenantStatisticsProvider.GetVisitorsCount();
StorageUsage = quotaRows
.Select(x => new QuotaUsage { Path = x.Path.TrimStart('/').TrimEnd('/'), Size = x.Counter, })
.ToList();
if (coreBaseSettings.Personal && SetupInfo.IsVisibleSettings("PersonalMaxSpace"))
{
UserStorageSize = configuration.PersonalMaxSpace(settingsManager);
var webItem = WebItemManager[WebItemManager.DocumentsProductID];
if (webItem.Context.SpaceUsageStatManager is IUserSpaceUsage spaceUsageManager)
{
UserUsedSize = spaceUsageManager.GetUserSpaceUsageAsync(authContext.CurrentAccount.ID).Result;
}
}
MaxFileSize = Math.Min(AvailableSize, (ulong)quota.MaxFileSize);
}
public static QuotaWrapper GetSample()
{
return new QuotaWrapper
{
MaxFileSize = 25 * 1024 * 1024,
StorageSize = 1024 * 1024 * 1024,
UsedSize = 250 * 1024 * 1024,
StorageUsage = new List<QuotaUsage>
{
new QuotaUsage { Size = 100*1024*1024, Path = "crm" },
new QuotaUsage { Size = 150*1024*1024, Path = "files" }
}
};
}
public class QuotaUsage
{
public string Path { get; set; }
public long Size { get; set; }
}
}
/*
*
* (c) Copyright Ascensio System Limited 2010-2018
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
using Constants = ASC.Core.Users.Constants;
namespace ASC.Web.Studio.Core.Quota
{
public class QuotaWrapper
{
public ulong StorageSize { get; set; }
public ulong MaxFileSize { get; set; }
public ulong UsedSize { get; set; }
public int MaxUsersCount { get; set; }
public int UsersCount { get; set; }
public ulong AvailableSize
{
get { return Math.Max(0, StorageSize > UsedSize ? StorageSize - UsedSize : 0); }
set { throw new NotImplementedException(); }
}
public int AvailableUsersCount
{
get { return Math.Max(0, MaxUsersCount - UsersCount); }
set { throw new NotImplementedException(); }
}
public IList<QuotaUsage> StorageUsage { get; set; }
public long UserStorageSize { get; set; }
public long UserUsedSize { get; set; }
public long UserAvailableSize
{
get { return Math.Max(0, UserStorageSize - UserUsedSize); }
set { throw new NotImplementedException(); }
}
public long MaxVisitors { get; set; }
public long VisitorsCount { get; set; }
[JsonIgnore]
private TenantExtra TenantExtra { get; }
[JsonIgnore]
private TenantStatisticsProvider TenantStatisticsProvider { get; }
[JsonIgnore]
private WebItemManager WebItemManager { get; }
public QuotaWrapper()
{
}
public QuotaWrapper(
Tenant tenant,
CoreBaseSettings coreBaseSettings,
CoreConfiguration configuration,
TenantExtra tenantExtra,
TenantStatisticsProvider tenantStatisticsProvider,
AuthContext authContext,
SettingsManager settingsManager,
WebItemManager webItemManager,
Constants constants)
{
TenantExtra = tenantExtra;
TenantStatisticsProvider = tenantStatisticsProvider;
WebItemManager = webItemManager;
var quota = TenantExtra.GetTenantQuota();
var quotaRows = TenantStatisticsProvider.GetQuotaRows(tenant.TenantId).ToList();
StorageSize = (ulong)Math.Max(0, quota.MaxTotalSize);
UsedSize = (ulong)Math.Max(0, quotaRows.Sum(r => r.Counter));
MaxUsersCount = quota.ActiveUsers;
UsersCount = coreBaseSettings.Personal ? 1 : TenantStatisticsProvider.GetUsersCount();
MaxVisitors = coreBaseSettings.Standalone ? -1 : constants.CoefficientOfVisitors * quota.ActiveUsers;
VisitorsCount = coreBaseSettings.Personal ? 0 : TenantStatisticsProvider.GetVisitorsCount();
StorageUsage = quotaRows
.Select(x => new QuotaUsage { Path = x.Path.TrimStart('/').TrimEnd('/'), Size = x.Counter, })
.ToList();
if (coreBaseSettings.Personal && SetupInfo.IsVisibleSettings("PersonalMaxSpace"))
{
UserStorageSize = configuration.PersonalMaxSpace(settingsManager);
var webItem = WebItemManager[WebItemManager.DocumentsProductID];
if (webItem.Context.SpaceUsageStatManager is IUserSpaceUsage spaceUsageManager)
{
UserUsedSize = spaceUsageManager.GetUserSpaceUsageAsync(authContext.CurrentAccount.ID).Result;
}
}
MaxFileSize = Math.Min(AvailableSize, (ulong)quota.MaxFileSize);
}
public static QuotaWrapper GetSample()
{
return new QuotaWrapper
{
MaxFileSize = 25 * 1024 * 1024,
StorageSize = 1024 * 1024 * 1024,
UsedSize = 250 * 1024 * 1024,
StorageUsage = new List<QuotaUsage>
{
new QuotaUsage { Size = 100*1024*1024, Path = "crm" },
new QuotaUsage { Size = 150*1024*1024, Path = "files" }
}
};
}
public class QuotaUsage
{
public string Path { get; set; }
public long Size { get; set; }
}
}
}

View File

@ -1,58 +1,58 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2018
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
namespace ASC.Api.Settings
{
public class SecurityWrapper
{
public string WebItemId { get; set; }
public IEnumerable<EmployeeWraper> Users { get; set; }
public IEnumerable<GroupWrapperSummary> Groups { get; set; }
public bool Enabled { get; set; }
public bool IsSubItem { get; set; }
public static SecurityWrapper GetSample()
{
return new SecurityWrapper
{
WebItemId = Guid.Empty.ToString(),
Enabled = true,
IsSubItem = false,
Groups = new List<GroupWrapperSummary>
{
GroupWrapperSummary.GetSample()
},
Users = new List<EmployeeWraper>
{
EmployeeWraper.GetSample()
}
};
}
}
/*
*
* (c) Copyright Ascensio System Limited 2010-2018
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
namespace ASC.Api.Settings
{
public class SecurityWrapper
{
public string WebItemId { get; set; }
public IEnumerable<EmployeeWraper> Users { get; set; }
public IEnumerable<GroupWrapperSummary> Groups { get; set; }
public bool Enabled { get; set; }
public bool IsSubItem { get; set; }
public static SecurityWrapper GetSample()
{
return new SecurityWrapper
{
WebItemId = Guid.Empty.ToString(),
Enabled = true,
IsSubItem = false,
Groups = new List<GroupWrapperSummary>
{
GroupWrapperSummary.GetSample()
},
Users = new List<EmployeeWraper>
{
EmployeeWraper.GetSample()
}
};
}
}
}

View File

@ -1,84 +1,84 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2018
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
namespace ASC.Api.Settings
{
public class SettingsWrapper
{
public string Timezone { get; set; }
public List<string> TrustedDomains { get; set; }
public TenantTrustedDomainsType TrustedDomainsType { get; set; }
public string Culture { get; set; }
public TimeSpan UtcOffset { get; set; }
public double UtcHoursOffset { get; set; }
public string GreetingSettings { get; set; }
public Guid OwnerId { get; set; }
public string NameSchemaId { get; set; }
public bool? EnabledJoin { get; set; }
public bool? EnableAdmMess { get; set; }
public bool? ThirdpartyEnable { get; set; }
public bool Personal { get; set; }
public string WizardToken { get; set; }
public PasswordHasher PasswordHash { get; set; }
public FirebaseWrapper Firebase { get; set; }
public string Version { get; set; }
public string RecaptchaPublicKey { get; set; }
public bool DebugInfo { get; set; }
public string SocketUrl { get; set; }
public static SettingsWrapper GetSample()
{
return new SettingsWrapper
{
Culture = "en-US",
Timezone = TimeZoneInfo.Utc.ToString(),
TrustedDomains = new List<string> { "mydomain.com" },
UtcHoursOffset = -8.5,
UtcOffset = TimeSpan.FromHours(-8.5),
GreetingSettings = "Web Office Applications",
OwnerId = new Guid()
};
}
}
/*
*
* (c) Copyright Ascensio System Limited 2010-2018
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
namespace ASC.Api.Settings
{
public class SettingsWrapper
{
public string Timezone { get; set; }
public List<string> TrustedDomains { get; set; }
public TenantTrustedDomainsType TrustedDomainsType { get; set; }
public string Culture { get; set; }
public TimeSpan UtcOffset { get; set; }
public double UtcHoursOffset { get; set; }
public string GreetingSettings { get; set; }
public Guid OwnerId { get; set; }
public string NameSchemaId { get; set; }
public bool? EnabledJoin { get; set; }
public bool? EnableAdmMess { get; set; }
public bool? ThirdpartyEnable { get; set; }
public bool Personal { get; set; }
public string WizardToken { get; set; }
public PasswordHasher PasswordHash { get; set; }
public FirebaseWrapper Firebase { get; set; }
public string Version { get; set; }
public string RecaptchaPublicKey { get; set; }
public bool DebugInfo { get; set; }
public string SocketUrl { get; set; }
public static SettingsWrapper GetSample()
{
return new SettingsWrapper
{
Culture = "en-US",
Timezone = TimeZoneInfo.Utc.ToString(),
TrustedDomains = new List<string> { "mydomain.com" },
UtcHoursOffset = -8.5,
UtcOffset = TimeSpan.FromHours(-8.5),
GreetingSettings = "Web Office Applications",
OwnerId = new Guid()
};
}
}
}

View File

@ -45,16 +45,16 @@ namespace ASC.Api.Settings.Smtp
public static SmtpSettingsWrapper GetSample()
{
return new SmtpSettingsWrapper
{
Host = "mail.example.com",
Port = 25,
CredentialsUserName = "notify@example.com",
CredentialsUserPassword = "{password}",
EnableAuth = true,
EnableSSL = false,
SenderAddress = "notify@example.com",
SenderDisplayName = "Postman"
return new SmtpSettingsWrapper
{
Host = "mail.example.com",
Port = 25,
CredentialsUserName = "notify@example.com",
CredentialsUserPassword = "{password}",
EnableAuth = true,
EnableSSL = false,
SenderAddress = "notify@example.com",
SenderDisplayName = "Postman"
};
}
}

View File

@ -39,13 +39,13 @@ namespace ASC.Api.Settings
public static UsageSpaceStatItemWrapper GetSample()
{
return new UsageSpaceStatItemWrapper
{
Name = "Item name",
Icon = "Item icon path",
Disabled = false,
Size = "0 Byte",
Url = "Item url"
return new UsageSpaceStatItemWrapper
{
Name = "Item name",
Icon = "Item icon path",
Disabled = false,
Size = "0 Byte",
Url = "Item url"
};
}
}
@ -62,12 +62,12 @@ namespace ASC.Api.Settings
public static ChartPointWrapper GetSample()
{
return new ChartPointWrapper
{
DisplayDate = DateTime.Now.ToShortDateString(),
Date = DateTime.Now,
Hosts = 0,
Hits = 0
return new ChartPointWrapper
{
DisplayDate = DateTime.Now.ToShortDateString(),
Date = DateTime.Now,
Hosts = 0,
Hits = 0
};
}
}

View File

@ -62,7 +62,7 @@ namespace ASC.Api.Settings
r => new AuthKey
{
Name = r.Key,
Value = r.Value,
Value = r.Value,
Title = ConsumerExtension.GetResourceString(consumer.Name + r.Key) ?? r.Key
}).ToList();
}

View File

@ -1,39 +1,39 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2018
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
namespace ASC.Api.Settings
{
public class TenantVersionWrapper
{
public int Current { get; set; }
public IEnumerable<TenantVersion> Versions { get; set; }
public TenantVersionWrapper(int version, IEnumerable<TenantVersion> tenantVersions)
{
Current = version;
Versions = tenantVersions;
}
}
/*
*
* (c) Copyright Ascensio System Limited 2010-2018
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
namespace ASC.Api.Settings
{
public class TenantVersionWrapper
{
public int Current { get; set; }
public IEnumerable<TenantVersion> Versions { get; set; }
public TenantVersionWrapper(int version, IEnumerable<TenantVersion> tenantVersions)
{
Current = version;
Versions = tenantVersions;
}
}
}

View File

@ -24,10 +24,10 @@
*/
using ASC.Web.Files.Services.DocumentService;
using ASC.Web.Files.Services.DocumentService;
namespace ASC.Api.Settings
{
{
[Scope]
public class BuildVersion
{
@ -35,33 +35,33 @@ namespace ASC.Api.Settings
public string DocumentServer { get; set; }
public string MailServer { get; set; }
public string XmppServer { get; set; }
[JsonIgnore]
private IConfiguration Configuration { get; }
[JsonIgnore]
private FilesLinkUtility FilesLinkUtility { get; }
[JsonIgnore]
private DocumentServiceConnector DocumentServiceConnector { get; }
public BuildVersion(IConfiguration configuration, FilesLinkUtility filesLinkUtility, DocumentServiceConnector documentServiceConnector)
{
Configuration = configuration;
FilesLinkUtility = filesLinkUtility;
DocumentServiceConnector = documentServiceConnector;
}
public string MailServer { get; set; }
public string XmppServer { get; set; }
[JsonIgnore]
private IConfiguration Configuration { get; }
[JsonIgnore]
private FilesLinkUtility FilesLinkUtility { get; }
[JsonIgnore]
private DocumentServiceConnector DocumentServiceConnector { get; }
public BuildVersion(IConfiguration configuration, FilesLinkUtility filesLinkUtility, DocumentServiceConnector documentServiceConnector)
{
Configuration = configuration;
FilesLinkUtility = filesLinkUtility;
DocumentServiceConnector = documentServiceConnector;
}
public async Task<BuildVersion> GetCurrentBuildVersionAsync()
{
CommunityServer = GetCommunityVersion();
DocumentServer = await GetDocumentVersionAsync();
MailServer = GetMailServerVersion();
XmppServer = GetXmppServerVersion();
{
CommunityServer = GetCommunityVersion();
DocumentServer = await GetDocumentVersionAsync();
MailServer = GetMailServerVersion();
XmppServer = GetXmppServerVersion();
return this;
}
@ -71,7 +71,7 @@ namespace ASC.Api.Settings
}
private Task<string> GetDocumentVersionAsync()
{
{
if (string.IsNullOrEmpty(FilesLinkUtility.DocServiceApiUrl))
return null;
@ -79,12 +79,12 @@ namespace ASC.Api.Settings
}
private static string GetMailServerVersion()
{
//TODO
return "";
/*
{
//TODO
return "";
/*
try
{
{
var engineFactory = new EngineFactory(
CoreContext.TenantManager.GetCurrentTenant().TenantId,
@ -99,23 +99,23 @@ namespace ASC.Api.Settings
}
return null;*/
}
private static string GetXmppServerVersion()
{
//try
//{
// if (ConfigurationManagerExtension.AppSettings["web.talk"] != "true")
// return null;
// return new JabberServiceClient().GetVersion();
//}
//catch (Exception e)
//{
// LogManager.GetLogger("ASC").Warn(e.Message, e);
//}
return null;
}
private static string GetXmppServerVersion()
{
//try
//{
// if (ConfigurationManagerExtension.AppSettings["web.talk"] != "true")
// return null;
// return new JabberServiceClient().GetVersion();
//}
//catch (Exception e)
//{
// LogManager.GetLogger("ASC").Warn(e.Message, e);
//}
return null;
}
}
}