VERSION 5.00
Begin VB.Form FSEGURIDAD 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Seguridad - Módulo de Cuentas por Cobrar"
   ClientHeight    =   2775
   ClientLeft      =   5610
   ClientTop       =   4275
   ClientWidth     =   4350
   Icon            =   "FSEGURIDAD.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2775
   ScaleWidth      =   4350
   StartUpPosition =   1  'CenterOwner
   Begin VB.CommandButton CMD_ACEPTAR 
      Caption         =   "Aceptar"
      Default         =   -1  'True
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   855
      Left            =   135
      Picture         =   "FSEGURIDAD.frx":0442
      Style           =   1  'Graphical
      TabIndex        =   2
      Tag             =   "R ASDASD"
      Top             =   1800
      Width           =   1815
   End
   Begin VB.CommandButton CMD_CANCELAR 
      Cancel          =   -1  'True
      Caption         =   "Cancelar"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   855
      Left            =   2280
      Picture         =   "FSEGURIDAD.frx":074C
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   1800
      Width           =   1935
   End
   Begin VB.TextBox txt_password 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   1680
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   960
      Width           =   2295
   End
   Begin VB.TextBox txt_usuario 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1680
      TabIndex        =   0
      Top             =   240
      Width           =   2295
   End
   Begin VB.Label Label2 
      Caption         =   "Password:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   360
      TabIndex        =   5
      Top             =   960
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "Usuario:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   600
      TabIndex        =   4
      Top             =   360
      Width           =   975
   End
End
Attribute VB_Name = "FSEGURIDAD"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim mobj_cseguridad As DB_SE_MANTENIMIENTOS.c_seguridad
Dim MStrusuario As String
Dim MintIntentos As Integer

Private Sub CMD_ACEPTAR_Click()
Set mobj_cseguridad = New DB_SE_MANTENIMIENTOS.c_seguridad
Dim qwerty As String
Dim ytrewq As String
Dim cadena As String
Dim clave As String
Dim validar As Integer

qwerty = UCase(Trim(txt_usuario.Text))
ytrewq = Trim(Encrip(Trim(UCase(txt_password.Text))))

If Len(qwerty) = 0 Then
    MsgBox ("Debe ingresar un usuario"), vbDefaultButton1 + vbExclamation, "Advertencia"
    txt_usuario.SetFocus
    Exit Sub
End If
If Len(ytrewq) = 0 Then
    MsgBox ("Debe ingresar un password"), vbDefaultButton1 + vbExclamation, "Advertencia"
    txt_password.SetFocus
    Exit Sub
End If
validar = mobj_cseguridad.ValidarUsuario(qwerty, ytrewq)
Call MENSAJES_USUARIO(validar)

If validar = 0 Then
    GCUSERID = qwerty
    Verifica_dias_Venc GCUSERID, Trim(UCase(txt_password.Text))
    MDIFCcobrar.Show
    Unload Me
Else
    If validar = 2 Then
        If Trim(MStrusuario) = Empty Then
            MStrusuario = UCase(txt_usuario.Text)
            MintIntentos = MintIntentos + 1
        Else
            If Trim(MStrusuario) = UCase(txt_usuario.Text) Then
               MintIntentos = MintIntentos + 1
               If MintIntentos = 3 Then
                  If Trim(qwerty) <> "SYSADMIN" Then
                    GBloquearUsuario qwerty
                  End If
                  
                  MStrusuario = Empty
                  MintIntentos = 0
               End If
            Else
               MStrusuario = Empty
               MintIntentos = 0
            End If
        End If
    End If
End If



End Sub

Private Sub CMD_CANCELAR_Click()
    End
End Sub



