From e514794fef4a11c7a0e5d23b578a3e1a4a062ebc Mon Sep 17 00:00:00 2001 From: Alessandro Bonazzi Date: Thu, 3 Oct 2024 18:58:16 +0200 Subject: [PATCH] Patch level : 12.00 1358 Files correlati : 777.exe 777200c.msk xvaga.dll xi.dll MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commento: Possibilità di cambiare l'utente che invia la posta nell'invio certificazioni. --- src/xvaga/xvt.h | 10 +++++-- src/xvaga/xvtmail.cpp | 68 +++++++++++++++++++++++++++++++++++++------ 2 files changed, 67 insertions(+), 11 deletions(-) diff --git a/src/xvaga/xvt.h b/src/xvaga/xvt.h index 1da0dc43b..8ac6a6b0a 100755 --- a/src/xvaga/xvt.h +++ b/src/xvaga/xvt.h @@ -101,6 +101,7 @@ XVTDLL void xvt_dm_speech_enable(int mode); XVTDLL int xvt_dm_speech_enabled(void); // Dongle support by Sirio + XVTDLL int xvt_dongle_sa_crypt(unsigned short* data); XVTDLL int xvt_dongle_sa_login(const char* module); XVTDLL int xvt_dongle_sa_logout(const char* module); @@ -368,6 +369,9 @@ XVTDLL BOOLEAN xvt_fsys_fupdate(const char* src, const char* dst); // Aggiorna i XVTDLL int xvt_str_compare_ignoring_case (const char* s1, const char* s2); XVTDLL int xvt_str_encode(const char* text, char* cypher, int mode); XVTDLL int xvt_str_decode(const char* cypher, char* text, int mode); +XVTDLL int xvt_str_base64_encode(const char *name, char *cypher); +XVTDLL int xvt_str_base64_decode(const char *cypher, long len, unsigned char *text); +XVTDLL size_t xvt_str_base64_len(size_t len); XVTDLL char* xvt_str_duplicate(const char* str); XVTDLL BOOLEAN xvt_str_match(const char* str, const char* pat, BOOLEAN case_sensitive); XVTDLL double xvt_str_fuzzy_compare (const char* s1, const char* s2); @@ -416,6 +420,7 @@ XVTDLL long xvt_sys_close_children(WINDOW win); XVTDLL long xvt_sys_execute(const char* cmdline, BOOLEAN sync, BOOLEAN iconizetask); XVTDLL long xvt_sys_execute_in_window(const char* cmdline, WINDOW win); XVTDLL BOOLEAN xvt_sys_kill(long pid); +XVTDLL const char * xvt_sys_command(); typedef XVT_CALLCONV_TYPEDEF(int, XVT_MULTITHREAD_CALLBACK, (void* pCaller, void* pData, int i, int tot) ); XVTDLL BOOLEAN xvt_sys_multithread(XVT_MULTITHREAD_CALLBACK callback, void* pCaller, void* pData, int tot, const char* msg); @@ -426,6 +431,7 @@ XVTDLL BOOLEAN xvt_sys_goto_url(const char* url, const char* action); XVTDLL int xvt_sys_dongle_server_running(); XVTDLL BOOLEAN xvt_sys_find_editor(const char* file, char* editor); XVTDLL BOOLEAN xvt_sys_get_env(const char* varname, char* value, int max_size); +XVTDLL void xvt_sys_set_oem(int oem); XVTDLL long xvt_sys_get_oem_int(const char* name, long defval); XVTDLL int xvt_sys_get_oem_string(const char* name, const char* defval, char* value, int maxsize); @@ -495,8 +501,6 @@ XVTDLL void xvt_win_set_handler(WINDOW win, EVENT_HANDLER eh); XVTDLL void xvt_win_trap_pointer(WINDOW win); XVTDLL BOOLEAN xvt_win_is_taskbar_visible(); -XVTDLL BOOLEAN xvt_win_is_taskbar_visible(); - // Added by XVAGA XVTDLL BOOLEAN xvt_pane_add(WINDOW parent, WINDOW pane, const char* name, int dock, int flags); XVTDLL BOOLEAN xvt_pane_change_flags(WINDOW pane, int set, int reset); @@ -576,7 +580,9 @@ XVTDLL void xvt_treelist_suspend(WINDOW win); XVTDLL BOOLEAN xvt_url_valid(const char * url); XVTDLL BOOLEAN xvt_url_get(const char * url, const char * path, const char * outfile); +XVTDLL void xvt_set_mail_params(const char * smtp, const char * port, const char * user, const char * pass, const char * from); // Send email using normal methods + XVTDLL BOOLEAN xvt_mail_send(const char* to, const char* cc, const char* ccn, const char* subject, const char* msg, const char* attach, short flags); // 0x1=UI; 0x2=Receipt // Send email using Microsoft Powershell diff --git a/src/xvaga/xvtmail.cpp b/src/xvaga/xvtmail.cpp index 37bf17a41..5f9613b90 100755 --- a/src/xvaga/xvtmail.cpp +++ b/src/xvaga/xvtmail.cpp @@ -38,17 +38,67 @@ static wxString GetMailParam(const char* key, const char* def = "") return val; } +static wxString __smtp = "notset"; +static wxString __port = "notset"; +static wxString __user = "notset"; +static wxString __pass = "notset"; +static wxString __from = "notset"; + +void xvt_set_mail_params(const char * smtp, const char * port, const char * user, const char * pass, const char * from) +{ + if (__smtp == "notset") + { + __smtp = GetMailParam("Server", "MAPI"); + __port = GetMailParam("Port"); + __user = GetMailParam("User"); + __pass = GetMailParam("Password"); + + wxString f = (user && *user) ? user: __user; + + if (f.find('@') < 0) + { + f += "@"; + f += __smtp.AfterFirst('.'); + } + __from = GetMailParam("From", f); + } + if (smtp && *smtp) + __smtp = smtp; + if (port && *port) + __port = port; + if (user && *user) + __user = user; + if (pass && *pass) + __pass = pass; + if (from && *from) + __from = from; +} + static bool GetMailParams(wxString& smtp, wxString& port, wxString& user, wxString& pass, wxString& from) { - smtp = GetMailParam("Server", "MAPI"); - port = GetMailParam("Port"); - user = GetMailParam("User"); - pass = GetMailParam("Password"); - wxString f = user; - if (f.find('@') < 0) - { f += "@"; f += smtp.AfterFirst('.'); } - from = GetMailParam("From", f); + if (__smtp == "notset") + { + __smtp = GetMailParam("Server", "MAPI"); + __port = GetMailParam("Port"); + __user = GetMailParam("User"); + __pass = GetMailParam("Password"); + } + smtp = __smtp; + port = __port; + user = __user; + pass = __pass; + if (__from == "notset") + { + wxString f = user; + if (f.find('@') < 0) + { + f += "@"; + f += __smtp.AfterFirst('.'); + } + __from = GetMailParam("From", f); + } + from = __from; return !smtp.IsEmpty() && !pass.IsEmpty(); } @@ -541,4 +591,4 @@ BOOLEAN xvt_powermail_send(const char* to, const char* cc, const char* ccn, fprintf(f, "exitcode = %d\n", exit); fclose(f); return exit == 0; -} \ No newline at end of file +}