Patch level : 12.00 1360

Files correlati     : cg0.exe cg1.exe cg1300l.msk ba1400a.msk f2.dir f2.trr

Commento:
Aggiunto il flag  OnlyOnePaIV nel paragrafo cg ddi ditta.ini per bloccare l'inserimento dei clienti/fornitori per gli utenti che non sono supervisori.
Risistemato il controllo clienti/fornitori.
Aggiuto caampo supervisore agli utenti.
This commit is contained in:
Alessandro Bonazzi 2024-10-09 11:00:19 +02:00
parent 05559dc539
commit 78d653577a
3 changed files with 16 additions and 0 deletions

View File

@ -7,3 +7,4 @@
#define USR_AUTSTR "AUTSTR" #define USR_AUTSTR "AUTSTR"
#define USR_PERMISSION "PERMISSION" #define USR_PERMISSION "PERMISSION"
#define USR_CONNECTED "CONNECTED" #define USR_CONNECTED "CONNECTED"
#define USR_SUPERVISOR "SUPERVISOR"

View File

@ -6,6 +6,7 @@
#include <mask.h> #include <mask.h>
#include <msksheet.h> #include <msksheet.h>
#include <progind.h> #include <progind.h>
#include <user.h>
#include <utility.h> #include <utility.h>
#include <config.h> #include <config.h>
#include "../cg/cfban.h" #include "../cg/cfban.h"
@ -763,6 +764,18 @@ long daytime()
return timeloc->tm_sec + timeloc->tm_min * 100L + timeloc->tm_hour * 10000L; return timeloc->tm_sec + timeloc->tm_min * 100L + timeloc->tm_hour * 10000L;
} }
// @func Ritorna se l'utente attuale è un supervisore
bool supervisor()
{
if (admin())
return true;
const TString & u = user();
const TRectype & recuser = cache().get(LF_USER, u);
return recuser.get_bool(USR_SUPERVISOR);
}
// DON'T cache this bool because hostname can be local or server // DON'T cache this bool because hostname can be local or server
static bool is_sirio_station(const char* hostname) static bool is_sirio_station(const char* hostname)
{ {

View File

@ -97,6 +97,8 @@ const char* unesc(const char* str); // Trasforma i caratteri '\n' nella sequenza
istream& eatwhite (istream& i); istream& eatwhite (istream& i);
bool supervisor();
const TString& get_hostname(); const TString& get_hostname();
bool is_debug_station(); bool is_debug_station();
bool is_power_station(); bool is_power_station();