moved from hotfix/10.5.2

This commit is contained in:
pavelbannov 2020-01-22 16:59:49 +03:00
parent 4ea450720b
commit f5b3f2838b
14 changed files with 513 additions and 46 deletions

View File

@ -28,6 +28,7 @@ using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using ASC.Web.Core.Users;
using ASC.Web.Studio.Utility;
@ -94,14 +95,14 @@ namespace ASC.Core.Users
return UserPhotoManager.GetSmallPhotoURL(userInfo.ID);
}
public static string RenderProfileLinkBase(this UserInfo userInfo, UserManager userManager, CommonLinkUtility commonLinkUtility, DisplayUserSettingsHelper displayUserSettingsHelper)
public static string RenderProfileLinkBase(this UserInfo userInfo, CommonLinkUtility commonLinkUtility, DisplayUserSettingsHelper displayUserSettingsHelper)
{
var sb = new StringBuilder();
//check for removed users
if (userInfo == null || !userManager.UserExists(userInfo))
if (userInfo.ID == Constants.LostUser.ID)
{
sb.Append("<span class='userLink text-medium-describe' style='white-space:nowrap;'>profile removed</span>");
sb.AppendFormat("<span class='userLink text-medium-describe' style='white-space:nowrap;'>{0}</span>", userInfo.DisplayUserName(displayUserSettingsHelper));
}
else
{

View File

@ -45,6 +45,7 @@ namespace ASC.Web.Core.Files
Configuration = configuration;
FilesLinkUtility = filesLinkUtility;
FilesDbContext = dbContextManager;
CanForcesave = GetCanForcesave();
}
#region method
@ -363,6 +364,14 @@ namespace ASC.Web.Core.Files
return result;
}
public readonly bool CanForcesave;
private bool GetCanForcesave()
{
bool canForcesave;
return !bool.TryParse(Configuration["files:docservice:forcesave"] ?? "", out canForcesave) || canForcesave;
}
#endregion
}
}

View File

