summaryrefslogtreecommitdiff
path: root/plugins/Exchange/src/dlg_handlers.cpp
diff options
context:
space:
mode:
authorMaciej Wycik <makar@poczta.of.pl>2013-07-29 10:05:05 +0000
committerMaciej Wycik <makar@poczta.of.pl>2013-07-29 10:05:05 +0000
commitd071a97479aed0d59f2d4a8acc27cf9369c7cd61 (patch)
tree23e851f6efbaca757fe475ba215875e9dba2b25f /plugins/Exchange/src/dlg_handlers.cpp
parentcd93f0bad584bd4c27d8d9ad5e067353554903c2 (diff)
password encryption (there is no unicode support in database.h?)
git-svn-id: http://svn.miranda-ng.org/main/trunk@5521 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Exchange/src/dlg_handlers.cpp')
-rw-r--r--plugins/Exchange/src/dlg_handlers.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/plugins/Exchange/src/dlg_handlers.cpp b/plugins/Exchange/src/dlg_handlers.cpp
index 1e291b9ce5..af160dac05 100644
--- a/plugins/Exchange/src/dlg_handlers.cpp
+++ b/plugins/Exchange/src/dlg_handlers.cpp
@@ -35,6 +35,7 @@ BOOL CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_INITDIALOG:
{
TCHAR buffer[4096];
+ char apassword[1024];
long port;
long interval;
int bCheck;
@@ -52,8 +53,9 @@ BOOL CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
GetStringFromDatabase("Username", _T(""), buffer, sizeof(buffer));
SetWindowText(GetDlgItem(hWnd, IDC_USER_EDIT), buffer);
GetStringFromDatabase("Password", _T(""), buffer, sizeof(buffer));
- CallService(MS_DB_CRYPT_DECODESTRING, sizeof(buffer), (LPARAM) buffer);
- SetWindowText(GetDlgItem(hWnd, IDC_PASSWORD_EDIT), buffer);
+ strcpy(apassword,mir_t2a(buffer));
+ CallService(MS_DB_CRYPT_DECODESTRING, sizeof(apassword), (LPARAM) apassword);
+ SetWindowText(GetDlgItem(hWnd, IDC_PASSWORD_EDIT), mir_a2t(apassword));
GetStringFromDatabase("Server", _T(""), buffer, sizeof(buffer));
SetWindowText(GetDlgItem(hWnd, IDC_SERVER_EDIT), buffer);
@@ -145,6 +147,7 @@ BOOL CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
case PSN_APPLY:
{
TCHAR buffer[4096];
+ char apassword[1024];
long port = 0;
long interval = DEFAULT_INTERVAL;
int bCheck = IsDlgButtonChecked(hWnd, IDC_CHECK_EMAILS);
@@ -154,8 +157,12 @@ BOOL CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
GetWindowText(GetDlgItem(hWnd, IDC_USER_EDIT), buffer, sizeof(buffer));
db_set_ts(NULL, ModuleName, "Username", buffer);
GetWindowText(GetDlgItem(hWnd, IDC_PASSWORD_EDIT), buffer, sizeof(buffer));
- CallService(MS_DB_CRYPT_ENCODESTRING, sizeof(buffer), (LPARAM) buffer);
- db_set_ts(NULL, ModuleName, "Password", buffer);
+ strcpy(apassword,mir_t2a(buffer));
+
+ CallService(MS_DB_CRYPT_ENCODESTRING, sizeof(apassword), (LPARAM) apassword);
+
+ db_set_ts(NULL, ModuleName, "Password", mir_a2t(apassword));
+
GetWindowText(GetDlgItem(hWnd, IDC_SERVER_EDIT), buffer, sizeof(buffer));
db_set_ts(NULL, ModuleName, "Server", buffer);
GetWindowText(GetDlgItem(hWnd, IDC_PORT_EDIT), buffer, sizeof(buffer));