home *** CD-ROM | disk | FTP | other *** search
/ NetComm Communications 5 / NetComm.iso / resource / netcomm / wcomm / disk2 / priv.fr_ / priv.bin (.txt)
Encoding:
Visual Basic Form  |  1994-10-24  |  11.4 KB  |  364 lines

  1. VERSION 2.00
  2. Begin Form frmPrivileges 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Privileges"
  5.    ControlBox      =   0   'False
  6.    Height          =   4830
  7.    HelpContextID   =   56330
  8.    Left            =   2685
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   4425
  13.    ScaleWidth      =   6150
  14.    Top             =   1320
  15.    Width           =   6270
  16.    Begin CommandButton btnClose 
  17.       Cancel          =   -1  'True
  18.       Caption         =   "&Close"
  19.       Height          =   375
  20.       Left            =   1440
  21.       TabIndex        =   4
  22.       Top             =   3960
  23.       Width           =   1095
  24.    End
  25.    Begin CommandButton btnOK 
  26.       Caption         =   "OK"
  27.       Default         =   -1  'True
  28.       Height          =   375
  29.       Left            =   120
  30.       TabIndex        =   0
  31.       Top             =   3960
  32.       Width           =   1095
  33.    End
  34.    Begin CommandButton btnHelp 
  35.       Caption         =   "&Help"
  36.       Height          =   375
  37.       Left            =   4800
  38.       TabIndex        =   5
  39.       Top             =   3960
  40.       Width           =   1095
  41.    End
  42.    Begin CommandButton btnPrevious 
  43.       Caption         =   "&Previous"
  44.       Height          =   375
  45.       Left            =   4800
  46.       TabIndex        =   16
  47.       Top             =   600
  48.       Width           =   1095
  49.    End
  50.    Begin TextBox txtFirstName 
  51.       Height          =   285
  52.       Left            =   1200
  53.       TabIndex        =   1
  54.       Top             =   120
  55.       Width           =   3375
  56.    End
  57.    Begin TextBox txtPassword 
  58.       Height          =   285
  59.       Left            =   1200
  60.       TabIndex        =   3
  61.       Top             =   840
  62.       Width           =   3375
  63.    End
  64.    Begin TextBox txtLastName 
  65.       Height          =   285
  66.       Left            =   1200
  67.       TabIndex        =   2
  68.       Top             =   480
  69.       Width           =   3375
  70.    End
  71.    Begin CommandButton btnNext 
  72.       Caption         =   "&Next"
  73.       Height          =   375
  74.       Left            =   4800
  75.       TabIndex        =   15
  76.       Top             =   120
  77.       Width           =   1095
  78.    End
  79.    Begin TextBox txtCallback 
  80.       Height          =   285
  81.       Left            =   2040
  82.       TabIndex        =   7
  83.       Top             =   1200
  84.       Width           =   2535
  85.    End
  86.    Begin CheckBox chkCallBack 
  87.       Caption         =   "Callback &number:"
  88.       Height          =   255
  89.       Left            =   120
  90.       TabIndex        =   6
  91.       Top             =   1200
  92.       Width           =   1815
  93.    End
  94.    Begin Frame fraPriviliges 
  95.       Caption         =   "Privileges"
  96.       Height          =   2295
  97.       Left            =   120
  98.       TabIndex        =   17
  99.       Top             =   1560
  100.       Width           =   5895
  101.       Begin CommandButton btnBrowse 
  102.          Caption         =   "&Browse..."
  103.          Height          =   375
  104.          Left            =   4680
  105.          TabIndex        =   14
  106.          Top             =   1800
  107.          Width           =   1095
  108.       End
  109.       Begin TextBox txtLimitedTo 
  110.          Height          =   285
  111.          Left            =   2160
  112.          TabIndex        =   13
  113.          Top             =   1800
  114.          Width           =   2175
  115.       End
  116.       Begin CheckBox chkLimited 
  117.          Caption         =   "Acc&ess limited to:"
  118.          Height          =   255
  119.          Left            =   240
  120.          TabIndex        =   12
  121.          Top             =   1800
  122.          Width           =   1935
  123.       End
  124.       Begin CheckBox chkFileMgt 
  125.          Caption         =   "F&ile management (commands: Dir, Copy, Del, etc.)"
  126.          Height          =   255
  127.          Left            =   240
  128.          TabIndex        =   11
  129.          Top             =   1440
  130.          Width           =   4575
  131.       End
  132.       Begin CheckBox chkOverWrite 
  133.          Caption         =   "&Overwrite"
  134.          Height          =   255
  135.          Left            =   240
  136.          TabIndex        =   10
  137.          Top             =   1080
  138.          Width           =   4455
  139.       End
  140.       Begin CheckBox chkWrite 
  141.          Caption         =   "Wri&te (commands: Up, ZUp, YUp, etc.)"
  142.          Height          =   255
  143.          Left            =   240
  144.          TabIndex        =   9
  145.          Top             =   720
  146.          Width           =   3735
  147.       End
  148.       Begin CheckBox chkRead 
  149.          Caption         =   "&Read (commands: Type, Down, ZDown, etc.)"
  150.          Height          =   255
  151.          Left            =   240
  152.          TabIndex        =   8
  153.          Top             =   360
  154.          Width           =   4335
  155.       End
  156.    End
  157.    Begin Label lblFirstName 
  158.       Caption         =   "&First name:"
  159.       Height          =   255
  160.       Left            =   120
  161.       TabIndex        =   20
  162.       Top             =   120
  163.       Width           =   975
  164.    End
  165.    Begin Label lblPassword 
  166.       Caption         =   "Pass&word:"
  167.       Height          =   255
  168.       Left            =   120
  169.       TabIndex        =   19
  170.       Top             =   840
  171.       Width           =   975
  172.    End
  173.    Begin Label lblLastName 
  174.       Caption         =   "&Last name:"
  175.       Height          =   255
  176.       Left            =   120
  177.       TabIndex        =   18
  178.       Top             =   480
  179.       Width           =   975
  180.    End
  181. ' The follwoing declarations are used for version control reasons only
  182. ' and are not used within the application
  183. ' "$Revision:   1.7  $"
  184. ' "$Date:   12 Apr 1993 16:52:28  $"
  185. Option Explicit
  186. Sub btnBrowse_Click ()
  187.     frmDbrowse.Show (1)
  188. End Sub
  189. Sub btnClose_Click ()
  190.     frmPrivileges.Hide
  191. End Sub
  192. Sub btnHelp_Click ()
  193.     Help
  194. End Sub
  195. Sub btnNext_Click ()
  196.     Dim iResult As Integer
  197.     Dim iOldIndex
  198.     Dim sTemp As String
  199.     ' Sound a tone if we're already at the end of the list
  200.     If (iPasswordIndex = iPasswordCount) Then
  201.         Beep
  202.         Exit Sub
  203.     End If
  204.     ' Hang on to the old position in case the user has changed the name
  205.     ' fields, which causes the ordering of the array to change.
  206.     ' If this happens, then the next password will not be iPasswordIndex + 1,
  207.     ' but rather iOldIndex
  208.     iOldIndex = iPasswordIndex
  209.     ' Confirm saving changes before moving on to the next password
  210.     If (fChanges) Then
  211.         sTemp = "Do you want to save the changes made for "
  212.         If (iPasswordIndex = 0) Then
  213.             sTemp = sTemp + sNewDefaultsText + "?"
  214.         Else
  215.             sTemp = sTemp + aPasswords(iPasswordIndex).sFirst + " " + aPasswords(iPasswordIndex).sLast + "?"
  216.         End If
  217.         iResult = MsgBox(sTemp, MB_OKCANCEL Or MB_ICONQUESTION, "Save Changes")
  218.         If iResult = IDOK Then
  219.             UpdateUserSettings (fNameModified)
  220.         Else
  221.             Exit Sub
  222.         End If
  223.     End If
  224.     ' Get Next password info and Reset change flags
  225.     If (fNameModified) Then
  226.         iPasswordIndex = iOldIndex
  227.     ElseIf (iPasswordIndex + 1) <= iPasswordCount Then
  228.         iPasswordIndex = iPasswordIndex + 1
  229.     Else
  230.         iPasswordIndex = 1
  231.     End If
  232.     GetPasswordDetails
  233.     frmManage.lstPasswords.ListIndex = iPasswordIndex
  234.     fNameModified = False
  235.     fChanges = False
  236. End Sub
  237. Sub btnOK_Click ()
  238.     If (StrComp(frmPrivileges.Caption, sPrivAddTitle, 0) = 0) Then
  239.         ' Verify minimum information
  240.         If txtFirstName.Text = "" Or txtLastName.Text = "" Or txtPassword.Text = "" Then
  241.             MsgBox "Enter a First name, Last name and Password.", MB_OK Or MB_ICONEXCLAMATION, "Error"
  242.             Exit Sub
  243.         End If
  244.         stUser.sLast = Trim$(frmPrivileges.txtLastName.Text)
  245.         stUser.sFirst = Trim$(frmPrivileges.txtFirstName.Text)
  246.         stUser.sPassword = Trim$(frmPrivileges.txtPassword.Text)
  247.         stUser.sRestrictions = Trim$(frmPrivileges.txtLimitedTo.Text)
  248.         stUser.sCallback = Trim$(frmPrivileges.txtCallback.Text)
  249.         stUser.dLastTime = 0
  250.         stUser.dlastDate = 0
  251.         stUser.lCallCount = 0
  252.         stUser.lLastMessage = 0
  253.         stUser.iPrivileges = 0
  254.         stUser.iExtra = 0
  255.         
  256.         stUser.iPrivileges = PrivilegesSet()
  257.         AddPassword (ADD_LOCAL)
  258.     ElseIf (StrComp(frmPrivileges.Caption, sPrivModifyTitle, 0) = 0) Then
  259.         ' Have default settings have been modified
  260.         If (iPasswordIndex = 0) Then
  261.             iPrivilegeDefaults = PrivilegesSet()
  262.             sDefLimitedTo = frmPrivileges.txtLimitedTo.Text
  263.             StoreHostSettings
  264.             frmPrivileges.Hide
  265.             Exit Sub
  266.         End If
  267.         ' Make sure first,last password are still there
  268.         If txtFirstName.Text = "" Or txtLastName.Text = "" Or txtPassword.Text = "" Then
  269.             MsgBox "Enter a First name, Last name and Password.", MB_OK Or MB_ICONEXCLAMATION, "Error"
  270.             Exit Sub
  271.         End If
  272.         
  273.         UpdateUserSettings (fNameModified)
  274.     End If
  275.     frmPrivileges.Hide
  276. End Sub
  277. Sub btnPrevious_Click ()
  278.     Dim iResult As Integer
  279.     Dim iOldIndex
  280.     Dim sTemp As String
  281.     ' Sound a tone if we're already at the top of the list
  282.     If (iPasswordIndex = 0) Then
  283.         Beep
  284.         Exit Sub
  285.     End If
  286.     ' Hang on to the old position in case the user has changed the name
  287.     ' fields, which causes the ordering of the array to change.
  288.     ' If this happens, then the next password will not be iPasswordIndex + 1,
  289.     ' but rather iOldIndex
  290.     iOldIndex = iPasswordIndex
  291.     ' Confirm saving changes before moving to the previous password
  292.     If (fChanges) Then
  293.         sTemp = "Do you want to save the changes made for "
  294.         If (iPasswordIndex = 0) Then
  295.             sTemp = sTemp + sNewDefaultsText + "?"
  296.         Else
  297.             sTemp = sTemp + aPasswords(iPasswordIndex).sFirst + " " + aPasswords(iPasswordIndex).sLast + "?"
  298.         End If
  299.         iResult = MsgBox(sTemp, MB_OKCANCEL Or MB_ICONQUESTION, "Save Changes")
  300.         If iResult = IDOK Then
  301.             UpdateUserSettings (fNameModified)
  302.         Else
  303.             Exit Sub
  304.         End If
  305.     End If
  306.     ' Get Previous password info and Reset change flags
  307.     If (fNameModified) Then
  308.         iPasswordIndex = iOldIndex
  309.     ElseIf (iPasswordIndex - 1) >= 0 Then
  310.         iPasswordIndex = iPasswordIndex - 1
  311.     Else
  312.         iPasswordIndex = 1
  313.     End If
  314.     GetPasswordDetails
  315.     frmManage.lstPasswords.ListIndex = iPasswordIndex
  316.     fNameModified = False
  317.     fChanges = False
  318. End Sub
  319. Sub chkCallBack_Click ()
  320.     fChanges = True
  321. End Sub
  322. Sub chkFileMgt_Click ()
  323.      fChanges = True
  324. End Sub
  325. Sub chkLimited_Click ()
  326.     fChanges = True
  327. End Sub
  328. Sub chkOverWrite_Click ()
  329.     fChanges = True
  330. End Sub
  331. Sub chkRead_Click ()
  332.     fChanges = True
  333. End Sub
  334. Sub chkWrite_Click ()
  335.     fChanges = True
  336. End Sub
  337. Sub Form_Activate ()
  338.     'fNameModified = False
  339.     'fChanges = False
  340.     If (frmManage.lstPasswords.ListIndex = 0) And (StrComp(frmPrivileges.Caption, sPrivAddTitle, 0) <> 0) Then
  341.         chkCallBack.SetFocus
  342.     Else
  343.         txtFirstName.SetFocus
  344.     End If
  345. End Sub
  346. Sub txtCallback_Change ()
  347.     fChanges = True
  348. End Sub
  349. Sub txtFirstName_Change ()
  350.     fNameModified = True
  351.     fChanges = True
  352. End Sub
  353. Sub txtLastName_Change ()
  354.     fNameModified = True
  355.     fChanges = True
  356. End Sub
  357. Sub txtLimitedTo_Change ()
  358.     fChanges = True
  359. End Sub
  360. Sub txtPassword_Change ()
  361.     fNameModified = True
  362.     fChanges = True
  363. End Sub
  364.