VERSION 5.00
Begin VB.Form FCambioClave 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Cambio de Clave"
   ClientHeight    =   4845
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6750
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4845
   ScaleWidth      =   6750
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdaceptar 
      Caption         =   "Aceptar"
      Height          =   375
      Left            =   1200
      TabIndex        =   4
      Top             =   4200
      Width           =   1455
   End
   Begin VB.CommandButton cmdcancelar 
      Cancel          =   -1  'True
      Caption         =   "Cancelar"
      Height          =   375
      Left            =   3840
      TabIndex        =   5
      Top             =   4200
      Width           =   1455
   End
   Begin VB.Frame Frame1 
      Height          =   3975
      Left            =   120
      TabIndex        =   0
      Top             =   0
      Width           =   6495
      Begin VB.TextBox Txtpassant 
         Height          =   375
         IMEMode         =   3  'DISABLE
         Left            =   1680
         PasswordChar    =   "*"
         TabIndex        =   1
         Top             =   2160
         Width           =   1815
      End
      Begin VB.TextBox Txtnuevopass 
         Height          =   375
         IMEMode         =   3  'DISABLE
         Left            =   1680
         PasswordChar    =   "*"
         TabIndex        =   2
         Top             =   2640
         Width           =   1815
      End
      Begin VB.TextBox Txtreppass 
         Height          =   375
         IMEMode         =   3  'DISABLE
         Left            =   1680
         PasswordChar    =   "*"
         TabIndex        =   3
         Top             =   3120
         Width           =   1815
      End
      Begin VB.Label lblbmensaje 
         Appearance      =   0  'Flat
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   1575
         Left            =   120
         TabIndex        =   9
         Top             =   240
         Width           =   6255
      End
      Begin VB.Label Label1 
         Caption         =   "Password Anterior"
         Height          =   255
         Left            =   240
         TabIndex        =   8
         Top             =   2160
         Width           =   1335
      End
      Begin VB.Label Label2 
         Caption         =   "Nuevo Password"
         Height          =   255
         Left            =   240
         TabIndex        =   7
         Top             =   2640
         Width           =   1455
      End
      Begin VB.Label Label3 
         Caption         =   "Repetir Password"
         Height          =   375
         Left            =   240
         TabIndex        =   6
         Top             =   3240
         Width           =   1575
      End
   End
End
Attribute VB_Name = "FCambioClave"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public GstrUsuario As String
Public GstrPassword As String

Private Sub cmdAceptar_Click()
         
  If Trim(Txtpassant.Text) = Empty Then
      MsgBox "Ingrese su clave Actual", vbDefaultButton1 + vbExclamation, "Mensaje"
      Txtpassant.SetFocus
      Exit Sub
  End If
  If Trim(Txtnuevopass.Text) = Empty Then
      MsgBox "Ingrese su nueva clave", vbDefaultButton1 + vbExclamation, "Mensaje"
      Txtnuevopass.SetFocus
      Exit Sub
  End If
      
  If Trim(Txtreppass.Text) = Empty Then
     MsgBox "Confirme su nueva clave", vbDefaultButton1 + vbExclamation, "Mensaje"
     Txtreppass.SetFocus
     Exit Sub
  End If
  
  If UCase(Trim(Txtpassant.Text)) <> UCase(Trim(GstrPassword)) Then
     MsgBox "Su password anterior es incorrecto", vbDefaultButton1 + vbExclamation, "Mensaje"
     Txtpassant.SetFocus
     Exit Sub
  End If
    
  Dim LstrValidacion As String
    
  LstrValidacion = GValidaPassword(GstrUsuario, Txtnuevopass.Text)
        
  If LstrValidacion <> "T" Then
     Exit Sub
  End If
        
  If UCase(Trim(Txtreppass.Text)) <> UCase(Trim(Txtnuevopass.Text)) Then
     MsgBox "La confirmación de su nuevo password es incorrecta", vbDefaultButton1 + vbExclamation, "Mensaje"
     Txtpassant.SetFocus
     Exit Sub
  End If
        
  ' Hay que Grabar el nuevo paassword
          
   Dim LutMantenimiento As DB_UT_MANTENIMIENTOS.C_PROCESOS
   Set LutMantenimiento = New DB_UT_MANTENIMIENTOS.C_PROCESOS
          
   LutMantenimiento.Auxiliar1 "SP_UpdProcSE_USERRECPASS  '" & GstrUsuario & "',""" & Encrip(UCase(Trim(Txtnuevopass.Text))) & """"
                     
   MsgBox "Password cambiado satisfactoriamente, Ingrese nuevamente al módulo ", vbDefaultButton1 + vbExclamation, "Mensaje"
   End
        
End Sub

Private Sub cmdCancelar_Click()
 Unload Me
End Sub

Private Sub Form_Load()

 Me.Top = (Screen.Height - Me.Height) / 2
 Me.Left = (Screen.Width - Me.Width) / 2

 lblbmensaje.Caption = "El password debe contener al menos 8 caracteres de longitud." + vbCrLf + _
                       "Su nuevo password no puede ser ninguno de los 12 passwords previos ingresados." + vbCrLf + _
                       "El password debe ser la combinación de letras, números y símbolos." + vbCrLf + _
                       "Ingrese su password teniendo en consideración estos requerimientos."

End Sub

