// (c) Copyright Ascensio System SIA 2010-2022 // // This program is a free software product. // You can redistribute it and/or modify it under the terms // of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software // Foundation. In accordance with Section 7(a) of the GNU AGPL 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 details, see // the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html // // You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021. // // The interactive user interfaces in modified source and object code versions of the Program must // display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3. // // Pursuant to Section 7(b) of the License you must retain the original Product logo when // distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under // trademark law for use of our trademarks. // // All the Product's GUI elements, including illustrations and icon sets, as well as technical writing // content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 // International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode using Module = ASC.Api.Core.Module; namespace ASC.Files.Api; public class SettingsController : ApiControllerBase { private readonly FileStorageService _fileStorageServiceString; private readonly FilesSettingsHelper _filesSettingsHelper; private readonly ProductEntryPoint _productEntryPoint; public SettingsController( FileStorageService fileStorageServiceString, FilesSettingsHelper filesSettingsHelper, ProductEntryPoint productEntryPoint, FolderDtoHelper folderDtoHelper, FileDtoHelper fileDtoHelper) : base(folderDtoHelper, fileDtoHelper) { _fileStorageServiceString = fileStorageServiceString; _filesSettingsHelper = filesSettingsHelper; _productEntryPoint = productEntryPoint; } /// /// /// /// /// [HttpPut("thirdparty")] public bool ChangeAccessToThirdparty(SettingsRequestDto inDto) { return _fileStorageServiceString.ChangeAccessToThirdparty(inDto.Set); } /// /// /// /// /// [HttpPut("changedeleteconfrim")] public bool ChangeDeleteConfrim(SettingsRequestDto inDto) { return _fileStorageServiceString.ChangeDeleteConfrim(inDto.Set); } /// /// /// /// /// Settings /// [HttpPut("settings/downloadtargz")] public ICompress ChangeDownloadZipFromBody([FromBody] DisplayRequestDto inDto) { return _fileStorageServiceString.ChangeDownloadTarGz(inDto.Set); } [HttpPut("settings/downloadtargz")] public ICompress ChangeDownloadZipFromForm([FromForm] DisplayRequestDto inDto) { return _fileStorageServiceString.ChangeDownloadTarGz(inDto.Set); } /// /// Display favorite folder /// /// /// Settings /// [HttpPut("settings/favorites")] public bool DisplayFavorite(DisplayRequestDto inDto) { return _fileStorageServiceString.DisplayFavorite(inDto.Set); } /// /// Display recent folder /// /// /// Settings /// [HttpPut("displayRecent")] public bool DisplayRecent(DisplayRequestDto inDto) { return _fileStorageServiceString.DisplayRecent(inDto.Set); } /// /// Display template folder /// /// /// Settings /// [HttpPut("settings/templates")] public bool DisplayTemplates(DisplayRequestDto inDto) { return _fileStorageServiceString.DisplayTemplates(inDto.Set); } [HttpPut("settings/external")] public bool ExternalShare(DisplayRequestDto inDto) { return _fileStorageServiceString.ChangeExternalShareSettings(inDto.Set); } [HttpPut("settings/externalsocialmedia")] public bool ExternalShareSocialMedia(DisplayRequestDto inDto) { return _fileStorageServiceString.ChangeExternalShareSocialMediaSettings(inDto.Set); } /// /// /// /// /// [HttpPut("forcesave")] public bool Forcesave(SettingsRequestDto inDto) { return _fileStorageServiceString.Forcesave(inDto.Set); } /// /// /// /// [HttpGet("settings")] public FilesSettingsHelper GetFilesSettings() { return _filesSettingsHelper; } [HttpGet("info")] public Module GetModule() { _productEntryPoint.Init(); return new Module(_productEntryPoint); } /// /// /// /// /// false /// [HttpPut("hideconfirmconvert")] public bool HideConfirmConvert(HideConfirmConvertRequestDto inDto) { return _fileStorageServiceString.HideConfirmConvert(inDto.Save); } [HttpGet("@privacy/available")] public bool IsAvailablePrivacyRoomSettings() { return PrivacyRoomSettings.IsAvailable(); } /// /// /// /// /// [HttpPut("storeforcesave")] public bool StoreForcesave(SettingsRequestDto inDto) { return _fileStorageServiceString.StoreForcesave(inDto.Set); } /// /// /// /// /// [HttpPut("storeoriginal")] public bool StoreOriginal(SettingsRequestDto inDto) { return _fileStorageServiceString.StoreOriginal(inDto.Set); } /// /// /// /// /// [HttpPut("updateifexist")] public bool UpdateIfExist(SettingsRequestDto inDto) { return _fileStorageServiceString.UpdateIfExist(inDto.Set); } [HttpPut("settings/autocleanup")] public AutoCleanUpData ChangeAutomaticallyCleanUp(bool set, DateToAutoCleanUp gap) { return _fileStorageServiceString.ChangeAutomaticallyCleanUp(set, gap); } [HttpPut("settings/dafaultaccessrights")] public List ChangeDafaultAccessRights(List value) { return _fileStorageServiceString.ChangeDafaultAccessRights(value); } }