diff --git a/web/ASC.Web.Api/Models/AuthModel.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/AuthDto.cs similarity index 96% rename from web/ASC.Web.Api/Models/AuthModel.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/AuthDto.cs index f112eeb4c3..5232deae1a 100644 --- a/web/ASC.Web.Api/Models/AuthModel.cs +++ b/web/ASC.Web.Api/ApiModels/RequestsDto/AuthDto.cs @@ -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; } + } +} diff --git a/web/ASC.Web.Api/Models/AuthServiceModel.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/AuthServiceDto.cs similarity index 96% rename from web/ASC.Web.Api/Models/AuthServiceModel.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/AuthServiceDto.cs index 7b3216ba07..da24d38166 100644 --- a/web/ASC.Web.Api/Models/AuthServiceModel.cs +++ b/web/ASC.Web.Api/ApiModels/RequestsDto/AuthServiceDto.cs @@ -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 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 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; + } + } + } +} diff --git a/web/ASC.Web.Api/Models/EncryptionSettingsModel.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/EncryptionSettingsDto.cs similarity index 100% rename from web/ASC.Web.Api/Models/EncryptionSettingsModel.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/EncryptionSettingsDto.cs diff --git a/web/ASC.Web.Api/Models/GreetingSettingsModel.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/GreetingSettingsDto.cs similarity index 100% rename from web/ASC.Web.Api/Models/GreetingSettingsModel.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/GreetingSettingsDto.cs diff --git a/web/ASC.Web.Api/Models/IpRestrictionsModel.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/IpRestrictionsDto.cs similarity index 98% rename from web/ASC.Web.Api/Models/IpRestrictionsModel.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/IpRestrictionsDto.cs index 302dba350c..b3b38cf498 100644 --- a/web/ASC.Web.Api/Models/IpRestrictionsModel.cs +++ b/web/ASC.Web.Api/ApiModels/RequestsDto/IpRestrictionsDto.cs @@ -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 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 Ips { get; set; } + public bool Enable { get; set; } + } +} diff --git a/web/ASC.Web.Api/Models/MailDomainSettingsModel.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/MailDomainSettingsDto.cs similarity index 96% rename from web/ASC.Web.Api/Models/MailDomainSettingsModel.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/MailDomainSettingsDto.cs index d863947baa..3f00adff48 100644 --- a/web/ASC.Web.Api/Models/MailDomainSettingsModel.cs +++ b/web/ASC.Web.Api/ApiModels/RequestsDto/MailDomainSettingsDto.cs @@ -1,16 +1,16 @@ -namespace ASC.Web.Api.Models -{ - public class MailDomainSettingsModel - { - public TenantTrustedDomainsType Type { get; set; } - public List 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 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; } + } +} diff --git a/web/ASC.Web.Api/Models/MailWhiteLabelSettingsModel.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/MailWhiteLabelSettingsDto.cs similarity index 100% rename from web/ASC.Web.Api/Models/MailWhiteLabelSettingsModel.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/MailWhiteLabelSettingsDto.cs diff --git a/web/ASC.Web.Api/Models/MobileAppModel.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/MobileAppDto.cs similarity index 94% rename from web/ASC.Web.Api/Models/MobileAppModel.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/MobileAppDto.cs index b8f3b7cc5c..5660404083 100644 --- a/web/ASC.Web.Api/Models/MobileAppModel.cs +++ b/web/ASC.Web.Api/ApiModels/RequestsDto/MobileAppDto.cs @@ -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; } + } +} diff --git a/web/ASC.Web.Api/Models/SchemaModel.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/SchemaDto.cs similarity index 97% rename from web/ASC.Web.Api/Models/SchemaModel.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/SchemaDto.cs index 5ee560d2a1..31945d2eda 100644 --- a/web/ASC.Web.Api/Models/SchemaModel.cs +++ b/web/ASC.Web.Api/ApiModels/RequestsDto/SchemaDto.cs @@ -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; } + } +} diff --git a/web/ASC.Web.Api/Models/SecurityModel.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/SecurityDto.cs similarity index 95% rename from web/ASC.Web.Api/Models/SecurityModel.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/SecurityDto.cs index e4803a1af3..9f7f1e12fd 100644 --- a/web/ASC.Web.Api/Models/SecurityModel.cs +++ b/web/ASC.Web.Api/ApiModels/RequestsDto/SecurityDto.cs @@ -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; } + } +} diff --git a/web/ASC.Web.Api/Models/SettingsModel.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/SettingsDto.cs similarity index 95% rename from web/ASC.Web.Api/Models/SettingsModel.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/SettingsDto.cs index b081889da0..378d3f310b 100644 --- a/web/ASC.Web.Api/Models/SettingsModel.cs +++ b/web/ASC.Web.Api/ApiModels/RequestsDto/SettingsDto.cs @@ -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; } + } +} diff --git a/web/ASC.Web.Api/Models/ShortenLinkModel.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/ShortenLinkDto.cs similarity index 94% rename from web/ASC.Web.Api/Models/ShortenLinkModel.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/ShortenLinkDto.cs index 8f2d706ca5..706f839adf 100644 --- a/web/ASC.Web.Api/Models/ShortenLinkModel.cs +++ b/web/ASC.Web.Api/ApiModels/RequestsDto/ShortenLinkDto.cs @@ -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; } + } +} diff --git a/web/ASC.Web.Api/Models/Smtp/SmtpOperationStatus.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/SmtpOperationStatusDto.cs similarity index 100% rename from web/ASC.Web.Api/Models/Smtp/SmtpOperationStatus.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/SmtpOperationStatusDto.cs diff --git a/web/ASC.Web.Api/Models/StorageModel.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/StorageDto.cs similarity index 96% rename from web/ASC.Web.Api/Models/StorageModel.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/StorageDto.cs index 1cb03fa11c..164c22f795 100644 --- a/web/ASC.Web.Api/Models/StorageModel.cs +++ b/web/ASC.Web.Api/ApiModels/RequestsDto/StorageDto.cs @@ -1,8 +1,8 @@ -namespace ASC.Web.Api.Models -{ - public class StorageModel - { - public string Module { get; set; } - public IEnumerable> Props { get; set; } - } -} +namespace ASC.Web.Api.Models +{ + public class StorageModel + { + public string Module { get; set; } + public IEnumerable> Props { get; set; } + } +} diff --git a/web/ASC.Web.Api/Models/StorageEncryptionModel.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/StorageEncryptionDto.cs similarity index 100% rename from web/ASC.Web.Api/Models/StorageEncryptionModel.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/StorageEncryptionDto.cs diff --git a/web/ASC.Web.Api/Models/TfaModel.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/TfaDto.cs similarity index 94% rename from web/ASC.Web.Api/Models/TfaModel.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/TfaDto.cs index 2c9615851b..d047ea7a35 100644 --- a/web/ASC.Web.Api/Models/TfaModel.cs +++ b/web/ASC.Web.Api/ApiModels/RequestsDto/TfaDto.cs @@ -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; } + } +} diff --git a/web/ASC.Web.Api/Models/TfaSettings.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/TfaSettingsDto.cs similarity index 96% rename from web/ASC.Web.Api/Models/TfaSettings.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/TfaSettingsDto.cs index a5738aea0d..fdedbc67e2 100644 --- a/web/ASC.Web.Api/Models/TfaSettings.cs +++ b/web/ASC.Web.Api/ApiModels/RequestsDto/TfaSettingsDto.cs @@ -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; } + } +} diff --git a/web/ASC.Web.Api/Models/ThirdpartyModel.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/ThirdpartyDto.cs similarity index 95% rename from web/ASC.Web.Api/Models/ThirdpartyModel.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/ThirdpartyDto.cs index 9e58080171..758de52a37 100644 --- a/web/ASC.Web.Api/Models/ThirdpartyModel.cs +++ b/web/ASC.Web.Api/ApiModels/RequestsDto/ThirdpartyDto.cs @@ -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; } + } +} diff --git a/web/ASC.Web.Api/Models/TimezonesModel.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/TimezonesDto.cs similarity index 100% rename from web/ASC.Web.Api/Models/TimezonesModel.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/TimezonesDto.cs diff --git a/web/ASC.Web.Api/Models/UploadLicenseModel.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/UploadLicenseDto.cs similarity index 95% rename from web/ASC.Web.Api/Models/UploadLicenseModel.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/UploadLicenseDto.cs index 131eb5dacc..1e990c1d23 100644 --- a/web/ASC.Web.Api/Models/UploadLicenseModel.cs +++ b/web/ASC.Web.Api/ApiModels/RequestsDto/UploadLicenseDto.cs @@ -1,7 +1,7 @@ -namespace ASC.Web.Api.Models -{ - public class UploadLicenseModel - { - public IEnumerable Files { get; set; } - } -} +namespace ASC.Web.Api.Models +{ + public class UploadLicenseModel + { + public IEnumerable Files { get; set; } + } +} diff --git a/web/ASC.Web.Api/Models/WebItemSecurityModel.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/WebItemSecurityDto.cs similarity index 96% rename from web/ASC.Web.Api/Models/WebItemSecurityModel.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/WebItemSecurityDto.cs index 5f9302f8ce..44f78293d7 100644 --- a/web/ASC.Web.Api/Models/WebItemSecurityModel.cs +++ b/web/ASC.Web.Api/ApiModels/RequestsDto/WebItemSecurityDto.cs @@ -1,10 +1,10 @@ -namespace ASC.Web.Api.Models -{ - public class WebItemSecurityModel - { - public string Id { get; set; } - public bool Enabled { get; set; } - public IEnumerable Subjects { get; set; } - public IEnumerable> Items { get; set; } - } -} +namespace ASC.Web.Api.Models +{ + public class WebItemSecurityModel + { + public string Id { get; set; } + public bool Enabled { get; set; } + public IEnumerable Subjects { get; set; } + public IEnumerable> Items { get; set; } + } +} diff --git a/web/ASC.Web.Api/Models/WhiteLabelModel.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/WhiteLabelDto.cs similarity index 96% rename from web/ASC.Web.Api/Models/WhiteLabelModel.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/WhiteLabelDto.cs index 8cd0a41262..ae34a6f39f 100644 --- a/web/ASC.Web.Api/Models/WhiteLabelModel.cs +++ b/web/ASC.Web.Api/ApiModels/RequestsDto/WhiteLabelDto.cs @@ -1,14 +1,14 @@ -namespace ASC.Web.Api.Models -{ - public class WhiteLabelModel - { - public string LogoText { get; set; } - public IEnumerable> 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> Logo { get; set; } + } + + public class WhiteLabelQuery + { + public bool IsDefault { get; set; } + public bool IsRetina { get; set; } + } +} diff --git a/web/ASC.Web.Api/Models/WizardModel.cs b/web/ASC.Web.Api/ApiModels/RequestsDto/WizardDto.cs similarity index 97% rename from web/ASC.Web.Api/Models/WizardModel.cs rename to web/ASC.Web.Api/ApiModels/RequestsDto/WizardDto.cs index e8aa353685..04dc6a7850 100644 --- a/web/ASC.Web.Api/Models/WizardModel.cs +++ b/web/ASC.Web.Api/ApiModels/RequestsDto/WizardDto.cs @@ -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); + } + } +} diff --git a/web/ASC.Web.Api/Models/CapabilitiesData.cs b/web/ASC.Web.Api/ApiModels/ResponseDto/CapabilitiesResponseDto.cs similarity index 96% rename from web/ASC.Web.Api/Models/CapabilitiesData.cs rename to web/ASC.Web.Api/ApiModels/ResponseDto/CapabilitiesResponseDto.cs index 3093e46473..7b7a2c1de7 100644 --- a/web/ASC.Web.Api/Models/CapabilitiesData.cs +++ b/web/ASC.Web.Api/ApiModels/ResponseDto/CapabilitiesResponseDto.cs @@ -1,27 +1,27 @@ -namespace ASC.Web.Api.Models -{ - public class CapabilitiesData - { - public bool LdapEnabled { get; set; } - - public List Providers { get; set; } - - public string SsoLabel { get; set; } - - /// - /// if empty sso is disabled - /// - 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 Providers { get; set; } + + public string SsoLabel { get; set; } + + /// + /// if empty sso is disabled + /// + public string SsoUrl { get; set; } + + public static CapabilitiesData GetSample() + { + return new CapabilitiesData + { + LdapEnabled = false, + // Providers = AccountLinkControl.AuthProviders, + SsoLabel = string.Empty, + SsoUrl = string.Empty, + }; + } + } +} diff --git a/web/ASC.Web.Api/Models/EventWrapper.cs b/web/ASC.Web.Api/ApiModels/ResponseDto/EventResponseDto.cs similarity index 100% rename from web/ASC.Web.Api/Models/EventWrapper.cs rename to web/ASC.Web.Api/ApiModels/ResponseDto/EventResponseDto.cs diff --git a/web/ASC.Web.Api/Models/FirebaseWrapper.cs b/web/ASC.Web.Api/ApiModels/ResponseDto/FirebaseResponseDto.cs similarity index 100% rename from web/ASC.Web.Api/Models/FirebaseWrapper.cs rename to web/ASC.Web.Api/ApiModels/ResponseDto/FirebaseResponseDto.cs diff --git a/web/ASC.Web.Api/Models/QuotaWrapper.cs b/web/ASC.Web.Api/ApiModels/ResponseDto/QuotaResponseDto.cs similarity index 97% rename from web/ASC.Web.Api/Models/QuotaWrapper.cs rename to web/ASC.Web.Api/ApiModels/ResponseDto/QuotaResponseDto.cs index 035dc83f25..218301892a 100644 --- a/web/ASC.Web.Api/Models/QuotaWrapper.cs +++ b/web/ASC.Web.Api/ApiModels/ResponseDto/QuotaResponseDto.cs @@ -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 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 - { - 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 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 + { + 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; } + } + } } \ No newline at end of file diff --git a/web/ASC.Web.Api/Models/SecurityWrapper.cs b/web/ASC.Web.Api/ApiModels/ResponseDto/SecurityResponseDto.cs similarity index 97% rename from web/ASC.Web.Api/Models/SecurityWrapper.cs rename to web/ASC.Web.Api/ApiModels/ResponseDto/SecurityResponseDto.cs index 510ed28392..8f4b8c3abd 100644 --- a/web/ASC.Web.Api/Models/SecurityWrapper.cs +++ b/web/ASC.Web.Api/ApiModels/ResponseDto/SecurityResponseDto.cs @@ -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 Users { get; set; } - - public IEnumerable 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.GetSample() - }, - Users = new List - { - 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 Users { get; set; } + + public IEnumerable 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.GetSample() + }, + Users = new List + { + EmployeeWraper.GetSample() + } + }; + } + } } \ No newline at end of file diff --git a/web/ASC.Web.Api/Models/SettingsWrapper.cs b/web/ASC.Web.Api/ApiModels/ResponseDto/SettingsResponseDto.cs similarity index 97% rename from web/ASC.Web.Api/Models/SettingsWrapper.cs rename to web/ASC.Web.Api/ApiModels/ResponseDto/SettingsResponseDto.cs index 9502367669..3886a914c7 100644 --- a/web/ASC.Web.Api/Models/SettingsWrapper.cs +++ b/web/ASC.Web.Api/ApiModels/ResponseDto/SettingsResponseDto.cs @@ -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 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 { "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 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 { "mydomain.com" }, + UtcHoursOffset = -8.5, + UtcOffset = TimeSpan.FromHours(-8.5), + GreetingSettings = "Web Office Applications", + OwnerId = new Guid() + }; + } + } } \ No newline at end of file diff --git a/web/ASC.Web.Api/Models/Smtp/SmtpSettingsWrapper.cs b/web/ASC.Web.Api/ApiModels/ResponseDto/SmtpSettingsResponseDto.cs similarity index 99% rename from web/ASC.Web.Api/Models/Smtp/SmtpSettingsWrapper.cs rename to web/ASC.Web.Api/ApiModels/ResponseDto/SmtpSettingsResponseDto.cs index b080f3122d..ecd2d40dfe 100644 --- a/web/ASC.Web.Api/Models/Smtp/SmtpSettingsWrapper.cs +++ b/web/ASC.Web.Api/ApiModels/ResponseDto/SmtpSettingsResponseDto.cs @@ -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" }; } } diff --git a/web/ASC.Web.Api/Models/StatisticsWrapper.cs b/web/ASC.Web.Api/ApiModels/ResponseDto/StatisticsResponseDto.cs similarity index 99% rename from web/ASC.Web.Api/Models/StatisticsWrapper.cs rename to web/ASC.Web.Api/ApiModels/ResponseDto/StatisticsResponseDto.cs index 3d6b629673..55b3179cfd 100644 --- a/web/ASC.Web.Api/Models/StatisticsWrapper.cs +++ b/web/ASC.Web.Api/ApiModels/ResponseDto/StatisticsResponseDto.cs @@ -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 }; } } diff --git a/web/ASC.Web.Api/Models/StorageWrapper.cs b/web/ASC.Web.Api/ApiModels/ResponseDto/StorageResponseDto.cs similarity index 99% rename from web/ASC.Web.Api/Models/StorageWrapper.cs rename to web/ASC.Web.Api/ApiModels/ResponseDto/StorageResponseDto.cs index a998cb5338..5d78ca986d 100644 --- a/web/ASC.Web.Api/Models/StorageWrapper.cs +++ b/web/ASC.Web.Api/ApiModels/ResponseDto/StorageResponseDto.cs @@ -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(); } diff --git a/web/ASC.Web.Api/Models/TenantVersionWrapper.cs b/web/ASC.Web.Api/ApiModels/ResponseDto/TenantVersionResponseDto.cs similarity index 97% rename from web/ASC.Web.Api/Models/TenantVersionWrapper.cs rename to web/ASC.Web.Api/ApiModels/ResponseDto/TenantVersionResponseDto.cs index b261cd17fc..a1603db8be 100644 --- a/web/ASC.Web.Api/Models/TenantVersionWrapper.cs +++ b/web/ASC.Web.Api/ApiModels/ResponseDto/TenantVersionResponseDto.cs @@ -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 Versions { get; set; } - - public TenantVersionWrapper(int version, IEnumerable 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 Versions { get; set; } + + public TenantVersionWrapper(int version, IEnumerable tenantVersions) + { + Current = version; + Versions = tenantVersions; + } + } } \ No newline at end of file diff --git a/web/ASC.Web.Api/Models/BuildVersion.cs b/web/ASC.Web.Api/Core/BuildVersion.cs similarity index 98% rename from web/ASC.Web.Api/Models/BuildVersion.cs rename to web/ASC.Web.Api/Core/BuildVersion.cs index 07165115b1..4ce3279796 100644 --- a/web/ASC.Web.Api/Models/BuildVersion.cs +++ b/web/ASC.Web.Api/Core/BuildVersion.cs @@ -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 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 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; } } } diff --git a/web/ASC.Web.Api/Models/Smtp/SmtpOperation.cs b/web/ASC.Web.Api/Core/SmtpOperation.cs similarity index 100% rename from web/ASC.Web.Api/Models/Smtp/SmtpOperation.cs rename to web/ASC.Web.Api/Core/SmtpOperation.cs