home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 2.00 Begin Form frmManage BorderStyle = 3 'Fixed Double Caption = "Manage Passwords" ControlBox = 0 'False Height = 3912 HelpContextID = 56328 Left = 2340 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 3492 ScaleWidth = 5712 Top = 2100 Width = 5808 Begin CommandButton btnHelp Caption = "&Help" Height = 375 Left = 4440 TabIndex = 5 Top = 3000 Width = 1095 End Begin ListBox lstPasswords Height = 1785 Left = 120 Sorted = -1 'True TabIndex = 10 Top = 1080 Width = 4215 End Begin CheckBox chkClosedSystem Caption = "Adm&it only callers with pre-defined passwords" Height = 255 Left = 120 TabIndex = 8 Top = 480 Width = 4215 End Begin CommandButton btnLockList Caption = "&Lock List..." Height = 375 Left = 1680 TabIndex = 6 Top = 3000 Width = 1335 End Begin CommandButton btnDelete Caption = "&Delete" Height = 375 Left = 4440 TabIndex = 4 Top = 2160 Width = 1095 End Begin CommandButton btnAdd Caption = "&Add..." Height = 375 Left = 4440 TabIndex = 2 Top = 1200 Width = 1095 End Begin CommandButton btnModify Caption = "&Modify..." Height = 375 Left = 4440 TabIndex = 3 Top = 1680 Width = 1095 End Begin CommandButton btnClose Cancel = -1 'True Caption = "&Close" Default = -1 'True Height = 375 Left = 120 TabIndex = 0 Top = 3000 Width = 1335 End Begin CommandButton btnBrowse Caption = "&Browse..." Height = 375 Left = 4440 TabIndex = 1 Top = 120 Width = 1095 End Begin TextBox txtPasswordFile Height = 285 Left = 1560 TabIndex = 7 Top = 120 Width = 2775 End Begin Label Label1 Caption = " Last name, First name" Height = 255 Left = 120 TabIndex = 11 Top = 840 Width = 2175 End Begin Label lblFileName Caption = "&Password file:" Height = 255 Left = 120 TabIndex = 9 Top = 120 Width = 1335 End ' The follwoing declarations are used for version control reasons only ' and are not used within the application ' "$Revision: 1.9 $" ' "$Date: 07 Jun 1993 15:43:50 $" Option Explicit Sub btnAdd_Click () ' Set caption for the form frmPrivileges.Caption = sPrivAddTitle ' These buttons are not valid for addition of new passwords frmPrivileges.btnNext.Visible = False frmPrivileges.btnPrevious.Visible = False ' Reset these values frmPrivileges.txtFirstName.Enabled = True frmPrivileges.txtLastName.Enabled = True frmPrivileges.txtPassword.Enabled = True frmPrivileges.lblFirstName.Enabled = True frmPrivileges.lblLastName.Enabled = True frmPrivileges.lblPassword.Enabled = True ' Set default values for adding new passwords SetPasswordDefaults ' Display the form frmPrivileges.Show (1) End Sub Sub btnBrowse_Click () frmBrowse.cmbFileType.Clear frmBrowse.cmbFileType.AddItem "Password files (*.pwd)" frmBrowse.cmbFileType.AddItem "Text files (*.txt)" frmBrowse.cmbFileType.AddItem "All files (*.*)" frmBrowse.cmbFileType.ListIndex = 0 frmBrowse.Show (1) End Sub Sub btnBrowse_GotFocus () If Len(sCommDlgFile) <> 0 Then txtPasswordFile.Text = sCommDlgFile End If sCommDlgFile = "" End Sub Sub btnCancel_Click () frmManage.Hide End Sub Sub btnClose_Click () StoreHostSettings StoreUserSettings frmManage.Hide End Sub Sub btnDelete_Click () Dim sTemp As String Dim iResult As Integer If frmManage.lstPasswords.ListIndex = 0 Then MsgBox "This item cannot be removed from the password list.", MB_OK Or MB_ICONEXCLAMATION, "Error" Exit Sub End If sTemp = "Are you sure you want to remove " + aPasswords(lstPasswords.ListIndex).sFirst + " " + aPasswords(lstPasswords.ListIndex).sLast + " from the password list?" iResult = MsgBox(sTemp, MB_OKCANCEL Or MB_ICONQUESTION, "Delete Password") If iResult = IDOK Then RemovePassword frmManage.lstPasswords.ListIndex Else Exit Sub End If End Sub Sub btnDetails_Click () frmPrivileges.Show (1) End Sub Sub btnHelp_Click () Help End Sub Sub btnLockList_Click () If StrComp(frmManage.btnLockList.Caption, sLockText, 0) = 0 Then frmLock.Show (1) Else frmManage.btnLockList.Caption = sLockText sLockWord = "" StoreHostSettings MsgBox "The password list has been UNLOCKED.", MB_OK Or MB_ICONINFORMATION, "Password List Unlocked" End If End Sub Sub btnModify_Click () ' Set caption for the form frmPrivileges.Caption = sPrivModifyTitle ' These may have been disabled by a previous operation frmPrivileges.btnNext.Visible = True frmPrivileges.btnPrevious.Visible = True ' Set values for modifying selected password If frmManage.lstPasswords.ListIndex = 0 Then frmPrivileges.txtFirstName.Enabled = False frmPrivileges.txtLastName.Enabled = False frmPrivileges.txtPassword.Enabled = False frmPrivileges.lblFirstName.Enabled = False frmPrivileges.lblLastName.Enabled = False frmPrivileges.lblPassword.Enabled = False iPasswordIndex = frmManage.lstPasswords.ListIndex SetPasswordDefaults frmPrivileges.txtFirstName.Text = sNewDefaultsText Else frmPrivileges.txtFirstName.Enabled = True frmPrivileges.txtLastName.Enabled = True frmPrivileges.txtPassword.Enabled = True frmPrivileges.lblFirstName.Enabled = True frmPrivileges.lblLastName.Enabled = True frmPrivileges.lblPassword.Enabled = True iPasswordIndex = frmManage.lstPasswords.ListIndex GetPasswordDetails End If ' Display the form fNameModified = False fChanges = False frmPrivileges.Show (1) End Sub Sub btnOK_Click () StoreHostSettings frmManage.Hide End Sub Sub Form_Activate () If Len(sLockWord) = 0 Then frmManage.btnLockList.Caption = sLockText Else frmManage.btnLockList.Caption = sUnlockText End If If (frmManage.lstPasswords.ListIndex = -1) Then btnModify.Enabled = False btnDelete.Enabled = False End If If (fCallerOnLine) Then frmManage.lblFileName.Enabled = False frmManage.txtPasswordFile.Enabled = False frmManage.btnBrowse.Enabled = False Else frmManage.lblFileName.Enabled = True frmManage.txtPasswordFile.Enabled = True frmManage.btnBrowse.Enabled = True End If End Sub Sub lstPasswords_Click () btnModify.Enabled = True btnDelete.Enabled = True End Sub Sub lstPasswords_DblClick () btnModify.Value = True End Sub