@ -28,9 +28,11 @@ using System;
using System.Text.RegularExpressions;
using System.Threading;
using System.Web;
using ASC.Core;
using ASC.Security.Cryptography;
using ASC.Web.Studio.Utility;
using Microsoft.Extensions.Configuration;
namespace ASC.Web.Core.Files
@ -350,15 +352,16 @@ namespace ASC.Web.Core.Files
return FileRedirectPreviewUrlString + "&" + (isFile ? FileId : FolderId) + "=" + HttpUtility.UrlEncode(enrtyId.ToString());
}
public string GetInitiateUploadSessionUrl(int tenantId, object folderId, object fileId, string fileName, long contentLength, SecurityContext securityContext)
public string GetInitiateUploadSessionUrl(int tenantId, object folderId, object fileId, string fileName, long contentLength, bool encrypted, SecurityContext securityContext)
{
var queryString = string.Format("?initiate=true&{0}={1}&fileSize={2}&tid={3}&userid={4}&culture={5}",
var queryString = string.Format("?initiate=true&{0}={1}&fileSize={2}&tid={3}&userid={4}&culture={5}&encrypted={6}",
FileTitle,
HttpUtility.UrlEncode(fileName),
contentLength,
tenantId,
HttpUtility.UrlEncode(InstanceCrypto.Encrypt(securityContext.CurrentAccount.ID.ToString())),
Thread.CurrentThread.CurrentUICulture.Name);
Thread.CurrentThread.CurrentUICulture.Name,
encrypted.ToString().ToLower());
if (fileId != null)
queryString = queryString + "&" + FileId + "=" + HttpUtility.UrlEncode(fileId.ToString());

View File

@ -61,7 +61,7 @@ namespace ASC.Web.Core.Mail
public class MailServiceHelper
{
public const string ConnectionStringFormat = "Server={0};Database={1};User ID={2};Password={3};Pooling=True;Character Set=utf8";
public readonly string ConnectionStringFormat;
public const string MailServiceDbId = "mailservice";
public readonly string DefaultDatabase;
public const string DefaultUser = "mail_admin";
@ -90,6 +90,7 @@ namespace ASC.Web.Core.Mail
DbContextManager<MailDbContext> dbContext,
EFLoggerFactory loggerFactory)
{
ConnectionStringFormat = GetConnectionStringFormat(configuration);
UserManager = userManager;
AuthContext = authContext;
Configuration = configuration;
@ -100,6 +101,14 @@ namespace ASC.Web.Core.Mail
Cache = mailServiceHelperStorage.Cache;
DefaultDatabase = GetDefaultDatabase();
}
private string GetConnectionStringFormat(IConfiguration configuration)
{
var value = configuration["mailservice:connection-string-format"];
return string.IsNullOrEmpty(value) ? "Server={0};Database={1};User ID={2};Password={3};Pooling=true;Character Set=utf8;AutoEnlist=false;SSL Mode=none;AllowPublicKeyRetrieval=true" : value;
}
private string GetDefaultDatabase()
{
@ -150,7 +159,7 @@ namespace ASC.Web.Core.Mail
}
public string[] GetDataFromExternalDatabase(string dbid, string connectionString, string ip)
public string GetTokenFromExternalDatabase(string connectionString)
{
DemandPermission();
@ -166,22 +175,30 @@ namespace ASC.Web.Core.Mail
.Where(r => r.Id == 1)
.Select(r => r.AccessToken)
.FirstOrDefault();
return token;
}
string hostname;
public string GetHostnameFromExternalDatabase(string connectionString, string ip)
{
DemandPermission();
if (IPAddress.TryParse(ip, out var ipAddress))
{
hostname = mailDbContext.GreyListingWhiteList
.Where(r => r.Source == "SenderIP:" + ip)
.Select(r => r.Comment)
.FirstOrDefault();
}
else
{
hostname = ip;
}
var dbContextOptionsBuilder = new DbContextOptionsBuilder<MailDbContext>();
var options = dbContextOptionsBuilder
.UseMySql(connectionString)
.UseLoggerFactory(LoggerFactory)
.Options;
return new[] { token, hostname };
using var mailDbContext = new MailDbContext(options);
if (!IPAddress.TryParse(ip, out var ipAddress))
return ip;
var hostname = mailDbContext.GreyListingWhiteList
.Where(r => r.Source == "SenderIP:" + ip)
.Select(r => r.Comment)
.FirstOrDefault();
return hostname;
}

View File

@ -1,5 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
@ -70,6 +129,9 @@
<data name="AdministratorNotifySenderTypeName" xml:space="preserve">
<value>Administratorbenachrichtigungen</value>
</data>
<data name="ChangePortalOwnerMsg" xml:space="preserve">
<value>Der Link zum Bestätigen der Operation wurde an :email verschickt (die E-Mail-Adresse des Portalbesitzers).</value>
</data>
<data name="CouldNotRecoverPasswordForLdapUser" xml:space="preserve">
<value>Kennwortwiederherstellung für LDAP Benutzer ist verboten</value>
</data>
@ -211,6 +273,9 @@
<data name="SsoSettingsInvalidMapping" xml:space="preserve">
<value>Ungültige Feldzuordnung</value>
</data>
<data name="SuccessfullySaveGreetingSettingsMessage" xml:space="preserve">
<value>Die Begrüßungseinstellungen wurden erfolgreich gespeichert</value>
</data>
<data name="SuccessfullySaveSettingsMessage" xml:space="preserve">
<value>Die Einstellungen wurden erfolgreich aktualisiert</value>
</data>

View File

@ -1,5 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
@ -70,6 +129,9 @@
<data name="AdministratorNotifySenderTypeName" xml:space="preserve">
<value>Nofificaciones de administradores</value>
</data>
<data name="ChangePortalOwnerMsg" xml:space="preserve">
<value>Un enlace para confirmar la operación ha sido enviada al :correo electrónico (la dirección del correo electrónico del propietario del portal).</value>
</data>
<data name="CouldNotRecoverPasswordForLdapUser" xml:space="preserve">
<value>Operación de recuperación de contraseña está prohibida para un usuario LDAP</value>
</data>
@ -211,6 +273,9 @@
<data name="SsoSettingsInvalidMapping" xml:space="preserve">
<value>Cartografía de campos no válida</value>
</data>
<data name="SuccessfullySaveGreetingSettingsMessage" xml:space="preserve">
<value>Los ajustes de bienvenida han sido guardados con éxito</value>
</data>
<data name="SuccessfullySaveSettingsMessage" xml:space="preserve">
<value>Ajustes se han actualizado con éxito</value>
</data>

View File

@ -1,5 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
@ -70,6 +129,9 @@
<data name="AdministratorNotifySenderTypeName" xml:space="preserve">
<value>Notifications d'administrateurs</value>
</data>
<data name="ChangePortalOwnerMsg" xml:space="preserve">
<value>Un lien pour confirmer l'opération a été envoyé à :e-mail (l'adresse e-mail du propriétaire du portail).</value>
</data>
<data name="CouldNotRecoverPasswordForLdapUser" xml:space="preserve">
<value>La fonction de récupération du mot de passe est interdite à l'utilisateur LDAP</value>
</data>
@ -213,6 +275,9 @@
<data name="SsoSettingsInvalidMapping" xml:space="preserve">
<value>Mappage des champs non valides</value>
</data>
<data name="SuccessfullySaveGreetingSettingsMessage" xml:space="preserve">
<value>Les paramètres de la page d'accueil ont été enregistrés avec succès</value>
</data>
<data name="SuccessfullySaveSettingsMessage" xml:space="preserve">
<value>Les paramètres ont été actualisés avec succès</value>
</data>

