From 2dd2aeb2a39362f3a8cdd42e4d1fb0cef88d614f Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 21 Apr 2009 14:55:13 +0000 Subject: [PATCH] Patch level : 10.0 Files correlati : ba8.exe ba8700a.msk bamenu.men Ricompilazione Demo : [ ] Commento : Aggiunti programma e relativa maschera per l'immisione dei parametri per la firma digitale di ogni singolo utente git-svn-id: svn://10.65.10.50/trunk@18752 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ba/ba0103.cpp | 15 ------ ba/ba1700.cpp | 23 +++++++--- ba/ba5.cpp | 19 ++------ ba/ba8.cpp | 1 + ba/ba8.h | 1 + ba/ba8700.cpp | 121 +++++++++++++++++++++++++++++++++++++++++++++++++ ba/ba8700a.h | 7 +++ ba/ba8700a.uml | 87 +++++++++++++++++++++++++++++++++++ ba/bamenu.men | 1 + 9 files changed, 239 insertions(+), 36 deletions(-) create mode 100755 ba/ba8700.cpp create mode 100755 ba/ba8700a.h create mode 100755 ba/ba8700a.uml diff --git a/ba/ba0103.cpp b/ba/ba0103.cpp index 5de56d8a0..5581930e3 100755 --- a/ba/ba0103.cpp +++ b/ba/ba0103.cpp @@ -119,21 +119,6 @@ void TBook_window::update() _logo.draw(win(), rctw, 'C', 'B', '-'); const PNT pnt = { 0, 0 }; draw_spider(win(), 0x3, pnt); - - const TDate oggi(TODAY); - if (oggi.day() == 1 && oggi.month() == 4) - { - hide_brush(); - RCT r = rctw; - r.left = rctw.right/16; - r.top = rctw.bottom / 2 - rctw.right/8; - r.bottom = rctw.bottom / 2 + rctw.right/8; - set_pen(COLOR_RED, 3); - xvt_dwin_draw_oval(win(), &r); - r.right = r.left; - r.left = -r.left; - xvt_dwin_draw_arc(win(), &r, (r.left+r.right)/2, r.bottom, (r.left+r.right)/2, r.top); - } } } } diff --git a/ba/ba1700.cpp b/ba/ba1700.cpp index 961247e32..6acea8619 100755 --- a/ba/ba1700.cpp +++ b/ba/ba1700.cpp @@ -1017,12 +1017,16 @@ bool TInstaller_mask::install(const TString& module, int patchlevel) // DECOMPRESSIONE // ---------------- // viene decompresso il file .zip collegato al file remote_ini (es. ba0883a1.zip, bainst.zip) - msg = TR("Decompressione"); - if (is_a_patch) - msg << TR(" della patch ") << patchlevel ; - msg << TR(" del modulo '") << module << TR("' in corso..."); - TProgind pi(dischi, msg, false, true); + TProgind* pi = NULL; + if (dischi > 1) + { + msg = TR("Decompressione"); + if (is_a_patch) + msg << TR(" della patch ") << patchlevel ; + msg << TR(" del modulo '") << module << TR("' in corso..."); + pi = new TProgind(dischi, msg, false, true); + } TFilename tempdir; tempdir.tempdir(); @@ -1081,6 +1085,11 @@ bool TInstaller_mask::install(const TString& module, int patchlevel) if (ok) ::fcopy(chunk, totti, d > 1); // Somma il chunk al totale } + if (pi != NULL) + { + delete pi; + pi = NULL; + } //scompattamento vero e proprio dello zip aga_unzip(totti, tempdir); // Scompatta il file totale zip @@ -1114,9 +1123,10 @@ bool TInstaller_mask::install(const TString& module, int patchlevel) if (ok) { + TWait_cursor hourglass; msg.cut(0); msg << TR("Aggiornamento del modulo '") << module << TR("' in corso..."); - pi.set_text(msg); + xvtil_statbar_set(msg); ok = move_module(module, *remote_ini, true); if (ok) @@ -1145,6 +1155,7 @@ bool TInstaller_mask::install(const TString& module, int patchlevel) } } } + xvtil_statbar_set(""); } //if(ok).. } //if(ok).. if (ok) // marca sull'install.ini di destinazione l'avvenuta installazione del modulo diff --git a/ba/ba5.cpp b/ba/ba5.cpp index a7584e2f7..766b495d3 100755 --- a/ba/ba5.cpp +++ b/ba/ba5.cpp @@ -1,29 +1,18 @@ #include -#include -#include #include "ba5.h" -#define usage "Error - usage : %s -{0|1|2}" - int main(int argc,char** argv) - { - int rt = -1 ; + int rt = -1 ; const int r = (argc > 1) ? atoi(&argv[1][1]) : -1; switch (r) { - case 0: - rt = ba5100(argc,argv) ; break; // ricerca soci - case 1: - rt = ba5200(argc,argv) ; break; // Gestione registri - case 2: - rt = ba5300(argc,argv) ; break; // ricezione ABI/CAB - default: - error_box(usage, argv[0]) ; break; + case 1: rt = ba5200(argc,argv); break; // Gestione registri + case 2: rt = ba5300(argc,argv); break; // ricezione ABI/CAB + default: rt = ba5100(argc,argv); break; // ricerca soci } - exit(rt); return rt; } diff --git a/ba/ba8.cpp b/ba/ba8.cpp index 39fa89036..d28d49e49 100755 --- a/ba/ba8.cpp +++ b/ba/ba8.cpp @@ -12,6 +12,7 @@ int main(int argc, char** argv) case 3: ba8400(argc, argv); break; // Form Converter case 4: ba8500(argc, argv); break; // Report Printer case 5: ba8600(argc, argv); break; // Ricerca documenti archiviati + case 6: ba8700(argc, argv); break; // Firma digitale default: ba8300(argc, argv); break; // Report Generator } return 0; diff --git a/ba/ba8.h b/ba/ba8.h index 624addfcd..522fa3e2c 100755 --- a/ba/ba8.h +++ b/ba/ba8.h @@ -4,5 +4,6 @@ int ba8300(int argc, char* argv[]); int ba8400(int argc, char* argv[]); int ba8500(int argc, char* argv[]); int ba8600(int argc, char* argv[]); +int ba8700(int argc, char* argv[]); diff --git a/ba/ba8700.cpp b/ba/ba8700.cpp new file mode 100755 index 000000000..d46dcd6e1 --- /dev/null +++ b/ba/ba8700.cpp @@ -0,0 +1,121 @@ +#include "ba8.h" +#include "ba8700a.h" + +#include +#include +#include +#include + +/////////////////////////////////////////////////////////// +// TSignature_mask +/////////////////////////////////////////////////////////// + +class TSignature_mask : public TAutomask +{ + TString _host, _user; + bool _admin; + +protected: + virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly); + +public: + void load(); + void save(); + + TSignature_mask(); +}; + +bool TSignature_mask::on_field_event(TOperable_field& o, TField_event e, long jolly) +{ + switch (o.dlg()) + { + case F_LIST: + if (e == se_query_add || e == se_query_del) + return _admin; + break; + default: + break; + } + return true; +} + +void TSignature_mask::load() +{ + TConfig ini(CONFIG_WST, "fd"); + TAssoc_array& ass = ini.list_variables(); + + TSheet_field& sheet = sfield(F_LIST); + FOR_EACH_ASSOC_STRING(ass, h, key, val) + { + if (_admin || _user.compare(key, -1, true) == 0) + { + TToken_string& row = sheet.row(-1); + row = key; // "Cert_USER" + row.ltrim(5); // remove "Cert_" + row.add(val); // add "pkxxx.dll,certificate" + row.replace(',', row.separator()); + } + } + sheet.sort(); +} + +void TSignature_mask::save() +{ + TConfig ini(CONFIG_WST, "fd"); + + if (_admin) + ini.remove_all(); + + TSheet_field& sheet = sfield(F_LIST); + TString u, f, c; + FOR_EACH_SHEET_ROW(sheet, i, row) + { + row->get(0, u); + if (u.full()) + { + u.insert("Cert_"); + row->get(1, f); + row->get(2, c); + if (c.full()) + f << ',' << c; + ini.set(u, f); + } + } +} + +TSignature_mask::TSignature_mask() : TAutomask("ba8700a") +{ + _admin = user() == dongle().administrator(); + xvt_sys_get_host_name(_host.get_buffer(), _host.size()); + xvt_sys_get_user_name(_user.get_buffer(), _user.size()); + set(F_HOST, _host); + set(F_NAME, _user); + load(); +} + +/////////////////////////////////////////////////////////// +// TSignature_app +/////////////////////////////////////////////////////////// + +class TSignature_app : public TSkeleton_application +{ +protected: + virtual const char* extra_modules() const { return "fd"; } + +public: + virtual void main_loop(); +}; + +void TSignature_app::main_loop() +{ + TSignature_mask m; + while (m.run() == K_ENTER) + m.save(); +} + +int ba8700(int argc, char* argv[]) +{ + TSignature_app app; + app.run(argc, argv, TR("Firma digitale")); + return 0; +} \ No newline at end of file diff --git a/ba/ba8700a.h b/ba/ba8700a.h new file mode 100755 index 000000000..9ff38ed1e --- /dev/null +++ b/ba/ba8700a.h @@ -0,0 +1,7 @@ +#define F_HOST 201 +#define F_NAME 202 +#define F_LIST 203 + +#define F_USER 101 +#define F_FILE 102 +#define F_CERT 103 diff --git a/ba/ba8700a.uml b/ba/ba8700a.uml new file mode 100755 index 000000000..bfecec6ff --- /dev/null +++ b/ba/ba8700a.uml @@ -0,0 +1,87 @@ +#include "ba8700a.h" + +TOOLBAR "topbar" 0 0 0 2 + +BUTTON DLG_OK 2 2 +BEGIN + PROMPT 1 1 "Salva" + PICTURE TOOL_SAVEREC +END + +#include +ENDPAGE + +PAGE "Firma digitale" 0 2 0 0 + +GROUPBOX DLG_NULL 78 3 +BEGIN + PROMPT 1 0 "@bParametri" +END + +STRING F_HOST 256 32 +BEGIN + PROMPT 2 1 "Stazione " + FLAGS "D" +END + +STRING F_NAME 80 24 +BEGIN + PROMPT 46 1 "Utente " + FLAGS "D" +END + +SPREADSHEET F_LIST +BEGIN + PROMPT 0 3 "" + ITEM "Utente@16" + ITEM "File certificato o DLL@60" + ITEM "Nome certificato@32" +END + +ENDPAGE + +ENDMASK + +PAGE "Parametri" -1 -1 78 6 + +STRING F_USER 32 16 +BEGIN + PROMPT 1 1 "Utente " + CHECKTYPE REQUIRED +END + +STRING F_FILE 260 40 +BEGIN + PROMPT 1 2 "File PFX o DLL " + CHECKTYPE REQUIRED + FSELECT "*" + FLAGS "M" +END + +STRING F_CERT 80 40 +BEGIN + PROMPT 1 3 "Certificato " +END + +ENDPAGE + +TOOLBAR "topbar" 0 0 0 2 + +BUTTON DLG_OK 2 2 +BEGIN + PROMPT 1 1 "" +END + +BUTTON DLG_DELREC 2 2 +BEGIN + PROMPT 2 1 "" +END + +BUTTON DLG_CANCEL 2 2 +BEGIN + PROMPT 3 1 "" +END + +ENDPAGE + +ENDMASK diff --git a/ba/bamenu.men b/ba/bamenu.men index a715bd986..6f5d78b01 100755 --- a/ba/bamenu.men +++ b/ba/bamenu.men @@ -97,6 +97,7 @@ Item_01 = "Generatore query", "ba8 -1", "S" Item_02 = "Generatore report", "ba8 -2", "S", 10217 Item_03 = "Convertitore da form a report", "ba8 -3", "" Item_04 = "Ricerca file archiviati", "ba8 -5", "" +Item_05 = "Firma digitale", "ba8 -6", "" [MENU_015] Caption = "Manutenzione"