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