Controlla che non ci sia nessun altro utente prima di fare il backup

git-svn-id: svn://10.65.10.50/trunk@1428 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1995-06-01 15:21:50 +00:00
parent 58e761ff5e
commit fff8032baa
2 changed files with 21 additions and 4 deletions

View File

@ -6,7 +6,7 @@
#include <applicat.h>
#include <colors.h>
#include <config.h>
#include <date.h>
#include <isam.h>
#include <mask.h>
#include <prefix.h>
#include <progind.h>
@ -431,8 +431,26 @@ public:
bool TArchive_app::create()
{
TApplication::create();
dispatch_e_menu(BAR_ITEM(1));
return TRUE;
bool ok = TRUE;
TIsamfile utenti(LF_USER, FALSE);
utenti.open(_excllock);
for (int err = utenti.first(); err == NOERR; err = utenti.next())
{
const TString16 u = utenti.get("USERNAME");
if (u != user() && utenti.get_bool("CONNECTED"))
{
ok = error_box("L'archiviazione non puo' essere effettuata\n"
"se ci sono altri utenti collegati: %s", (const char*)u);
}
}
utenti.close();
if (ok)
dispatch_e_menu(BAR_ITEM(1));
return ok;
}

View File

@ -530,7 +530,6 @@ void TAnaprint_app::set_scheda_socio()
else
{
anaf = new TLocalisamfile(LF_ANAGFIS);
anaf->read();
}
anaf->zero();