Patch level : 2.0 646
Files correlati : ba1.exe Ricompilazione Demo : [ ] Commento : AO20124 Entro nella gestione Utenti e voglio abilitare un utente ad altri moduli attivati sulla chiavetta, ogni modulo che voglio attivare è inibito e non lascia mettere la spunta. AO20125 E' possibile nella gestione utenti togliere la spunta al modulo Base, se ciò avviene non si riesce più a spuntare nessun modulo, bisogna uscire dagli utenti e rientrare. git-svn-id: svn://10.65.10.50/trunk@11617 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
fb2050bfc7
commit
37a193f44a
@ -2,8 +2,8 @@
|
||||
|
||||
#include <applicat.h>
|
||||
#include <progind.h>
|
||||
#include <recarray.h>
|
||||
#include <relation.h>
|
||||
#include <urldefid.h>
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Testfile
|
||||
@ -15,6 +15,7 @@ protected:
|
||||
void test1();
|
||||
void test2();
|
||||
void test3();
|
||||
void test4();
|
||||
|
||||
clock_t start_timer() const;
|
||||
|
||||
@ -131,12 +132,47 @@ void TTest_application::test3()
|
||||
message_box(msg);
|
||||
}
|
||||
|
||||
void TTest_application::test4()
|
||||
{
|
||||
long r = 0;
|
||||
srand(r);
|
||||
TString8 cod;
|
||||
|
||||
clock_t start;
|
||||
{
|
||||
const int times = 10;
|
||||
TProgind p(times, TR("Lettura casuale tramite cache"), TRUE, TRUE);
|
||||
cache().get(LF_COMUNI, cod); // Inizializzazione
|
||||
start = start_timer();
|
||||
for (int i = 0; i < times; i++)
|
||||
{
|
||||
for (long j = 0; j < 10000; j++)
|
||||
{
|
||||
cod.format(" |%c%03d", 'A'+rand()%8, rand() % 1000);
|
||||
cache().get(LF_COMUNI, cod);
|
||||
r++;
|
||||
}
|
||||
p.addstatus(1);
|
||||
if (p.iscancelled())
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const clock_t t = clock() - start;
|
||||
TString msg;
|
||||
msg.format("%ld records in %ld msec\n%lg records per sec", r, t, 1000.0*r/t);
|
||||
message_box(msg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void TTest_application::main_loop()
|
||||
{
|
||||
test1();
|
||||
test2();
|
||||
test3();
|
||||
test4();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
|
@ -502,16 +502,14 @@ bool TSet_users::p_notify(TSheet_field& f, int r, KEY k)
|
||||
|
||||
void TSet_user_passwd::build_sheet(const TRectype* r)
|
||||
{
|
||||
TString autstr;
|
||||
TSheet_field& sf = sheet_field();
|
||||
TString autstr, d;
|
||||
if (r != NULL)
|
||||
{
|
||||
autstr = r->get("AUTSTR");
|
||||
}
|
||||
const int l = autstr.len();
|
||||
|
||||
TSheet_field& sf = sheet_field();
|
||||
sf.destroy();
|
||||
|
||||
TString d;
|
||||
|
||||
for (int i = 0; i < ENDAUT; i++)
|
||||
{
|
||||
d = _im->get_description_by_order(i);
|
||||
@ -523,9 +521,7 @@ void TSet_user_passwd::build_sheet(const TRectype* r)
|
||||
if (r!= NULL && module<l && autstr[module]=='X')
|
||||
riga.add("X");
|
||||
else
|
||||
{
|
||||
riga.add(" ");
|
||||
}
|
||||
riga.add(module);
|
||||
}
|
||||
enable_aut();
|
||||
@ -561,7 +557,7 @@ void TSet_users::build_tree(const TRectype* r)
|
||||
// mostra le abilitazioni
|
||||
void TSet_user_passwd::enable_aut()
|
||||
{
|
||||
const bool prassi = _msk->get(F_USER) == ::dongle().administrator();
|
||||
const bool superuser = _msk->get(F_USER) == ::dongle().administrator();
|
||||
const int uns = _im->unassigned();
|
||||
TSheet_field& sf = sheet_field();
|
||||
const int itms = sf.items();
|
||||
@ -577,8 +573,10 @@ void TSet_user_passwd::enable_aut()
|
||||
}
|
||||
else
|
||||
{
|
||||
sf.enable_cell(i,1,!prassi && has_module(module, CHK_DONGLE));
|
||||
if (prassi) riga.add("X",1);
|
||||
const bool on = !superuser && has_module(module, CHK_DONGLE);
|
||||
sf.enable_cell(i,1,on);
|
||||
if (superuser)
|
||||
riga.add("X",1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -600,14 +598,20 @@ bool TSet_user_passwd::user_has_module(int mod)
|
||||
|
||||
bool TSet_users::k_notify(TSheet_field& f, int r, KEY k)
|
||||
{
|
||||
if (k == K_INS)
|
||||
if (k == K_INS || k == K_DEL)
|
||||
return FALSE;
|
||||
if (k == K_TAB)
|
||||
{
|
||||
TMask& m = f.sheet_mask();
|
||||
m.enable(F_ENABLE, f.cell_enabled(r, f.cid2index(F_ENABLE)));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TSet_user_passwd::user_create()
|
||||
{
|
||||
bool superuser = user() == ::dongle().administrator();
|
||||
const bool superuser = user() == ::dongle().administrator();
|
||||
_rel = new TRelation(LF_USER);
|
||||
|
||||
_im = new TInformazione_moduli;
|
||||
@ -632,12 +636,7 @@ bool TSet_users::user_create()
|
||||
TSheet_field& sf = sheet_field();
|
||||
sf.set_notify(k_notify);
|
||||
|
||||
#ifdef XVAGA
|
||||
const char* menuname = "bamenu.men";
|
||||
#else
|
||||
const char* menuname = "baprassi.men";
|
||||
#endif
|
||||
|
||||
if (argc() > 2)
|
||||
menuname = argv(2);
|
||||
|
||||
|
@ -582,7 +582,8 @@ bool TAttivazione_moduli::burn_dongle()
|
||||
{
|
||||
const int module = riga->get_int(2);
|
||||
garble(module, str);
|
||||
if (key == str)
|
||||
const bool good = key == str;
|
||||
if (good)
|
||||
{
|
||||
if (!din.active(module) &&
|
||||
yesno_box(FR("Confermare l'attivazione del modulo %d:\n%s"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user