diff --git a/Source/ApplicationBase/Usuarios/Controller/uUsuariosController.pas b/Source/ApplicationBase/Usuarios/Controller/uUsuariosController.pas index 6f4e9b02..98c01024 100644 --- a/Source/ApplicationBase/Usuarios/Controller/uUsuariosController.pas +++ b/Source/ApplicationBase/Usuarios/Controller/uUsuariosController.pas @@ -100,7 +100,6 @@ type procedure AsignarDataModule; procedure InicializarUserControl; - procedure ComprobarUsuarioInicial; function GetCurrentUser: IBizUsuario; function AnadirUsuario(AUser : IBizUsuario): Boolean; @@ -333,20 +332,19 @@ function TUsuariosController.ComprobarUsuario(const User, Password: String): Boolean; begin Result := FUserControl.VerificaLogin(User, Password); - if not Result then - begin - ComprobarUsuarioInicial; - Result := ComprobarUsuario(User, Password); + if not Result then + begin + if User = 'admin' then + begin + if not FUserControl.ExisteUsuario('admin') then + begin + FUserControl.AddUser('admin', '1', 'Administrador', 'admin@correo.net', 0, 0 , 30, True); + Result := ComprobarUsuario(User, Password); + end; + end; end; end; -procedure TUsuariosController.ComprobarUsuarioInicial; -begin - // Para que haya un usuario siempre en la BD - if not FUserControl.ExisteUsuario('admin') then - FUserControl.AddUser('admin', '1', 'Administrador', 'admin@correo.net', 0, 0 , 30, True); -end; - constructor TUsuariosController.Create; begin AsignarDataModule;