Usuarios: permitir contraseñas no seguras.
git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@270 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
parent
da8de64743
commit
138165a5d8
@ -63,6 +63,10 @@ type
|
|||||||
function GetCriptografia : TUCCriptografia;
|
function GetCriptografia : TUCCriptografia;
|
||||||
property Criptografia: TUCCriptografia read GetCriptografia;
|
property Criptografia: TUCCriptografia read GetCriptografia;
|
||||||
|
|
||||||
|
function GetUsarPasswordsSeguras: Boolean;
|
||||||
|
procedure SetUsarPasswordsSeguras(const Value: Boolean);
|
||||||
|
property UsarPasswordsSeguras : Boolean read GetUsarPasswordsSeguras write SetUsarPasswordsSeguras;
|
||||||
|
|
||||||
{
|
{
|
||||||
procedure ChangePassword(IDUser: Integer; NewPassword: String);
|
procedure ChangePassword(IDUser: Integer; NewPassword: String);
|
||||||
procedure AddRight(idUser: Integer; ItemRight: TObject; FullPath: Boolean = True); overload;
|
procedure AddRight(idUser: Integer; ItemRight: TObject; FullPath: Boolean = True); overload;
|
||||||
@ -86,6 +90,7 @@ type
|
|||||||
FDataModule : IDataModuleUsuarios;
|
FDataModule : IDataModuleUsuarios;
|
||||||
FUserControl: TUserControl;
|
FUserControl: TUserControl;
|
||||||
FCurrentUser : IBizUsuario;
|
FCurrentUser : IBizUsuario;
|
||||||
|
FUsarPasswordsSeguras : Boolean;
|
||||||
|
|
||||||
function GetMaxIntentosLogin: Integer;
|
function GetMaxIntentosLogin: Integer;
|
||||||
procedure SetMaxIntentosLogin(const Value: Integer);
|
procedure SetMaxIntentosLogin(const Value: Integer);
|
||||||
@ -109,6 +114,9 @@ type
|
|||||||
|
|
||||||
function GetCriptografia : TUCCriptografia;
|
function GetCriptografia : TUCCriptografia;
|
||||||
function CambiarPassword(const AIDUser: Integer; const ANewPassword: String): Boolean; overload;
|
function CambiarPassword(const AIDUser: Integer; const ANewPassword: String): Boolean; overload;
|
||||||
|
|
||||||
|
function GetUsarPasswordsSeguras: Boolean;
|
||||||
|
procedure SetUsarPasswordsSeguras(const Value: Boolean);
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -153,6 +161,7 @@ type
|
|||||||
function ValidarPassword(const APassword : string; const ALogin : String;
|
function ValidarPassword(const APassword : string; const ALogin : String;
|
||||||
const ANombre: String; out AMsg : String): boolean;
|
const ANombre: String; out AMsg : String): boolean;
|
||||||
|
|
||||||
|
property UsarPasswordsSeguras : Boolean read GetUsarPasswordsSeguras write SetUsarPasswordsSeguras;
|
||||||
property UserControl : TUserControl read FUserControl;
|
property UserControl : TUserControl read FUserControl;
|
||||||
property MaxIntentosLogin : Integer read GetMaxIntentosLogin write SetMaxIntentosLogin;
|
property MaxIntentosLogin : Integer read GetMaxIntentosLogin write SetMaxIntentosLogin;
|
||||||
property CurrentUser: IBizUsuario read GetCurrentUser;
|
property CurrentUser: IBizUsuario read GetCurrentUser;
|
||||||
@ -343,6 +352,7 @@ begin
|
|||||||
AsignarDataModule;
|
AsignarDataModule;
|
||||||
FCurrentUser := NIL;
|
FCurrentUser := NIL;
|
||||||
FUserControl := TUserControl.Create(nil);
|
FUserControl := TUserControl.Create(nil);
|
||||||
|
FUsarPasswordsSeguras := False;
|
||||||
InicializarUserControl;
|
InicializarUserControl;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -500,6 +510,11 @@ begin
|
|||||||
Result := FUserControl.Login.MaxLoginAttempts;
|
Result := FUserControl.Login.MaxLoginAttempts;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TUsuariosController.GetUsarPasswordsSeguras: Boolean;
|
||||||
|
begin
|
||||||
|
Result := FUsarPasswordsSeguras;
|
||||||
|
end;
|
||||||
|
|
||||||
function TUsuariosController.GuardarPerfil(APerfil: IBizPerfilUsuario): Boolean;
|
function TUsuariosController.GuardarPerfil(APerfil: IBizPerfilUsuario): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
@ -661,6 +676,11 @@ begin
|
|||||||
FUserControl.Login.MaxLoginAttempts := Value;
|
FUserControl.Login.MaxLoginAttempts := Value;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TUsuariosController.SetUsarPasswordsSeguras(const Value: Boolean);
|
||||||
|
begin
|
||||||
|
FUsarPasswordsSeguras := Value;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TUsuariosController._ShowChangePassword;
|
procedure TUsuariosController._ShowChangePassword;
|
||||||
begin
|
begin
|
||||||
FUserControl.ShowChangePassword;
|
FUserControl.ShowChangePassword;
|
||||||
@ -687,7 +707,7 @@ begin
|
|||||||
if (Length(Trim(APassword)) < FUserControl.UserPasswordChange.MinPasswordLength) then
|
if (Length(Trim(APassword)) < FUserControl.UserPasswordChange.MinPasswordLength) then
|
||||||
AMsg := Format(FUserControl.UserSettings.CommonMessages.ChangePasswordError.MinPasswordLength, [FUserControl.UserPasswordChange.MinPasswordLength])
|
AMsg := Format(FUserControl.UserSettings.CommonMessages.ChangePasswordError.MinPasswordLength, [FUserControl.UserPasswordChange.MinPasswordLength])
|
||||||
else
|
else
|
||||||
if Pos(LowerCase(APassword), 'abcdeasdfqwerzxcv1234567890321654987test' + LowerCase(ALogin) + LowerCase(AMsg)) > 0 then
|
if FUsarPasswordsSeguras and (Pos(LowerCase(APassword), 'abcdeasdfqwerzxcv1234567890321654987test' + LowerCase(ALogin) + LowerCase(AMsg)) > 0) then
|
||||||
AMsg := FUserControl.UserSettings.CommonMessages.ChangePasswordError.InvalidNewPassword
|
AMsg := FUserControl.UserSettings.CommonMessages.ChangePasswordError.InvalidNewPassword
|
||||||
else
|
else
|
||||||
Result := true;
|
Result := true;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
inherited DataModuleUsuarios: TDataModuleUsuarios
|
inherited DataModuleUsuarios: TDataModuleUsuarios
|
||||||
OnCreate = DataModuleCreate
|
OnCreate = DataModuleCreate
|
||||||
Height = 284
|
Height = 215
|
||||||
Width = 468
|
Width = 331
|
||||||
object srvUsuarios: TRORemoteService
|
object srvUsuarios: TRORemoteService
|
||||||
Message = dmConexion.ROMessage
|
Message = dmConexion.ROMessage
|
||||||
Channel = dmConexion.ROChannel
|
Channel = dmConexion.ROChannel
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
inherited fEditorUsuario: TfEditorUsuario
|
inherited fEditorUsuario: TfEditorUsuario
|
||||||
Caption = 'fEditorUsuario'
|
Caption = 'fEditorUsuario'
|
||||||
|
ExplicitWidth = 320
|
||||||
|
ExplicitHeight = 240
|
||||||
PixelsPerInch = 96
|
PixelsPerInch = 96
|
||||||
TextHeight = 13
|
TextHeight = 13
|
||||||
inherited TBXDock: TTBXDock
|
inherited TBXDock: TTBXDock
|
||||||
|
|||||||
@ -127,7 +127,6 @@ var
|
|||||||
AContinuar : Boolean;
|
AContinuar : Boolean;
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
AContinuar := False;
|
|
||||||
if FUsuario.EsNuevo then
|
if FUsuario.EsNuevo then
|
||||||
begin
|
begin
|
||||||
if (frViewUsuario1.ePassword.Text <> frViewUsuario1.eConfirmarPassword.Text) then
|
if (frViewUsuario1.ePassword.Text <> frViewUsuario1.eConfirmarPassword.Text) then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user