-- cambio de clase de validación de usuario
This commit is contained in:
@@ -115,7 +115,7 @@ Public Class WSGPSApp
|
||||
<WebMethod>
|
||||
Public Function Login(params As String) As String
|
||||
Dim Retorno As String = ""
|
||||
Dim ObjUsuarios As New ClsSisUsuarios
|
||||
Dim ObjUsuarios As New ClsSisUsuarioAutenticacion
|
||||
Try
|
||||
Dim json = Decripta(params, "AES")
|
||||
Dim Datos As MWSLogin2 = JsonConvert.DeserializeObject(Of MWSLogin2)(json)
|
||||
@@ -137,8 +137,8 @@ Public Class WSGPSApp
|
||||
Dim UsuariosModulos As New List(Of WsModulos)
|
||||
Dim Empresas As New List(Of WsEmpresa)
|
||||
Dim Clientes As New List(Of WsClientePortalGPS)
|
||||
|
||||
If ObjUsuarios.GetUsuariosModulos(UsuarioRetorno.CveUsuario, -1) Then
|
||||
Dim objUsr As New ClsSisUsuarios(UsuarioActual:=UsuarioActual)
|
||||
If objUsr.GetUsuariosModulos(UsuarioRetorno.CveUsuario, -1) Then
|
||||
Dim DtModulos As DataTable = ObjUsuarios.DtResultados.FiltraParametros("CvePlataforma = 5 AND Permitir = 1")
|
||||
For Each Row As DataRow In DtModulos.Rows
|
||||
UsuariosModulos.Add(New WsModulos With {.CveModulo = Row("CveModulo").ToString.ToEntero, .CvePadre = Row("CvePadre").ToString.ToEntero, .CvePlataforma = 5, .Estilo = Row("Estilo").ToString, .Liga = Row("Liga").ToString, .Modulo = Row("Modulo").ToString, .Parametros = Row("Parametros").ToString})
|
||||
@@ -146,6 +146,7 @@ Public Class WSGPSApp
|
||||
DtModulos.Dispose()
|
||||
DtModulos = Nothing
|
||||
End If
|
||||
objUsr.Dispose()
|
||||
UsuarioRetorno.Modulos = UsuariosModulos
|
||||
Dim DtClientes As DataTable = GlobalDTUsuarios(UsuarioActual.CveUsuario).FiltraParametros("CvePlataforma = 3 AND CveCliente IS NOT NULL", "Empresa")
|
||||
If DtClientes IsNot Nothing Then
|
||||
@@ -185,96 +186,97 @@ Public Class WSGPSApp
|
||||
|
||||
End Function
|
||||
'<SoapHeader("Credentials")>
|
||||
<WebMethod>
|
||||
Public Function Login2(params As String) As String
|
||||
Dim Retorno As String = ""
|
||||
Dim ObjUsuarios As New ClsSisUsuarios
|
||||
Try
|
||||
Dim json = Decripta(params, "AES")
|
||||
Dim Datos As MWSLogin2 = JsonConvert.DeserializeObject(Of MWSLogin2)(json)
|
||||
Dim UsuarioActual = ObjUsuarios.ValidaUsuario(Decripta(Datos.Usuario, "AES"), Encripta(Decripta(Datos.Contraseña, "AES")))
|
||||
'<WebMethod>
|
||||
'Public Function Login2(params As String) As String
|
||||
' Dim Retorno As String = ""
|
||||
' Dim ObjUsuarios As New ClsSisUsuarioAutenticacion
|
||||
' Try
|
||||
' Dim json = Decripta(params, "AES")
|
||||
' Dim Datos As MWSLogin2 = JsonConvert.DeserializeObject(Of MWSLogin2)(json)
|
||||
' Dim UsuarioActual = ObjUsuarios.ValidaUsuario(Decripta(Datos.Usuario, "AES"), Encripta(Decripta(Datos.Contraseña, "AES")))
|
||||
|
||||
If UsuarioActual IsNot Nothing Then
|
||||
Dim UsuarioRetorno As New WSUSER2
|
||||
UsuarioRetorno.CveUsuario = UsuarioActual.CveUsuario
|
||||
UsuarioRetorno.CveEmpresa = UsuarioActual.CveEmpresa
|
||||
UsuarioRetorno.CveCliente = UsuarioActual.CveCliente
|
||||
UsuarioRetorno.Usuario = UsuarioActual.Usuario
|
||||
UsuarioRetorno.Nombre = UsuarioActual.Nombre
|
||||
UsuarioRetorno.CveRol = UsuarioActual.CveRol
|
||||
UsuarioRetorno.Rol = UsuarioActual.Rol
|
||||
UsuarioRetorno.Contrasenia = UsuarioActual.Contraseña
|
||||
UsuarioRetorno.CveSubProyecto = UsuarioActual.CveSubProyecto
|
||||
UsuarioRetorno.Procesos = UsuarioActual.Procesos.Values.Cast(Of String).ToList()
|
||||
' If UsuarioActual IsNot Nothing Then
|
||||
' Dim UsuarioRetorno As New WSUSER2
|
||||
' UsuarioRetorno.CveUsuario = UsuarioActual.CveUsuario
|
||||
' UsuarioRetorno.CveEmpresa = UsuarioActual.CveEmpresa
|
||||
' UsuarioRetorno.CveCliente = UsuarioActual.CveCliente
|
||||
' UsuarioRetorno.Usuario = UsuarioActual.Usuario
|
||||
' UsuarioRetorno.Nombre = UsuarioActual.Nombre
|
||||
' UsuarioRetorno.CveRol = UsuarioActual.CveRol
|
||||
' UsuarioRetorno.Rol = UsuarioActual.Rol
|
||||
' UsuarioRetorno.Contrasenia = UsuarioActual.Contraseña
|
||||
' UsuarioRetorno.CveSubProyecto = UsuarioActual.CveSubProyecto
|
||||
' UsuarioRetorno.Procesos = UsuarioActual.Procesos.Values.Cast(Of String).ToList()
|
||||
|
||||
Dim UsuariosModulos As New List(Of WsModulos)
|
||||
Dim Empresas As New List(Of WsEmpresa)
|
||||
Dim Clientes As New List(Of WsClientePortalGPS)
|
||||
' Dim UsuariosModulos As New List(Of WsModulos)
|
||||
' Dim Empresas As New List(Of WsEmpresa)
|
||||
' Dim Clientes As New List(Of WsClientePortalGPS)
|
||||
|
||||
If ObjUsuarios.GetUsuariosModulos(UsuarioRetorno.CveUsuario, -1) Then
|
||||
Dim DtModulos As DataTable = ObjUsuarios.DtResultados.FiltraParametros("CvePlataforma = 5 AND Permitir = 1")
|
||||
For Each Row As DataRow In DtModulos.Rows
|
||||
UsuariosModulos.Add(New WsModulos With {.CveModulo = Row("CveModulo").ToString.ToEntero, .CvePadre = Row("CvePadre").ToString.ToEntero, .CvePlataforma = 5, .Estilo = Row("Estilo").ToString, .Liga = Row("Liga").ToString, .Modulo = Row("Modulo").ToString, .Parametros = Row("Parametros").ToString})
|
||||
Next
|
||||
DtModulos.Dispose()
|
||||
DtModulos = Nothing
|
||||
End If
|
||||
' Dim objUsr As New ClsSisUsuarios(UsuarioActual:=UsuarioActual)
|
||||
' If objUsr.GetUsuariosModulos(UsuarioRetorno.CveUsuario, -1) Then
|
||||
' Dim DtModulos As DataTable = ObjUsuarios.DtResultados.FiltraParametros("CvePlataforma = 5 AND Permitir = 1")
|
||||
' For Each Row As DataRow In DtModulos.Rows
|
||||
' UsuariosModulos.Add(New WsModulos With {.CveModulo = Row("CveModulo").ToString.ToEntero, .CvePadre = Row("CvePadre").ToString.ToEntero, .CvePlataforma = 5, .Estilo = Row("Estilo").ToString, .Liga = Row("Liga").ToString, .Modulo = Row("Modulo").ToString, .Parametros = Row("Parametros").ToString})
|
||||
' Next
|
||||
' DtModulos.Dispose()
|
||||
' DtModulos = Nothing
|
||||
' End If
|
||||
' objUsr.Dispose()
|
||||
' UsuarioRetorno.Modulos = UsuariosModulos
|
||||
' Dim DtClientes As DataTable = GlobalDTUsuarios(UsuarioActual.CveUsuario).FiltraParametros("CvePlataforma = 3 AND CveCliente > 0", "Empresa")
|
||||
' If DtClientes IsNot Nothing Then
|
||||
' If DtClientes.Rows.Count > 0 Then
|
||||
' For Each Row As DataRow In DtClientes.Rows
|
||||
' Clientes.Add(New WsClientePortalGPS With {.CveCliente = Row("CveCliente").ToString.ToEntero, .Cliente = Row("Cliente").ToString})
|
||||
' Next
|
||||
' If UsuarioActual.CveCliente <= 0 AndAlso Clientes.Any() Then
|
||||
' UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
|
||||
' If UsuarioActual.CveCliente <= 0 AndAlso Clientes.Any() Then
|
||||
' UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
|
||||
' If UsuarioRetorno.CveCliente > 0 Then
|
||||
' CreaObjetoEmpresa(UsuarioActual)
|
||||
' If UsuarioActual.Empresa.Funcionalidad(704).Contiene(UsuarioRetorno.CveCliente.ToString()) OrElse UsuarioActual.CveUsuario = 3612 Then
|
||||
' UsuarioRetorno.RastreoSoloInicio = True
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
UsuarioRetorno.Modulos = UsuariosModulos
|
||||
Dim DtClientes As DataTable = GlobalDTUsuarios(UsuarioActual.CveUsuario).FiltraParametros("CvePlataforma = 3 AND CveCliente > 0", "Empresa")
|
||||
If DtClientes IsNot Nothing Then
|
||||
If DtClientes.Rows.Count > 0 Then
|
||||
For Each Row As DataRow In DtClientes.Rows
|
||||
Clientes.Add(New WsClientePortalGPS With {.CveCliente = Row("CveCliente").ToString.ToEntero, .Cliente = Row("Cliente").ToString})
|
||||
Next
|
||||
If UsuarioActual.CveCliente <= 0 AndAlso Clientes.Any() Then
|
||||
UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
|
||||
If UsuarioActual.CveCliente <= 0 AndAlso Clientes.Any() Then
|
||||
UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
|
||||
If UsuarioRetorno.CveCliente > 0 Then
|
||||
CreaObjetoEmpresa(UsuarioActual)
|
||||
If UsuarioActual.Empresa.Funcionalidad(704).Contiene(UsuarioRetorno.CveCliente.ToString()) OrElse UsuarioActual.CveUsuario = 3612 Then
|
||||
UsuarioRetorno.RastreoSoloInicio = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' 'MARCA PARA EL RASTREO SOLO INICIO
|
||||
' If UsuarioRetorno.CveUsuario = 3612 Then
|
||||
' UsuarioRetorno.RastreoSoloInicio = True
|
||||
' End If
|
||||
|
||||
'MARCA PARA EL RASTREO SOLO INICIO
|
||||
If UsuarioRetorno.CveUsuario = 3612 Then
|
||||
UsuarioRetorno.RastreoSoloInicio = True
|
||||
End If
|
||||
' UsuarioRetorno.Clientes = Clientes
|
||||
' DtClientes.Dispose()
|
||||
' DtClientes = Nothing
|
||||
' Retorno = Encripta(JsonConvert.SerializeObject(UsuarioRetorno), "AES")
|
||||
' Else
|
||||
' Dim UsuarioError As New WSUSER2
|
||||
' UsuarioError.CveUsuario = -2
|
||||
' UsuarioError.CveEmpresa = -1
|
||||
' UsuarioError.CveCliente = -1
|
||||
' UsuarioError.Usuario = ""
|
||||
' UsuarioError.Nombre = ""
|
||||
' UsuarioError.CveRol = -1
|
||||
' UsuarioError.Rol = ""
|
||||
' UsuarioError.Contrasenia = ""
|
||||
' UsuarioError.CveSubProyecto = -1
|
||||
|
||||
UsuarioRetorno.Clientes = Clientes
|
||||
DtClientes.Dispose()
|
||||
DtClientes = Nothing
|
||||
Retorno = Encripta(JsonConvert.SerializeObject(UsuarioRetorno), "AES")
|
||||
Else
|
||||
Dim UsuarioError As New WSUSER2
|
||||
UsuarioError.CveUsuario = -2
|
||||
UsuarioError.CveEmpresa = -1
|
||||
UsuarioError.CveCliente = -1
|
||||
UsuarioError.Usuario = ""
|
||||
UsuarioError.Nombre = ""
|
||||
UsuarioError.CveRol = -1
|
||||
UsuarioError.Rol = ""
|
||||
UsuarioError.Contrasenia = ""
|
||||
UsuarioError.CveSubProyecto = -1
|
||||
' Retorno = Encripta(JsonConvert.SerializeObject(UsuarioError), "AES")
|
||||
' End If
|
||||
|
||||
Retorno = Encripta(JsonConvert.SerializeObject(UsuarioError), "AES")
|
||||
End If
|
||||
' Catch ex As Exception
|
||||
' Retorno = ""
|
||||
' OnError("Ocurrio un error al iniciar sesion.", ex)
|
||||
' Finally
|
||||
' ObjUsuarios.Dispose()
|
||||
' End Try
|
||||
' Return Retorno
|
||||
|
||||
Catch ex As Exception
|
||||
Retorno = ""
|
||||
OnError("Ocurrio un error al iniciar sesion.", ex)
|
||||
Finally
|
||||
ObjUsuarios.Dispose()
|
||||
End Try
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
'End Function
|
||||
<WebMethod>
|
||||
Public Function GetPosicionesEquipos(strParams As String) As String
|
||||
Dim json = "[]"
|
||||
|
||||
Reference in New Issue
Block a user