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;
|
||||
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 AddRight(idUser: Integer; ItemRight: TObject; FullPath: Boolean = True); overload;
|
||||
@ -86,6 +90,7 @@ type
|
||||
FDataModule : IDataModuleUsuarios;
|
||||
FUserControl: TUserControl;
|
||||
FCurrentUser : IBizUsuario;
|
||||
FUsarPasswordsSeguras : Boolean;
|
||||
|
||||
function GetMaxIntentosLogin: Integer;
|
||||
procedure SetMaxIntentosLogin(const Value: Integer);
|
||||
@ -109,6 +114,9 @@ type
|
||||
|
||||
function GetCriptografia : TUCCriptografia;
|
||||
function CambiarPassword(const AIDUser: Integer; const ANewPassword: String): Boolean; overload;
|
||||
|
||||
function GetUsarPasswordsSeguras: Boolean;
|
||||
procedure SetUsarPasswordsSeguras(const Value: Boolean);
|
||||
public
|
||||
constructor Create; virtual;
|
||||
destructor Destroy; override;
|
||||
@ -153,6 +161,7 @@ type
|
||||
function ValidarPassword(const APassword : string; const ALogin : String;
|
||||
const ANombre: String; out AMsg : String): boolean;
|
||||
|
||||
property UsarPasswordsSeguras : Boolean read GetUsarPasswordsSeguras write SetUsarPasswordsSeguras;
|
||||
property UserControl : TUserControl read FUserControl;
|
||||
property MaxIntentosLogin : Integer read GetMaxIntentosLogin write SetMaxIntentosLogin;
|
||||
property CurrentUser: IBizUsuario read GetCurrentUser;
|
||||
@ -343,6 +352,7 @@ begin
|
||||
AsignarDataModule;
|
||||
FCurrentUser := NIL;
|
||||
FUserControl := TUserControl.Create(nil);
|
||||
FUsarPasswordsSeguras := False;
|
||||
InicializarUserControl;
|
||||
end;
|
||||
|
||||
@ -500,6 +510,11 @@ begin
|
||||
Result := FUserControl.Login.MaxLoginAttempts;
|
||||
end;
|
||||
|
||||
function TUsuariosController.GetUsarPasswordsSeguras: Boolean;
|
||||
begin
|
||||
Result := FUsarPasswordsSeguras;
|
||||
end;
|
||||
|
||||
function TUsuariosController.GuardarPerfil(APerfil: IBizPerfilUsuario): Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
@ -661,6 +676,11 @@ begin
|
||||
FUserControl.Login.MaxLoginAttempts := Value;
|
||||
end;
|
||||
|
||||
procedure TUsuariosController.SetUsarPasswordsSeguras(const Value: Boolean);
|
||||
begin
|
||||
FUsarPasswordsSeguras := Value;
|
||||
end;
|
||||
|
||||
procedure TUsuariosController._ShowChangePassword;
|
||||
begin
|
||||
FUserControl.ShowChangePassword;
|
||||
@ -687,7 +707,7 @@ begin
|
||||
if (Length(Trim(APassword)) < FUserControl.UserPasswordChange.MinPasswordLength) then
|
||||
AMsg := Format(FUserControl.UserSettings.CommonMessages.ChangePasswordError.MinPasswordLength, [FUserControl.UserPasswordChange.MinPasswordLength])
|
||||
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
|
||||
else
|
||||
Result := true;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
inherited DataModuleUsuarios: TDataModuleUsuarios
|
||||
OnCreate = DataModuleCreate
|
||||
Height = 284
|
||||
Width = 468
|
||||
Height = 215
|
||||
Width = 331
|
||||
object srvUsuarios: TRORemoteService
|
||||
Message = dmConexion.ROMessage
|
||||
Channel = dmConexion.ROChannel
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
inherited fEditorUsuario: TfEditorUsuario
|
||||
Caption = 'fEditorUsuario'
|
||||
ExplicitWidth = 320
|
||||
ExplicitHeight = 240
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
inherited TBXDock: TTBXDock
|
||||
|
||||
@ -127,7 +127,6 @@ var
|
||||
AContinuar : Boolean;
|
||||
begin
|
||||
inherited;
|
||||
AContinuar := False;
|
||||
if FUsuario.EsNuevo then
|
||||
begin
|
||||
if (frViewUsuario1.ePassword.Text <> frViewUsuario1.eConfirmarPassword.Text) then
|
||||
|
||||
Loading…
Reference in New Issue
Block a user