View File

@ -1,5 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
@ -70,6 +129,9 @@
<data name="AdministratorNotifySenderTypeName" xml:space="preserve">
<value>Notifiche di amministratore</value>
</data>
<data name="ChangePortalOwnerMsg" xml:space="preserve">
<value>Un collegamento per confermare l'operazione è stato inviato all'indirizzo :email (l'indirizzo email del proprietario del portale).</value>
</data>
<data name="CouldNotRecoverPasswordForLdapUser" xml:space="preserve">
<value>Il recupero della password è vietato per un utente LDAP</value>
</data>
@ -211,6 +273,9 @@
<data name="SsoSettingsInvalidMapping" xml:space="preserve">
<value>Mappatura campi non valida</value>
</data>
<data name="SuccessfullySaveGreetingSettingsMessage" xml:space="preserve">
<value>Le impostazioni della pagina di saluto sono state salvate con successo</value>
</data>
<data name="SuccessfullySaveSettingsMessage" xml:space="preserve">
<value>Le impostazioni sono state aggiornate con successo</value>
</data>

View File

@ -1,5 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
@ -70,6 +129,9 @@
<data name="AdministratorNotifySenderTypeName" xml:space="preserve">
<value>Administrator Notifications</value>
</data>
<data name="ChangePortalOwnerMsg" xml:space="preserve">
<value>A link to confirm the operation has been sent to :email (the email address of the portal owner).</value>
</data>
<data name="CouldNotRecoverPasswordForLdapUser" xml:space="preserve">
<value>Password recovery operation is prohibited for an LDAP user</value>
</data>
@ -211,6 +273,9 @@
<data name="SsoSettingsInvalidMapping" xml:space="preserve">
<value>Invalid fields mapping</value>
</data>
<data name="SuccessfullySaveGreetingSettingsMessage" xml:space="preserve">
<value>Welcome Page settings have been successfully saved</value>
</data>
<data name="SuccessfullySaveSettingsMessage" xml:space="preserve">
<value>Settings have been successfully updated</value>
</data>

View File

@ -1,5 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
@ -70,6 +129,9 @@
<data name="AdministratorNotifySenderTypeName" xml:space="preserve">
<value>Извещения администраторов</value>
</data>
<data name="ChangePortalOwnerMsg" xml:space="preserve">
<value>Ссылка для подтверждения операции была отправлена на :email (адрес электронной почты владельца портала).</value>
</data>
<data name="CouldNotRecoverPasswordForLdapUser" xml:space="preserve">
<value>Операция восстановления пароля запрещена для пользователя LDAP</value>
</data>
@ -211,6 +273,9 @@
<data name="SsoSettingsInvalidMapping" xml:space="preserve">
<value>Недопустимое сопоставление полей</value>
</data>
<data name="SuccessfullySaveGreetingSettingsMessage" xml:space="preserve">
<value>Настройки страницы приветствия успешно сохранены</value>
</data>
<data name="SuccessfullySaveSettingsMessage" xml:space="preserve">
<value>Настройки успешно обновлены</value>
</data>

View File

@ -29,6 +29,7 @@ using System.Globalization;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
using ASC.Common.Logging;
using ASC.Core;
using ASC.Core.Common;
@ -37,6 +38,7 @@ using ASC.Core.Users;
using ASC.Security.Cryptography;
using ASC.Web.Core;
using ASC.Web.Core.WhiteLabel;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
@ -224,6 +226,33 @@ namespace ASC.Web.Studio.Utility
return productID;
}
public Guid GetAddonID()
{
var addonID = Guid.Empty;
if (HttpContext != null)
{
var addonName = GetAddonNameFromUrl(HttpContext.Request.Url().AbsoluteUri);
switch (addonName)
{
case "mail":
addonID = WebItemManager.MailProductID;
break;
case "talk":
addonID = WebItemManager.TalkProductID;
break;
case "calendar":
addonID = WebItemManager.CalendarProductID;
break;
default:
break;
}
}
return addonID;
}
public void GetLocationByRequest(out IProduct currentProduct, out IModule currentModule)
{
var currentURL = string.Empty;
@ -365,20 +394,7 @@ namespace ASC.Web.Studio.Utility
name = GetProductNameFromUrl(url);
if (string.IsNullOrEmpty(name))
{
try
{
var pos = url.IndexOf("/addons/", StringComparison.InvariantCultureIgnoreCase);
if (0 <= pos)
{
url = url.Substring(pos + 8).ToLower();
pos = url.IndexOf('/');
return 0 < pos ? url.Substring(0, pos) : url;
}
}
catch
{
}
return null;
return GetAddonNameFromUrl(name);
}
}
@ -404,6 +420,24 @@ namespace ASC.Web.Studio.Utility
return null;
}
private static string GetAddonNameFromUrl(string url)
{
try
{
var pos = url.IndexOf("/addons/", StringComparison.InvariantCultureIgnoreCase);
if (0 <= pos)
{
url = url.Substring(pos + 8).ToLower();
pos = url.IndexOf('/');
return 0 < pos ? url.Substring(0, pos) : url;
}
}
catch
{
}
return null;
}
private static string GetModuleNameFromUrl(string url)
{
try

View File

@ -25,7 +25,9 @@
using System;
using ASC.Data.Storage;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
@ -68,7 +70,7 @@ namespace ASC.Web.Core.Utility.Skins
if (HttpContextAccessor?.HttpContext == null) return string.Empty;
var currentThemePath = GetPartImageFolderRel(moduleID);
return WebPath.GetPath(currentThemePath.ToLower());
return WebPath.GetPath(currentThemePath);
}
private string GetImageAbsoluteWebPath(string fileName, Guid partID)
@ -78,7 +80,7 @@ namespace ASC.Web.Core.Utility.Skins
return string.Empty;
}
var filepath = GetPartImageFolderRel(partID) + "/" + fileName;
return WebPath.GetPath(filepath.ToLower());
return WebPath.GetPath(filepath);
}
private string GetPartImageFolderRel(Guid partID)
@ -95,7 +97,7 @@ namespace ASC.Web.Core.Utility.Skins
folderName = itemFolder ?? folderName;
}
return folderName.TrimStart('~').ToLowerInvariant();
return folderName.TrimStart('~');
}
private string GetAppThemeVirtualPath(IWebItem webitem)
@ -108,7 +110,7 @@ namespace ASC.Web.Core.Utility.Skins
var dir = webitem.StartURL.Contains(".") ?
webitem.StartURL.Substring(0, webitem.StartURL.LastIndexOf("/")) :
webitem.StartURL.TrimEnd('/');
return dir + "/app_themes";
return dir + "/App_Themes";
}
}

