home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form UserPropertyFrm
- BorderStyle = 3 'Fixed Dialog
- Caption = "User Property"
- ClientHeight = 3195
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 6225
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3195
- ScaleWidth = 6225
- ShowInTaskbar = 0 'False
- StartUpPosition = 3 'Windows Default
- Begin VB.ComboBox cmbDomains
- Height = 315
- ItemData = "UserPropertyFrm.frx":0000
- Left = 3240
- List = "UserPropertyFrm.frx":0002
- Style = 2 'Dropdown List
- TabIndex = 9
- Top = 240
- Width = 2895
- End
- Begin VB.TextBox txtAccount
- Height = 285
- Left = 1200
- TabIndex = 7
- Text = "Text1"
- Top = 240
- Width = 1695
- End
- Begin VB.CommandButton btnCancel
- Cancel = -1 'True
- Caption = "&Cancel"
- Height = 375
- Left = 4800
- TabIndex = 6
- Top = 2640
- Width = 1215
- End
- Begin VB.CommandButton btnOK
- Caption = "&OK"
- Height = 375
- Left = 3360
- TabIndex = 5
- Top = 2640
- Width = 1215
- End
- Begin VB.TextBox txtMailDir
- Height = 285
- Left = 120
- TabIndex = 3
- Text = "Text1"
- Top = 2040
- Width = 6015
- End
- Begin VB.CheckBox chkAllowAccess
- Caption = "Allow this account to be accessed with a POP/IMAP client"
- Height = 255
- Left = 480
- TabIndex = 2
- Top = 1320
- Width = 4695
- End
- Begin VB.TextBox txtFullName
- Height = 285
- Left = 1200
- TabIndex = 1
- Text = "Text1"
- Top = 840
- Width = 4935
- End
- Begin VB.Label Label4
- Caption = "Account:"
- Height = 255
- Left = 360
- TabIndex = 10
- Top = 240
- Width = 855
- End
- Begin VB.Label Label3
- Caption = "@"
- Height = 255
- Left = 3000
- TabIndex = 8
- Top = 240
- Width = 375
- End
- Begin VB.Label Label2
- Caption = "Mail Directory:"
- Height = 255
- Left = 120
- TabIndex = 4
- Top = 1800
- Width = 1815
- End
- Begin VB.Label Label1
- Caption = "Full Name:"
- Height = 255
- Left = 360
- TabIndex = 0
- Top = 840
- Width = 855
- End
- Attribute VB_Name = "UserPropertyFrm"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Public mEmail As String
- Public mRetval As Integer
- Private mUserInfo As MDUserInfo
- Private mhUser As MD_HANDLE
- 'A sub routine to load the MDUserInfo items to the controls
- Private Sub LoadInfoToForm()
- txtAccount.Text = mUserInfo.MailBox
- txtFullName.Text = mUserInfo.FullName
- txtMailDir.Text = mUserInfo.MailDir
- chkAllowAccess.Value = mUserInfo.AllowAccess
- cmbDomains.Clear
- Dim sDomains() As Variant
- Dim sDom As Variant
- 'Get the list of domains
- gMDUser.GetDomainNames sDomains
- For Each sDom In sDomains
- cmbDomains.AddItem sDom
- Next sDom
- cmbDomains.Text = mUserInfo.Domain
- End Sub
- 'A function to load the MDUserInfo from the controls
- Private Function LoadInfoFromForm() As Boolean
- If txtFullName.Text = "" Or txtMailDir.Text = "" Or txtAccount.Text = "" Then
- LoadInfoFromForm = False
- Exit Function
- End If
- mUserInfo.FullName = txtFullName.Text
- mUserInfo.MailDir = txtMailDir.Text
- mUserInfo.AllowAccess = chkAllowAccess.Value
- mUserInfo.MailBox = txtAccount.Text
- mUserInfo.Domain = cmbDomains.Text
- LoadInfoFromForm = True
- End Function
- Private Sub btnCancel_Click()
- Unload UserPropertyFrm
- End Sub
- Private Sub btnOK_Click()
- If LoadInfoFromForm And gMDUser.VerifyUserInfo(mUserInfo, MDUSERDLL_VRFYALL) = MDDLLERR_NOERROR Then
- gMDUser.SetUserInfo mhUser, mUserInfo
- Else
- MsgBox "Could not validate account info. Please make sure that all entries are valid.", vbCritical
- Exit Sub
- End If
- mRetval = 1
- Unload UserPropertyFrm
- End Sub
- Private Sub Form_Load()
- mhUser = gMDUser.GetByEmail(mEmail)
- If mhUser <> MD_BADHANDLE Then
- 'Create an instance of MDUserInfo
- Set mUserInfo = New MDUserInfo
-
- 'Get the MDUserInfo object associated with the user handle
- gMDUser.GetUserInfo mhUser, mUserInfo
-
- LoadInfoToForm
- End If
- mRetval = 0
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- If mhUser <> MD_BADHANDLE Then
- Set mUserInfo = Nothing
- 'Free the user handle
- gMDUser.GetFree mhUser
- End If
- End Sub
-