diff --git a/dotnet/Directory.Build.props b/dotnet/Directory.Build.props
index 295d677ad..760d6f7c4 100644
--- a/dotnet/Directory.Build.props
+++ b/dotnet/Directory.Build.props
@@ -3,7 +3,7 @@
11.0.0.0
1
$([MSBuild]::Add($(MajorFileVersion), 100))
- 24
+ 25
$(COMMIT_NUMBER)
0
$(MajorFileVersion).$(MinorFileVersion).$(PatchFileVersion)
diff --git a/dotnet/src/dotnetcore/GxClasses.Web/GxClasses.Web.csproj b/dotnet/src/dotnetcore/GxClasses.Web/GxClasses.Web.csproj
index 1ea6ee0cf..5d7ca697c 100644
--- a/dotnet/src/dotnetcore/GxClasses.Web/GxClasses.Web.csproj
+++ b/dotnet/src/dotnetcore/GxClasses.Web/GxClasses.Web.csproj
@@ -15,7 +15,6 @@
-
diff --git a/dotnet/src/dotnetcore/GxClasses/GxClasses.csproj b/dotnet/src/dotnetcore/GxClasses/GxClasses.csproj
index 139e9264e..a153ec7c7 100644
--- a/dotnet/src/dotnetcore/GxClasses/GxClasses.csproj
+++ b/dotnet/src/dotnetcore/GxClasses/GxClasses.csproj
@@ -41,6 +41,7 @@
+
@@ -57,6 +58,7 @@
+
diff --git a/dotnet/src/dotnetcore/GxClasses/Services/Session/GXSessionFactory.cs b/dotnet/src/dotnetcore/GxClasses/Services/Session/GXSessionFactory.cs
index e21153801..51e578ce0 100644
--- a/dotnet/src/dotnetcore/GxClasses/Services/Session/GXSessionFactory.cs
+++ b/dotnet/src/dotnetcore/GxClasses/Services/Session/GXSessionFactory.cs
@@ -1,5 +1,8 @@
using System;
+using GeneXus.Application;
using GeneXus.Configuration;
+using GeneXus.Data;
+using GeneXus.Data.ADO;
using GeneXus.Encryption;
using GxClasses.Helpers;
using log4net;
@@ -11,7 +14,6 @@ public class GXSessionServiceFactory
private static readonly ILog log = log4net.LogManager.GetLogger(typeof(GXSessionServiceFactory));
static string REDIS = "REDIS";
static string DATABASE = "DATABASE";
-
public static ISessionService GetProvider()
{
ISessionService sessionService = null;
@@ -32,7 +34,6 @@ public static ISessionService GetProvider()
}
else
{
-
GXLogging.Debug(log, "Loading Session provider:", className);
#if !NETCORE
type = Type.GetType(className, true, true);
@@ -53,16 +54,15 @@ public static ISessionService GetProvider()
}
}
return null;
-
}
}
public class GxRedisSession : ISessionService
{
+ private static readonly ILog log = log4net.LogManager.GetLogger(typeof(GxRedisSession));
internal static string SESSION_ADDRESS = "SESSION_PROVIDER_ADDRESS";
internal static string SESSION_INSTANCE = "SESSION_PROVIDER_INSTANCE_NAME";
internal static string SESSION_PASSWORD = "SESSION_PROVIDER_PASSWORD";
static string SESSION_TIMEOUT = "SESSION_PROVIDER_SESSION_TIMEOUT";
-
public GxRedisSession(GXService serviceProvider)
{
string password = serviceProvider.Properties.Get(SESSION_PASSWORD);
@@ -85,6 +85,8 @@ public GxRedisSession(GXService serviceProvider)
int.TryParse(sessionTimeoutStrCompatibility, out sessionTimeoutMinutes);
SessionTimeout = sessionTimeoutMinutes;
+ GXLogging.Debug(log, "Redis Host:", host, ", InstanceName:", instanceName);
+ GXLogging.Debug(log, "Redis sessionTimeoutMinutes:", sessionTimeoutMinutes.ToString());
}
public GxRedisSession(string host, string password, string instanceName, int sessionTimeout)
{
@@ -95,63 +97,69 @@ public GxRedisSession(string host, string password, string instanceName, int ses
}
InstanceName = instanceName;
SessionTimeout = sessionTimeout;
+ GXLogging.Debug(log, "Redis Host:", host, ", InstanceName:", instanceName);
+ GXLogging.Debug(log, "Redis sessionTimeoutMinutes:", sessionTimeout.ToString());
}
public string ConnectionString { get; }
public string InstanceName { get; }
public int SessionTimeout { get; }
-
public string Schema => throw new NotImplementedException();
-
public string TableName => throw new NotImplementedException();
}
public class GxDatabaseSession : ISessionService
{
+ private static readonly ILog log = log4net.LogManager.GetLogger(typeof(GxDatabaseSession));
internal static string SESSION_ADDRESS = "SESSION_PROVIDER_ADDRESS";
internal static string SESSION_PASSWORD = "SESSION_PROVIDER_PASSWORD";
internal static string SESSION_SCHEMA = "SESSION_PROVIDER_SCHEMA";
internal static string SESSION_TABLE_NAME = "SESSION_PROVIDER_TABLE_NAME";
- internal static string SESSION_PROVIDER_SERVER = "SESSION_PROVIDER_SERVER";
- internal static string SESSION_PROVIDER_DATABASE = "SESSION_PROVIDER_DATABASE";
- internal static string SESSION_PROVIDER_USER = "SESSION_PROVIDER_USER";
-
+ internal static string SESSION_DATASTORE = "SESSION_PROVIDER_DATASTORE";
+ const string DEFAULT_SQLSERVER_SCHEMA = "dbo";
public GxDatabaseSession(GXService serviceProvider)
{
- string password = serviceProvider.Properties.Get(SESSION_PASSWORD);
- if (!string.IsNullOrEmpty(password))
- {
- password = CryptoImpl.Decrypt(password);
- }
- string serverName = serviceProvider.Properties.Get(SESSION_PROVIDER_SERVER);
- string userName = serviceProvider.Properties.Get(SESSION_PROVIDER_USER);
- string database = serviceProvider.Properties.Get(SESSION_PROVIDER_DATABASE);
- string schema = serviceProvider.Properties.Get(SESSION_SCHEMA);
- string tableName = serviceProvider.Properties.Get(SESSION_TABLE_NAME);
-
- string sessionAddresCompatibility = serviceProvider.Properties.Get(GxDatabaseSession.SESSION_ADDRESS);
- if (!string.IsNullOrEmpty(sessionAddresCompatibility))
- {
- ConnectionString = sessionAddresCompatibility;
- }
-
- if (!string.IsNullOrEmpty(serverName))
+ string datastoreName = serviceProvider.Properties.Get(SESSION_DATASTORE);
+ if (!string.IsNullOrEmpty(datastoreName))
{
- ConnectionString += $"Data Source={serverName};";
- }
- if (!string.IsNullOrEmpty(database))
- {
- ConnectionString += $"Initial Catalog={database}";
- }
- if (!string.IsNullOrEmpty(password))
- {
- ConnectionString += $";password={password}";
+ GxContext context = GxContext.CreateDefaultInstance();
+ IGxDataStore datastore = context.GetDataStore(datastoreName);
+ string schema = datastore.Connection.CurrentSchema;
+ if (string.IsNullOrEmpty(schema))
+ schema = DEFAULT_SQLSERVER_SCHEMA;
+ string tableName = serviceProvider.Properties.Get(SESSION_TABLE_NAME);
+ GxConnection conn = datastore.Connection as GxConnection;
+ Schema = schema;
+ TableName = tableName;
+ context.CloseConnections();
+ GxDataRecord dr = datastore.Db as GxDataRecord;
+ if (dr != null && conn != null)
+ {
+ ConnectionString = dr.BuildConnectionStringImpl(conn.DataSourceName, conn.InternalUserId, conn.UserPassword, conn.DatabaseName, conn.Port, conn.CurrentSchema, conn.Data);
+ GXLogging.Debug(log, "Database ConnectionString:", dr.ConnectionStringForLog());
+ }
}
- if (!string.IsNullOrEmpty(userName))
+ else //Backward compatibility configuration
{
- ConnectionString += $";user={userName}";
+ string password = serviceProvider.Properties.Get(SESSION_PASSWORD);
+ if (!string.IsNullOrEmpty(password))
+ {
+ password = CryptoImpl.Decrypt(password);
+ }
+ string schema = serviceProvider.Properties.Get(SESSION_SCHEMA);
+ string tableName = serviceProvider.Properties.Get(SESSION_TABLE_NAME);
+ string sessionAddresCompatibility = serviceProvider.Properties.Get(SESSION_ADDRESS);
+ if (!string.IsNullOrEmpty(sessionAddresCompatibility))
+ {
+ ConnectionString = sessionAddresCompatibility;
+ }
+ if (!string.IsNullOrEmpty(password))
+ {
+ ConnectionString += $";password={password}";
+ }
+ Schema = schema;
+ TableName = tableName;
}
- Schema = schema;
- TableName = tableName;
SessionTimeout = Preferences.SessionTimeout;
+ GXLogging.Debug(log, "Database sessionTimeoutMinutes:", SessionTimeout.ToString());
}
public GxDatabaseSession(string host, string password, string schema, string tableName)
{
@@ -164,16 +172,11 @@ public GxDatabaseSession(string host, string password, string schema, string tab
TableName = tableName;
}
public string ConnectionString { get; }
-
public string Schema { get; }
-
public string TableName { get; }
-
public string InstanceName => throw new NotImplementedException();
-
public int SessionTimeout { get; }
}
-
public interface ISessionService
{
string ConnectionString { get; }
diff --git a/dotnet/src/dotnetframework/GxClasses/Core/GXUtilsCommon.cs b/dotnet/src/dotnetframework/GxClasses/Core/GXUtilsCommon.cs
index bdaa6264e..694c11255 100644
--- a/dotnet/src/dotnetframework/GxClasses/Core/GXUtilsCommon.cs
+++ b/dotnet/src/dotnetframework/GxClasses/Core/GXUtilsCommon.cs
@@ -511,8 +511,8 @@ public class StringUtil
const char QMARK = '_';
static char[] numbersAndSep = new char[] { '1', '2', '3', '4', '5', '6', '7', '8', '9', '-' };
static char[] numbers = new char[] { '1', '2', '3', '4', '5', '6', '7', '8', '9' };
- internal static Dictionary LogUserEntryWhiteList = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz123456789+-_=/[]{}\":, ".ToDictionary(item => item, item => item);
- internal static Dictionary HttpHeaderWhiteList = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz123456789.;+-_=/[]{}\"':, @()?<>\\".ToDictionary(item => item, item => item);
+ internal static Dictionary LogUserEntryWhiteList = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890+-_=/[]{}\":, ".ToDictionary(item => item, item => item);
+ internal static Dictionary HttpHeaderWhiteList = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890.;+-_=/[]{}\"':, @()?<>\\".ToDictionary(item => item, item => item);
internal static string Sanitize(string input, Dictionary WhiteList)
{
diff --git a/dotnet/src/dotnetframework/GxClasses/Middleware/GXHttp.cs b/dotnet/src/dotnetframework/GxClasses/Middleware/GXHttp.cs
index 9a6f7c778..8c8579e76 100644
--- a/dotnet/src/dotnetframework/GxClasses/Middleware/GXHttp.cs
+++ b/dotnet/src/dotnetframework/GxClasses/Middleware/GXHttp.cs
@@ -44,6 +44,8 @@ namespace GeneXus.Http
using GeneXus.Notifications;
using Web.Security;
using System.Web.SessionState;
+ using GeneXus.Mock;
+ using GeneXus.Data.NTier;
#endif
@@ -274,15 +276,68 @@ private bool IsFullAjaxRequest(HttpContext httpContext)
public virtual void InitializeDynEvents() { throw new Exception("The method or operation is not implemented."); }
public virtual void initialize_properties() { throw new Exception("The method or operation is not implemented."); }
public virtual void webExecute() { throw new Exception("The method or operation is not implemented."); }
- public virtual void initialize() { throw new Exception("The method or operation is not implemented."); }
#if !NETCORE
+ public virtual void initialize() { throw new Exception("The method or operation is not implemented."); }
public virtual void cleanup() { }
+ virtual public bool UploadEnabled() { return false; }
+
+ protected virtual void ExecuteEx()
+ {
+ ExecutePrivate();
+ }
+ protected virtual void ExecutePrivate()
+ {
+
+ }
+ protected virtual void ExecutePrivateCatch(object stateInfo)
+ {
+ try
+ {
+ ((GXHttpHandler)stateInfo).ExecutePrivate();
+ }
+ catch (Exception e)
+ {
+ GXUtil.SaveToEventLog("Design", e);
+ Console.WriteLine(e.ToString());
+ }
+ }
+ protected void SubmitImpl()
+ {
+ GxContext submitContext = new GxContext();
+ DataStoreUtil.LoadDataStores(submitContext);
+ IsMain = true;
+ submitContext.SetSubmitInitialConfig(context);
+ this.context = submitContext;
+ initialize();
+ Submit(ExecutePrivateCatch, this);
+ }
+ protected virtual void CloseCursors()
+ {
+
+ }
+ protected void Submit(Action