Patch level : 10.0 294
Files correlati : ba1.exe ba1400a.msk Ricompilazione Demo : [ ] Commento : 0001288: data scadenza password dell'utente verificato che pur inserendo la PasswordEXpiration in studio.ini e cambiando la password non si visualizzano i dati riguardanti la scadenza password. git-svn-id: svn://10.65.10.50/trunk@18793 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
5cc2b97eea
commit
4686a9ba52
@ -1,7 +1,6 @@
|
|||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include <modaut.h>
|
#include <modaut.h>
|
||||||
#include <msksheet.h>
|
#include <msksheet.h>
|
||||||
#include <prefix.h>
|
|
||||||
#include <relapp.h>
|
#include <relapp.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <tree.h>
|
#include <tree.h>
|
||||||
@ -449,8 +448,7 @@ bool TSet_user_passwd::password_handler(TMask_field& f, KEY key)
|
|||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
TConfig ini(CONFIG_STUDIO, "Main");
|
const int minlen = ini_get_int(CONFIG_STUDIO, "Main", "MinPwdLen", 4);
|
||||||
const int minlen = ini.get_int("MinPwdLen", NULL, -1, 4);
|
|
||||||
if (pwdlen < minlen)
|
if (pwdlen < minlen)
|
||||||
{
|
{
|
||||||
TString msg; msg.format(TR("La password deve essere lunga almeno %d caratteri."), minlen);
|
TString msg; msg.format(TR("La password deve essere lunga almeno %d caratteri."), minlen);
|
||||||
@ -692,17 +690,13 @@ bool TSet_users::user_create()
|
|||||||
|
|
||||||
int TSet_users::read(TMask& m)
|
int TSet_users::read(TMask& m)
|
||||||
{
|
{
|
||||||
TRelation_application::read(m);
|
const int err = TSet_user_passwd::read(m);
|
||||||
const TRectype& r = get_relation()->curr();
|
if (err == NOERR)
|
||||||
build_sheet(&r);
|
{
|
||||||
|
const TRectype& r = get_relation()->curr();
|
||||||
const char* pwd = decode(r.get(USR_PASSWORD));
|
build_tree(&r);
|
||||||
m.set(F_PASSWORD, pwd);
|
}
|
||||||
m.set(F_PROVA, pwd);
|
return err;
|
||||||
|
|
||||||
build_tree(&r);
|
|
||||||
|
|
||||||
return NOERR;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TSet_user_passwd::put_in_record(const TMask& m)
|
void TSet_user_passwd::put_in_record(const TMask& m)
|
||||||
@ -713,7 +707,11 @@ void TSet_user_passwd::put_in_record(const TMask& m)
|
|||||||
{
|
{
|
||||||
r.put(USR_PASSWORD, s);
|
r.put(USR_PASSWORD, s);
|
||||||
if (r.exist(USR_DATAPWD))
|
if (r.exist(USR_DATAPWD))
|
||||||
r.put(USR_DATAPWD, TDate(TODAY));
|
{
|
||||||
|
const TDate oggi(TODAY);
|
||||||
|
((TMask&)m).set(F_DATAPWD, oggi);
|
||||||
|
r.put(USR_DATAPWD, oggi);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -767,14 +765,15 @@ int TSet_user_passwd::rewrite(const TMask& m)
|
|||||||
|
|
||||||
bool TSet_users::remove()
|
bool TSet_users::remove()
|
||||||
{
|
{
|
||||||
|
const TString16 u = get_relation()->curr().get(USR_USERNAME);
|
||||||
const bool ok = TRelation_application::remove();
|
const bool ok = TRelation_application::remove();
|
||||||
if (ok)
|
if (ok && u.full())
|
||||||
{
|
{
|
||||||
TFilename file = firm2dir(-1); // Directory dati
|
TFilename file = firm2dir(-1); // Directory dati
|
||||||
file.add("config"); // Directory configurazioni
|
file.add("config"); // Directory configurazioni
|
||||||
file.add(get_relation()->curr().get(USR_USERNAME)); // Nome utente
|
file.add(u); // Nome utente
|
||||||
file.ext("ini"); // Estensione
|
file.ext("ini"); // Estensione
|
||||||
::remove(file);
|
file.fremove();
|
||||||
}
|
}
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
@ -798,15 +797,28 @@ bool TSet_users::user_destroy()
|
|||||||
|
|
||||||
int TSet_user_passwd::read(TMask& m)
|
int TSet_user_passwd::read(TMask& m)
|
||||||
{
|
{
|
||||||
TRelation_application::read(m);
|
const int err = TRelation_application::read(m);
|
||||||
const TRectype& r = get_relation()->curr();
|
if (err == NOERR)
|
||||||
build_sheet(&r);
|
{
|
||||||
|
const TRectype& r = get_relation()->curr();
|
||||||
const char* pwd = decode(r.get(USR_PASSWORD));
|
build_sheet(&r);
|
||||||
m.set(F_PASSWORD, pwd);
|
|
||||||
m.set(F_PROVA, pwd);
|
const char* pwd = decode(r.get(USR_PASSWORD));
|
||||||
|
m.set(F_PASSWORD, pwd);
|
||||||
return NOERR;
|
m.set(F_PROVA, pwd);
|
||||||
|
|
||||||
|
const int pe = ini_get_int(CONFIG_STUDIO, "Main", "PasswordExpiration");
|
||||||
|
if (pe > 0)
|
||||||
|
{
|
||||||
|
TDate data(m.get(F_DATAPWD));
|
||||||
|
if (data.ok())
|
||||||
|
{
|
||||||
|
data += pe;
|
||||||
|
m.set(F_DATASCAD, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TSet_user_passwd::init_query_mode(TMask& m)
|
void TSet_user_passwd::init_query_mode(TMask& m)
|
||||||
@ -830,16 +842,15 @@ void TSet_user_passwd::init_modify_mode(TMask& m)
|
|||||||
|
|
||||||
int ba1400(int argc, char** argv)
|
int ba1400(int argc, char** argv)
|
||||||
{
|
{
|
||||||
const char* const title = TR("Configurazione utenti");
|
|
||||||
if (user() == ::dongle().administrator())
|
if (user() == ::dongle().administrator())
|
||||||
{
|
{
|
||||||
TSet_users a;
|
TSet_users a;
|
||||||
a.run(argc, argv, title);
|
a.run(argc, argv, TR("Configurazione utenti"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TSet_user_passwd a;
|
TSet_user_passwd a;
|
||||||
a.run(argc, argv, title);
|
a.run(argc, argv, TR("Configurazione utente"));
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ TOOLBAR "" 0 0 0 2
|
|||||||
#include <relapbar.h>
|
#include <relapbar.h>
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
PAGE "Gestione utenti" -1 -1 35 7
|
PAGE "Gestione utenti" 0 2 0 0
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 78 5
|
GROUPBOX DLG_NULL 78 5
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -108,7 +108,7 @@ END
|
|||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
PAGE "Permessi" -1 -1 78 20
|
PAGE "Permessi" 0 2 0 0
|
||||||
|
|
||||||
TREE F_PERMESSI -3 -8
|
TREE F_PERMESSI -3 -8
|
||||||
BEGIN
|
BEGIN
|
||||||
|
Loading…
x
Reference in New Issue
Block a user