View File

@ -27,9 +27,11 @@
using System;
using System.IO;
using System.Linq;
using ASC.Common.Caching;
using ASC.Core;
using ASC.Core.Common.Settings;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
@ -58,6 +60,7 @@ namespace ASC.Web.Core.WhiteLabel
SettingsManager settingsManager,
TenantInfoSettingsHelper tenantInfoSettingsHelper,
TenantManager tenantManager,
AuthContext authContext,
IConfiguration configuration,
ICacheNotify<TenantLogoCacheItem> cacheNotify)
{
@ -65,6 +68,7 @@ namespace ASC.Web.Core.WhiteLabel
SettingsManager = settingsManager;
TenantInfoSettingsHelper = tenantInfoSettingsHelper;
TenantManager = tenantManager;
AuthContext = authContext;
Configuration = configuration;
var hideSettings = (Configuration["web:hide-settings"] ?? "").Split(new[] { ',', ';', ' ' });
WhiteLabelEnabled = !hideSettings.Contains("WhiteLabel", StringComparer.CurrentCultureIgnoreCase);
@ -132,7 +136,7 @@ namespace ASC.Web.Core.WhiteLabel
{
if (WhiteLabelEnabled)
{
var tenantWhiteLabelSettings = SettingsManager.LoadForDefaultTenant<TenantWhiteLabelSettings>();
var tenantWhiteLabelSettings = SettingsManager.Load<TenantWhiteLabelSettings>();
return tenantWhiteLabelSettings.GetLogoText(SettingsManager) ?? TenantWhiteLabelSettings.DefaultLogoText;
}
@ -141,7 +145,6 @@ namespace ASC.Web.Core.WhiteLabel
public bool IsRetina(HttpRequest request)
{
var isRetina = false;
if (request != null)
{
var cookie = request.Cookies["is_retina"];
@ -149,11 +152,11 @@ namespace ASC.Web.Core.WhiteLabel
{
if (bool.TryParse(cookie, out var result))
{
isRetina = result;
return result;
}
}
}
return isRetina;
return !AuthContext.IsAuthenticated;
}
public bool WhiteLabelPaid
@ -168,6 +171,7 @@ namespace ASC.Web.Core.WhiteLabel
public SettingsManager SettingsManager { get; }
public TenantInfoSettingsHelper TenantInfoSettingsHelper { get; }
public TenantManager TenantManager { get; }
public AuthContext AuthContext { get; }
public IConfiguration Configuration { get; }
/// <summary>

View File

@ -31,6 +31,7 @@ using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using ASC.Common.Logging;
using ASC.Core;
using ASC.Core.Common.Settings;
@ -38,9 +39,11 @@ using ASC.Core.Common.WhiteLabel;
using ASC.Data.Storage;
using ASC.Web.Core.Users;
using ASC.Web.Core.Utility.Skins;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Options;
using TMResourceData;
namespace ASC.Web.Core.WhiteLabel
@ -209,6 +212,7 @@ namespace ASC.Web.Core.WhiteLabel
public WhiteLabelHelper WhiteLabelHelper { get; }
public TenantManager TenantManager { get; }
public SettingsManager SettingsManager { get; }
public CoreBaseSettings CoreBaseSettings { get; }
public IOptionsMonitor<ILog> Option { get; }
public ILog Log { get; set; }
@ -219,7 +223,8 @@ namespace ASC.Web.Core.WhiteLabel
StorageFactory storageFactory,
WhiteLabelHelper whiteLabelHelper,
TenantManager tenantManager,
SettingsManager settingsManager,
SettingsManager settingsManager,
CoreBaseSettings coreBaseSettings,
IOptionsMonitor<ILog> option)
{
WebImageSupplier = webImageSupplier;
@ -228,6 +233,7 @@ namespace ASC.Web.Core.WhiteLabel
WhiteLabelHelper = whiteLabelHelper;
TenantManager = tenantManager;
SettingsManager = settingsManager;
CoreBaseSettings = coreBaseSettings;
Option = option;
Log = option.CurrentValue;
}
@ -560,7 +566,7 @@ namespace ASC.Web.Core.WhiteLabel
private void SetNewLogoText(TenantWhiteLabelSettings tenantWhiteLabelSettings, int tenantId, bool restore = false)
{
WhiteLabelHelper.DefaultLogoText = TenantWhiteLabelSettings.DefaultLogoText;
if (restore)
if (restore && !CoreBaseSettings.CustomMode)
{
WhiteLabelHelper.RestoreOldText(tenantId);
}
@ -603,7 +609,8 @@ namespace ASC.Web.Core.WhiteLabel
.AddWebImageSupplierService()
.AddStorageFactoryService()
.AddWhiteLabelHelperService()
.AddSettingsManagerService();
.AddSettingsManagerService()
.AddCoreBaseSettingsService();
}
}
}