home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmPrivileges
- BorderStyle = 3 'Fixed Double
- Caption = "Privileges"
- ControlBox = 0 'False
- Height = 4830
- HelpContextID = 56330
- Left = 2685
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 4425
- ScaleWidth = 6150
- Top = 1320
- Width = 6270
- Begin CommandButton btnClose
- Cancel = -1 'True
- Caption = "&Close"
- Height = 375
- Left = 1440
- TabIndex = 4
- Top = 3960
- Width = 1095
- End
- Begin CommandButton btnOK
- Caption = "OK"
- Default = -1 'True
- Height = 375
- Left = 120
- TabIndex = 0
- Top = 3960
- Width = 1095
- End
- Begin CommandButton btnHelp
- Caption = "&Help"
- Height = 375
- Left = 4800
- TabIndex = 5
- Top = 3960
- Width = 1095
- End
- Begin CommandButton btnPrevious
- Caption = "&Previous"
- Height = 375
- Left = 4800
- TabIndex = 16
- Top = 600
- Width = 1095
- End
- Begin TextBox txtFirstName
- Height = 285
- Left = 1200
- TabIndex = 1
- Top = 120
- Width = 3375
- End
- Begin TextBox txtPassword
- Height = 285
- Left = 1200
- TabIndex = 3
- Top = 840
- Width = 3375
- End
- Begin TextBox txtLastName
- Height = 285
- Left = 1200
- TabIndex = 2
- Top = 480
- Width = 3375
- End
- Begin CommandButton btnNext
- Caption = "&Next"
- Height = 375
- Left = 4800
- TabIndex = 15
- Top = 120
- Width = 1095
- End
- Begin TextBox txtCallback
- Height = 285
- Left = 2040
- TabIndex = 7
- Top = 1200
- Width = 2535
- End
- Begin CheckBox chkCallBack
- Caption = "Callback &number:"
- Height = 255
- Left = 120
- TabIndex = 6
- Top = 1200
- Width = 1815
- End
- Begin Frame fraPriviliges
- Caption = "Privileges"
- Height = 2295
- Left = 120
- TabIndex = 17
- Top = 1560
- Width = 5895
- Begin CommandButton btnBrowse
- Caption = "&Browse..."
- Height = 375
- Left = 4680
- TabIndex = 14
- Top = 1800
- Width = 1095
- End
- Begin TextBox txtLimitedTo
- Height = 285
- Left = 2160
- TabIndex = 13
- Top = 1800
- Width = 2175
- End
- Begin CheckBox chkLimited
- Caption = "Acc&ess limited to:"
- Height = 255
- Left = 240
- TabIndex = 12
- Top = 1800
- Width = 1935
- End
- Begin CheckBox chkFileMgt
- Caption = "F&ile management (commands: Dir, Copy, Del, etc.)"
- Height = 255
- Left = 240
- TabIndex = 11
- Top = 1440
- Width = 4575
- End
- Begin CheckBox chkOverWrite
- Caption = "&Overwrite"
- Height = 255
- Left = 240
- TabIndex = 10
- Top = 1080
- Width = 4455
- End
- Begin CheckBox chkWrite
- Caption = "Wri&te (commands: Up, ZUp, YUp, etc.)"
- Height = 255
- Left = 240
- TabIndex = 9
- Top = 720
- Width = 3735
- End
- Begin CheckBox chkRead
- Caption = "&Read (commands: Type, Down, ZDown, etc.)"
- Height = 255
- Left = 240
- TabIndex = 8
- Top = 360
- Width = 4335
- End
- End
- Begin Label lblFirstName
- Caption = "&First name:"
- Height = 255
- Left = 120
- TabIndex = 20
- Top = 120
- Width = 975
- End
- Begin Label lblPassword
- Caption = "Pass&word:"
- Height = 255
- Left = 120
- TabIndex = 19
- Top = 840
- Width = 975
- End
- Begin Label lblLastName
- Caption = "&Last name:"
- Height = 255
- Left = 120
- TabIndex = 18
- Top = 480
- Width = 975
- End
- ' The follwoing declarations are used for version control reasons only
- ' and are not used within the application
- ' "$Revision: 1.7 $"
- ' "$Date: 12 Apr 1993 16:52:28 $"
- Option Explicit
- Sub btnBrowse_Click ()
- frmDbrowse.Show (1)
- End Sub
- Sub btnClose_Click ()
- frmPrivileges.Hide
- End Sub
- Sub btnHelp_Click ()
- Help
- End Sub
- Sub btnNext_Click ()
- Dim iResult As Integer
- Dim iOldIndex
- Dim sTemp As String
- ' Sound a tone if we're already at the end of the list
- If (iPasswordIndex = iPasswordCount) Then
- Beep
- Exit Sub
- End If
- ' Hang on to the old position in case the user has changed the name
- ' fields, which causes the ordering of the array to change.
- ' If this happens, then the next password will not be iPasswordIndex + 1,
- ' but rather iOldIndex
- iOldIndex = iPasswordIndex
- ' Confirm saving changes before moving on to the next password
- If (fChanges) Then
- sTemp = "Do you want to save the changes made for "
- If (iPasswordIndex = 0) Then
- sTemp = sTemp + sNewDefaultsText + "?"
- Else
- sTemp = sTemp + aPasswords(iPasswordIndex).sFirst + " " + aPasswords(iPasswordIndex).sLast + "?"
- End If
- iResult = MsgBox(sTemp, MB_OKCANCEL Or MB_ICONQUESTION, "Save Changes")
- If iResult = IDOK Then
- UpdateUserSettings (fNameModified)
- Else
- Exit Sub
- End If
- End If
- ' Get Next password info and Reset change flags
- If (fNameModified) Then
- iPasswordIndex = iOldIndex
- ElseIf (iPasswordIndex + 1) <= iPasswordCount Then
- iPasswordIndex = iPasswordIndex + 1
- Else
- iPasswordIndex = 1
- End If
- GetPasswordDetails
- frmManage.lstPasswords.ListIndex = iPasswordIndex
- fNameModified = False
- fChanges = False
- End Sub
- Sub btnOK_Click ()
- If (StrComp(frmPrivileges.Caption, sPrivAddTitle, 0) = 0) Then
- ' Verify minimum information
- If txtFirstName.Text = "" Or txtLastName.Text = "" Or txtPassword.Text = "" Then
- MsgBox "Enter a First name, Last name and Password.", MB_OK Or MB_ICONEXCLAMATION, "Error"
- Exit Sub
- End If
- stUser.sLast = Trim$(frmPrivileges.txtLastName.Text)
- stUser.sFirst = Trim$(frmPrivileges.txtFirstName.Text)
- stUser.sPassword = Trim$(frmPrivileges.txtPassword.Text)
- stUser.sRestrictions = Trim$(frmPrivileges.txtLimitedTo.Text)
- stUser.sCallback = Trim$(frmPrivileges.txtCallback.Text)
- stUser.dLastTime = 0
- stUser.dlastDate = 0
- stUser.lCallCount = 0
- stUser.lLastMessage = 0
- stUser.iPrivileges = 0
- stUser.iExtra = 0
-
- stUser.iPrivileges = PrivilegesSet()
- AddPassword (ADD_LOCAL)
- ElseIf (StrComp(frmPrivileges.Caption, sPrivModifyTitle, 0) = 0) Then
- ' Have default settings have been modified
- If (iPasswordIndex = 0) Then
- iPrivilegeDefaults = PrivilegesSet()
- sDefLimitedTo = frmPrivileges.txtLimitedTo.Text
- StoreHostSettings
- frmPrivileges.Hide
- Exit Sub
- End If
- ' Make sure first,last password are still there
- If txtFirstName.Text = "" Or txtLastName.Text = "" Or txtPassword.Text = "" Then
- MsgBox "Enter a First name, Last name and Password.", MB_OK Or MB_ICONEXCLAMATION, "Error"
- Exit Sub
- End If
-
- UpdateUserSettings (fNameModified)
- End If
- frmPrivileges.Hide
- End Sub
- Sub btnPrevious_Click ()
- Dim iResult As Integer
- Dim iOldIndex
- Dim sTemp As String
- ' Sound a tone if we're already at the top of the list
- If (iPasswordIndex = 0) Then
- Beep
- Exit Sub
- End If
- ' Hang on to the old position in case the user has changed the name
- ' fields, which causes the ordering of the array to change.
- ' If this happens, then the next password will not be iPasswordIndex + 1,
- ' but rather iOldIndex
- iOldIndex = iPasswordIndex
- ' Confirm saving changes before moving to the previous password
- If (fChanges) Then
- sTemp = "Do you want to save the changes made for "
- If (iPasswordIndex = 0) Then
- sTemp = sTemp + sNewDefaultsText + "?"
- Else
- sTemp = sTemp + aPasswords(iPasswordIndex).sFirst + " " + aPasswords(iPasswordIndex).sLast + "?"
- End If
- iResult = MsgBox(sTemp, MB_OKCANCEL Or MB_ICONQUESTION, "Save Changes")
- If iResult = IDOK Then
- UpdateUserSettings (fNameModified)
- Else
- Exit Sub
- End If
- End If
- ' Get Previous password info and Reset change flags
- If (fNameModified) Then
- iPasswordIndex = iOldIndex
- ElseIf (iPasswordIndex - 1) >= 0 Then
- iPasswordIndex = iPasswordIndex - 1
- Else
- iPasswordIndex = 1
- End If
- GetPasswordDetails
- frmManage.lstPasswords.ListIndex = iPasswordIndex
- fNameModified = False
- fChanges = False
- End Sub
- Sub chkCallBack_Click ()
- fChanges = True
- End Sub
- Sub chkFileMgt_Click ()
- fChanges = True
- End Sub
- Sub chkLimited_Click ()
- fChanges = True
- End Sub
- Sub chkOverWrite_Click ()
- fChanges = True
- End Sub
- Sub chkRead_Click ()
- fChanges = True
- End Sub
- Sub chkWrite_Click ()
- fChanges = True
- End Sub
- Sub Form_Activate ()
- 'fNameModified = False
- 'fChanges = False
- If (frmManage.lstPasswords.ListIndex = 0) And (StrComp(frmPrivileges.Caption, sPrivAddTitle, 0) <> 0) Then
- chkCallBack.SetFocus
- Else
- txtFirstName.SetFocus
- End If
- End Sub
- Sub txtCallback_Change ()
- fChanges = True
- End Sub
- Sub txtFirstName_Change ()
- fNameModified = True
- fChanges = True
- End Sub
- Sub txtLastName_Change ()
- fNameModified = True
- fChanges = True
- End Sub
- Sub txtLimitedTo_Change ()
- fChanges = True
- End Sub
- Sub txtPassword_Change ()
- fNameModified = True
- fChanges = True
- End Sub
-