refs #4674 Now login into the server of odbc

This commit is contained in:
Guillermo Bonet 2023-01-02 13:36:03 +01:00
parent 127abd6fb8
commit 0a759db03e
1 changed files with 30 additions and 9 deletions

View File

@ -125,7 +125,7 @@ var App = {
Conf.odbcDriver Conf.odbcDriver
); );
//Datasources creation // Datasources creation
this.createDatasources(); this.createDatasources();
// Upload the string value to version installed // Upload the string value to version installed
@ -201,6 +201,7 @@ var App = {
updateODBC: function(path, dsName, datasource) { updateODBC: function(path, dsName, datasource) {
var params; var params;
// ToDo → Transform variable to property
if (datasource == 'production') if (datasource == 'production')
params = Conf.datasources.production params = Conf.datasources.production
@ -383,19 +384,39 @@ var App = {
*/ */
fetchVersion: function() { fetchVersion: function() {
// Gets the last version number using the MySQL ODBC connection // Gets the last version number using the MySQL ODBC connection
var mysqlConn = new ActiveXObject('ADODB.Connection');; var mysqlConn = new ActiveXObject('ADODB.Connection');;
var datasource = this.getDatasource();
var serverURL;
var sslMode;
// ToDo → Transform variable to property
if (datasource == 'production')
serverURL = Conf.datasources.production.SERVER
sslMode = Conf.datasources.production.SSLMODE
if (datasource == 'test')
serverURL = Conf.datasources.test.SERVER
sslMode = Conf.datasources.test.SSLMODE
if (datasource == 'dev')
serverURL = Conf.datasources.dev.SERVER
sslMode = Conf.datasources.dev.SSLMODE
if (datasource == 'localhost')
serverURL = Conf.datasources.localhost.SERVER
sslMode = Conf.datasources.localhost.SSLMODE
try { try {
mysqlConn.open(this.getODBCString({ mysqlConn.open(this.getODBCString({
Driver: '{'+ Conf.odbcDriver +'}', Driver: '{'+ Conf.odbcDriver +'}',
Server: Conf.datasources.production.SERVER, SERVER: serverURL,
Database: Conf.dbName, DATABASE: Conf.dbName,
Uid: this.$('user').value, UID: this.$('user').value,
Pwd: this.$('password').value, PWD: this.$('password').value,
Sslca: this.certFile, SSLCA: this.certFile,
SslMode: 'VERIFY_IDENTITY', SSLMODE: sslMode,
SslCipher: 'AES256-SHA', SSLCIPHER: 'AES256-SHA',
ENABLE_CLEARTEXT_PLUGIN : 1 ENABLE_CLEARTEXT_PLUGIN : 1
})); }));
} catch (err) { } catch (err) {