Patch level : 10.0
Files correlati : ba0.exe ba1.exe Ricompilazione Demo : [ ] Commento : Resa possibile manutenzione archivi anche quando il file degli utenti risulti danneggiato o mancante git-svn-id: svn://10.65.10.50/trunk@19287 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
12484ac921
commit
e68d4887aa
@ -54,6 +54,7 @@ protected: // TApplication
|
|||||||
virtual void on_firm_change();
|
virtual void on_firm_change();
|
||||||
virtual bool test_assistance_year() const;
|
virtual bool test_assistance_year() const;
|
||||||
|
|
||||||
|
bool test_users_file() const;
|
||||||
bool ask_user_password(TString& utente);
|
bool ask_user_password(TString& utente);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -960,6 +961,19 @@ void TMenu_application::reload_images()
|
|||||||
_menu.reload_images();
|
_menu.reload_images();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TMenu_application::test_users_file() const
|
||||||
|
{
|
||||||
|
bool ok = prefix_valid();
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
TSystemisamfile users(LF_USER);
|
||||||
|
ok = users.open_ex() == NOERR;
|
||||||
|
if (ok)
|
||||||
|
users.close();
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
bool TMenu_application::ask_user_password(TString& utente)
|
bool TMenu_application::ask_user_password(TString& utente)
|
||||||
{
|
{
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
@ -967,6 +981,14 @@ bool TMenu_application::ask_user_password(TString& utente)
|
|||||||
// Disabilita le voci di personalizzazione
|
// Disabilita le voci di personalizzazione
|
||||||
enable_options_menu(false);
|
enable_options_menu(false);
|
||||||
|
|
||||||
|
if (!test_users_file())
|
||||||
|
{
|
||||||
|
error_box(TR("Non e' possibile accedere al file degli utenti: necessita manutenzione"));
|
||||||
|
TExternal_app app("ba1 -0");
|
||||||
|
app.run(true, 1, false);
|
||||||
|
return ok; // False
|
||||||
|
}
|
||||||
|
|
||||||
TMask m("ba0100a");
|
TMask m("ba0100a");
|
||||||
m.set_handler(user_mask_handler);
|
m.set_handler(user_mask_handler);
|
||||||
|
|
||||||
@ -1082,7 +1104,7 @@ int TMenu_application::get_user_status(const char* usr) const
|
|||||||
CHECK(usr && *usr, "Utente nullo");
|
CHECK(usr && *usr, "Utente nullo");
|
||||||
|
|
||||||
int status = 0;
|
int status = 0;
|
||||||
if (prefix_valid())
|
if (test_users_file())
|
||||||
{
|
{
|
||||||
TLocalisamfile utonti(LF_USER);
|
TLocalisamfile utonti(LF_USER);
|
||||||
utonti.put(USR_USERNAME, usr);
|
utonti.put(USR_USERNAME, usr);
|
||||||
@ -1109,7 +1131,7 @@ bool TMenu_application::set_user_status(const char* usr, int status) const
|
|||||||
CHECK(usr && *usr, "Utente nullo");
|
CHECK(usr && *usr, "Utente nullo");
|
||||||
|
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
if (prefix_valid())
|
if (test_users_file())
|
||||||
{
|
{
|
||||||
TLocalisamfile utonti(LF_USER);
|
TLocalisamfile utonti(LF_USER);
|
||||||
utonti.put(USR_USERNAME, usr);
|
utonti.put(USR_USERNAME, usr);
|
||||||
@ -1141,7 +1163,7 @@ bool TMenu_application::check_user()
|
|||||||
{
|
{
|
||||||
TConfig campo_ini(CONFIG_INSTALL, "Main");
|
TConfig campo_ini(CONFIG_INSTALL, "Main");
|
||||||
const bool use_system_user = campo_ini.get_bool("AutoLogin");
|
const bool use_system_user = campo_ini.get_bool("AutoLogin");
|
||||||
if (use_system_user)
|
if (use_system_user && test_users_file())
|
||||||
ok = !cache().get(LF_USER, utente).empty();
|
ok = !cache().get(LF_USER, utente).empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -653,7 +653,7 @@ void TManutenzione_app::edit_riga (long riga_sel, TToken_string& riga)
|
|||||||
switch (tasto)
|
switch (tasto)
|
||||||
{
|
{
|
||||||
case K_F4:
|
case K_F4:
|
||||||
if (logicnum > 1)
|
if (logicnum >= LF_USER)
|
||||||
{
|
{
|
||||||
const TFilename filename(_mask->get(FLD_NOME));
|
const TFilename filename(_mask->get(FLD_NOME));
|
||||||
const TString& tabella = _mask->get(F_TAB);
|
const TString& tabella = _mask->get(F_TAB);
|
||||||
@ -694,7 +694,7 @@ void TManutenzione_app::edit_riga (long riga_sel, TToken_string& riga)
|
|||||||
f_name.ext("dbf");
|
f_name.ext("dbf");
|
||||||
|
|
||||||
if (!f_name.exist())
|
if (!f_name.exist())
|
||||||
f.build(eox);
|
f.build();
|
||||||
|
|
||||||
_browse->dir().get(logicnum, _nolock, _nordir, _sysdirop);
|
_browse->dir().get(logicnum, _nolock, _nordir, _sysdirop);
|
||||||
}
|
}
|
||||||
@ -1437,8 +1437,9 @@ void TManutenzione_app::load_des()
|
|||||||
|
|
||||||
bool TManutenzione_app::set_converting()
|
bool TManutenzione_app::set_converting()
|
||||||
{
|
{
|
||||||
TIsamfile utenti(LF_USER);
|
TSystemisamfile utenti(LF_USER);
|
||||||
utenti.open(_excllock);
|
if (utenti.open_ex(_excllock) != NOERR)
|
||||||
|
return yesno_box(TR("Il file degli utenti risulta compromesso, si desidera proseguire ugualmente?"));
|
||||||
|
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
while (!ok)
|
while (!ok)
|
||||||
|
@ -153,9 +153,9 @@ HIDDEN bool len_handler(TMask_field& f, KEY key)
|
|||||||
case _longzerofld:
|
case _longzerofld:
|
||||||
return len <= 10;
|
return len <= 10;
|
||||||
default:
|
default:
|
||||||
return TRUE;
|
break;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TRec_sheet::fld_notify(TSheet_field& f, int r, KEY k)
|
bool TRec_sheet::fld_notify(TSheet_field& f, int r, KEY k)
|
||||||
@ -214,7 +214,7 @@ void TRec_sheet::save()
|
|||||||
// Il bottone "salva" salva anche il trr e dir in recdesc
|
// Il bottone "salva" salva anche il trr e dir in recdesc
|
||||||
|
|
||||||
TFilename nf;
|
TFilename nf;
|
||||||
nf << "recdesc\\f" << _dir.num();
|
nf << "recdesc/f" << _dir.num();
|
||||||
nf.ext("trr");
|
nf.ext("trr");
|
||||||
{
|
{
|
||||||
_rec.set_des(_descr,_tab.upper());
|
_rec.set_des(_descr,_tab.upper());
|
||||||
@ -280,7 +280,7 @@ void TRec_sheet::edit()
|
|||||||
int nkeys = _rec.keys();
|
int nkeys = _rec.keys();
|
||||||
for (i = 0; i < nkeys; i++) f2.row(i) = _rec.keydef(i);
|
for (i = 0; i < nkeys; i++) f2.row(i) = _rec.keydef(i);
|
||||||
f2.disable_cell(0, 1);
|
f2.disable_cell(0, 1);
|
||||||
while (TRUE)
|
while (true)
|
||||||
{
|
{
|
||||||
f1.force_update(0); // Non togliere, serve per fare l'update della descrizione quando si fa l'import!!
|
f1.force_update(0); // Non togliere, serve per fare l'update della descrizione quando si fa l'import!!
|
||||||
switch (_mask->run())
|
switch (_mask->run())
|
||||||
|
@ -161,7 +161,7 @@ bool TEdit_file::browse_cursor(TCursor& cursor, const TFilename& fname)
|
|||||||
|
|
||||||
bool TEdit_file::browse_file(int logicnum, const TFilename& name, const TString& tab)
|
bool TEdit_file::browse_file(int logicnum, const TFilename& name, const TString& tab)
|
||||||
{
|
{
|
||||||
if (logicnum > 2)
|
if (logicnum >= LF_USER)
|
||||||
{
|
{
|
||||||
TSystemisamfile test(logicnum);
|
TSystemisamfile test(logicnum);
|
||||||
int err = test.open_ex();
|
int err = test.open_ex();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user