Changeset: 80be9f8ed0ee for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/80be9f8ed0ee Modified Files: clients/odbc/winsetup/setup.c Branch: default Log Message:
Correcting the place where the validation needs to be done. diffs (60 lines): diff --git a/clients/odbc/winsetup/setup.c b/clients/odbc/winsetup/setup.c --- a/clients/odbc/winsetup/setup.c +++ b/clients/odbc/winsetup/setup.c @@ -188,6 +188,18 @@ DialogProc(HWND hwndDlg, UINT uMsg, WPAR free(datap->dsn); datap->dsn = strdup(buf); } + /* validate entered string values */ + GetDlgItemText(hwndDlg, IDC_EDIT_AUTOCOMMIT, buf, sizeof(buf)); + if (strcmp("on", buf) != 0 && strcmp("off", buf) != 0) { + MessageBox(hwndDlg, "Autocommit must be set to on or off. Default is on.", NULL, MB_ICONERROR); + return TRUE; + } + GetDlgItemText(hwndDlg, IDC_EDIT_USETLS, buf, sizeof(buf)); + if (strcmp("on", buf) != 0 && strcmp("off", buf) != 0) { + MessageBox(hwndDlg, "TLS Encrypt must be set to on or off. Default is off.", NULL, MB_ICONERROR); + return TRUE; + } + GetDlgItemText(hwndDlg, IDC_EDIT_DESC, buf, sizeof(buf)); if (datap->desc) free(datap->desc); @@ -265,9 +277,11 @@ DialogProc(HWND hwndDlg, UINT uMsg, WPAR EndDialog(hwndDlg, LOWORD(wParam)); return TRUE; case IDC_BUTTON_TEST: + // TODO call SQLDriverConnect() MessageBox(hwndDlg, "Test Connection not yet implemented", NULL, MB_ICONERROR); return TRUE; case IDC_BUTTON_HELP: + // TODO invoke webbrowser with url to webpage decribing this dialog. MessageBox(hwndDlg, "Help not yet implemented", NULL, MB_ICONERROR); return TRUE; } @@ -486,25 +500,6 @@ ConfigDSN(HWND parent, WORD request, LPC goto finish; } } - /* some data validation on entered strings */ - if (data.autocommit) { - if (strcmp("on", data.autocommit) != 0 - && strcmp("off", data.autocommit) != 0) { - rc = FALSE; - if (parent) - MessageBox(parent, "Autocommit may only be set to on or off.", NULL, MB_ICONERROR); - goto finish; - } - } - if (data.use_tls) { - if (strcmp("on", data.use_tls) != 0 - && strcmp("off", data.use_tls) != 0) { - rc = FALSE; - if (parent) - MessageBox(parent, "TLS Encrypt may only be set to on or off.", NULL, MB_ICONERROR); - goto finish; - } - } ODBCLOG("ConfigDSN writing values: DSN=%s UID=%s PWD=%s Host=%s Port=%s Database=%s Schema=%s LoginTimeout=%s ReplyTimeout=%s ReplySize=%s AutoCommit=%s TimeZone=%s LogFile=%s TLSs=%s Cert=%s CertHash=%s ClientKey=%s ClientCert=%s\n", data.dsn ? data.dsn : "(null)", _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org