2019-06-07 08:59:07 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* (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.Core.WhiteLabel
|
|
|
|
{
|
2020-10-28 13:21:24 +00:00
|
|
|
public class AdditionalWhiteLabelSettingsWrapper
|
|
|
|
{
|
|
|
|
public AdditionalWhiteLabelSettings Settings { get; set; }
|
|
|
|
}
|
|
|
|
|
2019-06-07 08:59:07 +00:00
|
|
|
[Serializable]
|
2019-11-08 15:11:30 +00:00
|
|
|
public class AdditionalWhiteLabelSettings : ISettings
|
2019-06-07 08:59:07 +00:00
|
|
|
{
|
|
|
|
public bool StartDocsEnabled { get; set; }
|
|
|
|
|
|
|
|
public bool HelpCenterEnabled { get; set; }
|
|
|
|
|
|
|
|
public bool FeedbackAndSupportEnabled { get; set; }
|
|
|
|
|
|
|
|
public string FeedbackAndSupportUrl { get; set; }
|
|
|
|
|
|
|
|
public bool UserForumEnabled { get; set; }
|
|
|
|
|
|
|
|
public string UserForumUrl { get; set; }
|
|
|
|
|
|
|
|
public bool VideoGuidesEnabled { get; set; }
|
|
|
|
|
|
|
|
public string VideoGuidesUrl { get; set; }
|
|
|
|
|
|
|
|
public string SalesEmail { get; set; }
|
|
|
|
|
|
|
|
public string BuyUrl { get; set; }
|
|
|
|
|
|
|
|
public bool LicenseAgreementsEnabled { get; set; }
|
|
|
|
|
|
|
|
public string LicenseAgreementsUrl { get; set; }
|
|
|
|
|
2019-11-08 12:21:51 +00:00
|
|
|
public bool IsDefault(IConfiguration configuration)
|
2019-06-07 08:59:07 +00:00
|
|
|
{
|
2022-03-17 15:01:39 +00:00
|
|
|
if (!(GetDefault(configuration) is AdditionalWhiteLabelSettings defaultSettings))
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-11-08 12:21:51 +00:00
|
|
|
return StartDocsEnabled == defaultSettings.StartDocsEnabled &&
|
|
|
|
HelpCenterEnabled == defaultSettings.HelpCenterEnabled &&
|
|
|
|
FeedbackAndSupportEnabled == defaultSettings.FeedbackAndSupportEnabled &&
|
|
|
|
FeedbackAndSupportUrl == defaultSettings.FeedbackAndSupportUrl &&
|
|
|
|
UserForumEnabled == defaultSettings.UserForumEnabled &&
|
|
|
|
UserForumUrl == defaultSettings.UserForumUrl &&
|
|
|
|
VideoGuidesEnabled == defaultSettings.VideoGuidesEnabled &&
|
|
|
|
VideoGuidesUrl == defaultSettings.VideoGuidesUrl &&
|
|
|
|
SalesEmail == defaultSettings.SalesEmail &&
|
|
|
|
BuyUrl == defaultSettings.BuyUrl &&
|
|
|
|
LicenseAgreementsEnabled == defaultSettings.LicenseAgreementsEnabled &&
|
|
|
|
LicenseAgreementsUrl == defaultSettings.LicenseAgreementsUrl;
|
2019-06-07 08:59:07 +00:00
|
|
|
}
|
|
|
|
|
2019-11-08 12:21:51 +00:00
|
|
|
public Guid ID
|
2019-06-07 08:59:07 +00:00
|
|
|
{
|
|
|
|
get { return new Guid("{0108422F-C05D-488E-B271-30C4032494DA}"); }
|
|
|
|
}
|
|
|
|
|
2020-02-17 08:58:14 +00:00
|
|
|
public ISettings GetDefault()
|
|
|
|
{
|
|
|
|
return new AdditionalWhiteLabelSettings
|
|
|
|
{
|
|
|
|
StartDocsEnabled = true,
|
|
|
|
LicenseAgreementsEnabled = true,
|
|
|
|
LicenseAgreementsUrl = DefaultLicenseAgreements
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2019-11-08 12:21:51 +00:00
|
|
|
public ISettings GetDefault(IConfiguration configuration)
|
2020-02-17 08:58:14 +00:00
|
|
|
{
|
2019-11-08 12:21:51 +00:00
|
|
|
var additionalWhiteLabelSettingsHelper = new AdditionalWhiteLabelSettingsHelper(configuration);
|
2020-02-17 08:58:14 +00:00
|
|
|
return new AdditionalWhiteLabelSettings
|
|
|
|
{
|
|
|
|
StartDocsEnabled = true,
|
|
|
|
HelpCenterEnabled = additionalWhiteLabelSettingsHelper.DefaultHelpCenterUrl != null,
|
|
|
|
FeedbackAndSupportEnabled = additionalWhiteLabelSettingsHelper.DefaultFeedbackAndSupportUrl != null,
|
|
|
|
FeedbackAndSupportUrl = additionalWhiteLabelSettingsHelper.DefaultFeedbackAndSupportUrl,
|
|
|
|
UserForumEnabled = additionalWhiteLabelSettingsHelper.DefaultUserForumUrl != null,
|
|
|
|
UserForumUrl = additionalWhiteLabelSettingsHelper.DefaultUserForumUrl,
|
|
|
|
VideoGuidesEnabled = additionalWhiteLabelSettingsHelper.DefaultVideoGuidesUrl != null,
|
|
|
|
VideoGuidesUrl = additionalWhiteLabelSettingsHelper.DefaultVideoGuidesUrl,
|
|
|
|
SalesEmail = additionalWhiteLabelSettingsHelper.DefaultMailSalesEmail,
|
|
|
|
BuyUrl = additionalWhiteLabelSettingsHelper.DefaultBuyUrl,
|
|
|
|
LicenseAgreementsEnabled = true,
|
|
|
|
LicenseAgreementsUrl = DefaultLicenseAgreements
|
2019-08-15 12:04:42 +00:00
|
|
|
};
|
2019-06-07 08:59:07 +00:00
|
|
|
}
|
|
|
|
|
2019-11-08 12:21:51 +00:00
|
|
|
public static string DefaultLicenseAgreements
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
2020-12-28 13:22:08 +00:00
|
|
|
return "https://help.onlyoffice.com/Products/Files/doceditor.aspx?fileid=6795868&doc=RG5GaVN6azdUQW5kLzZQNzBXbHZ4Rm9QWVZuNjZKUmgya0prWnpCd2dGcz0_IjY3OTU4Njgi0";
|
2019-11-08 12:21:51 +00:00
|
|
|
}
|
|
|
|
}
|
2019-06-07 08:59:07 +00:00
|
|
|
|
2020-02-17 08:58:14 +00:00
|
|
|
public ISettings GetDefault(IServiceProvider serviceProvider)
|
|
|
|
{
|
|
|
|
return GetDefault(serviceProvider.GetService<IConfiguration>());
|
|
|
|
}
|
2020-10-19 15:53:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[Singletone]
|
2020-02-17 08:58:14 +00:00
|
|
|
public class AdditionalWhiteLabelSettingsHelper
|
|
|
|
{
|
2020-08-12 09:58:08 +00:00
|
|
|
private IConfiguration Configuration { get; }
|
2020-02-17 08:58:14 +00:00
|
|
|
|
|
|
|
public AdditionalWhiteLabelSettingsHelper(IConfiguration configuration)
|
|
|
|
{
|
|
|
|
Configuration = configuration;
|
|
|
|
}
|
|
|
|
|
2019-09-23 12:20:08 +00:00
|
|
|
public string DefaultHelpCenterUrl
|
2019-06-07 08:59:07 +00:00
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
2020-09-07 13:53:39 +00:00
|
|
|
var url = Configuration["web:help-center"];
|
2019-06-07 08:59:07 +00:00
|
|
|
return string.IsNullOrEmpty(url) ? null : url;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-23 12:20:08 +00:00
|
|
|
public string DefaultFeedbackAndSupportUrl
|
2019-06-07 08:59:07 +00:00
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
2020-09-07 13:53:39 +00:00
|
|
|
var url = Configuration["web:support-feedback"];
|
2019-06-07 08:59:07 +00:00
|
|
|
return string.IsNullOrEmpty(url) ? null : url;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-23 12:20:08 +00:00
|
|
|
public string DefaultUserForumUrl
|
2019-06-07 08:59:07 +00:00
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
2020-09-07 13:53:39 +00:00
|
|
|
var url = Configuration["web:user-forum"];
|
2019-06-07 08:59:07 +00:00
|
|
|
return string.IsNullOrEmpty(url) ? null : url;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-23 12:20:08 +00:00
|
|
|
public string DefaultVideoGuidesUrl
|
2019-06-07 08:59:07 +00:00
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
var url = DefaultHelpCenterUrl;
|
|
|
|
return string.IsNullOrEmpty(url) ? null : url + "/video.aspx";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-23 12:20:08 +00:00
|
|
|
public string DefaultMailSalesEmail
|
2019-06-07 08:59:07 +00:00
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
2020-09-07 13:53:39 +00:00
|
|
|
var email = Configuration["web:payment:email"];
|
2019-06-07 08:59:07 +00:00
|
|
|
return !string.IsNullOrEmpty(email) ? email : "sales@onlyoffice.com";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-23 12:20:08 +00:00
|
|
|
public string DefaultBuyUrl
|
2019-06-07 08:59:07 +00:00
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
2020-09-07 13:53:39 +00:00
|
|
|
var site = Configuration["web:teamlab-site"];
|
2019-06-07 08:59:07 +00:00
|
|
|
return !string.IsNullOrEmpty(site) ? site + "/post.ashx?type=buyenterprise" : "";
|
|
|
|
}
|
2020-02-17 08:58:14 +00:00
|
|
|
}
|
|
|
|
}
|
2019-06-07 08:59:07 +00:00
|
|
|
}
|