当前文件路径:DNN/Library/Controls/User.vb 
1
'
2
' DotNetNuke?- http://www.dotnetnuke.com
3
' Copyright (c) 2002-2008
4
' by DotNetNuke Corporation
5
'
6
' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
7
' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
8
' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
9
' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
'
11
' The above copyright notice and this permission notice shall be included in all copies or substantial portions
12
' of the Software.
13
'
14
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
15
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
17
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18
' DEALINGS IN THE SOFTWARE.
19
'
20
21
Imports DotNetNuke.Entities.Modules
22
Imports DotNetNuke.Common.Lists
23
24
Namespace DotNetNukeNamespace DotNetNuke.UI.UserControls
25
26
/**/''' -----------------------------------------------------------------------------
27
''' <summary>
28
''' The User UserControl is used to manage User Details
29
''' </summary>
30
''' <remarks>
31
''' </remarks>
32
''' <history>
33
''' [cnurse] 02/21/2005 created
34
''' </history>
35
''' -----------------------------------------------------------------------------
36
Public MustInherit Class UserClass User
37
Inherits Framework.UserControlBase
38
39
Controls#Region "Controls"
40
41
Protected plFirstName As UI.UserControls.LabelControl
42
Protected WithEvents txtFirstName As System.Web.UI.WebControls.TextBox
43
Protected WithEvents valFirstName As System.Web.UI.WebControls.RequiredFieldValidator
44
Protected plLastName As UI.UserControls.LabelControl
45
Protected WithEvents txtLastName As System.Web.UI.WebControls.TextBox
46
Protected WithEvents valLastName As System.Web.UI.WebControls.RequiredFieldValidator
47
Protected plUserName As UI.UserControls.LabelControl
48
Protected WithEvents txtUsername As System.Web.UI.WebControls.TextBox
49
Protected WithEvents valUsername As System.Web.UI.WebControls.RequiredFieldValidator
50
Protected WithEvents lblUsernameAsterisk As System.Web.UI.WebControls.Label
51
Protected WithEvents lblUsername As System.Web.UI.WebControls.Label
52
53
Protected WithEvents PasswordRow As System.Web.UI.HtmlControls.HtmlTableRow
54
Protected plPassword As UI.UserControls.LabelControl
55
Protected WithEvents txtPassword As System.Web.UI.WebControls.TextBox
56
Protected WithEvents valPassword As System.Web.UI.WebControls.RequiredFieldValidator
57
Protected WithEvents ConfirmPasswordRow As System.Web.UI.HtmlControls.HtmlTableRow
58
Protected plConfirm As UI.UserControls.LabelControl
59
Protected WithEvents txtConfirm As System.Web.UI.WebControls.TextBox
60
Protected WithEvents valConfirm1 As System.Web.UI.WebControls.RequiredFieldValidator
61
Protected WithEvents valConfirm2 As System.Web.UI.WebControls.CompareValidator
62
Protected plEmail As UI.UserControls.LabelControl
63
Protected WithEvents txtEmail As System.Web.UI.WebControls.TextBox
64
Protected WithEvents valEmail1 As System.Web.UI.WebControls.RequiredFieldValidator
65
Protected WithEvents valEmail2 As System.Web.UI.WebControls.RegularExpressionValidator
66
Protected plWebsite As UI.UserControls.LabelControl
67
Protected WithEvents txtWebsite As System.Web.UI.WebControls.TextBox
68
Protected plIM As UI.UserControls.LabelControl
69
Protected WithEvents txtIM As System.Web.UI.WebControls.TextBox
70
71
72
#End Region
73
74
Private Members#Region "Private Members"
75
76
Private _ModuleId As Integer
77
Private _ShowPassword As Boolean
78
Private _LabelColumnWidth As String = ""
79
Private _ControlColumnWidth As String = ""
80
Private _StartTabIndex As Integer = 1
81
Private _FirstName As String
82
Private _LastName As String
83
Private _UserName As String
84
Private _Password As String
85
Private _Confirm As String
86
Private _Email As String
87
Private _Website As String
88
Private _IM As String
89
90
Private MyFileName As String = "User.ascx"
91
92
#End Region
93
94
Properties#Region "Properties"
95
96
Public Property ModuleId()Property ModuleId() As Integer
97
Get
98
ModuleId = Convert.ToInt32(ViewState("ModuleId"))
99
End Get
100
Set(ByVal Value As Integer)
101
_ModuleId = Value
102
End Set
103
End Property
104
105
Public Property LabelColumnWidth()Property LabelColumnWidth() As String
106
Get
107
LabelColumnWidth = Convert.ToString(ViewState("LabelColumnWidth"))
108
End Get
109
Set(ByVal Value As String)
110
_LabelColumnWidth = Value
111
End Set
112
End Property
113
114
Public Property ControlColumnWidth()Property ControlColumnWidth() As String
115
Get
116
ControlColumnWidth = Convert.ToString(ViewState("ControlColumnWidth"))
117
End Get
118
Set(ByVal Value As String)
119
_ControlColumnWidth = Value
120
End Set
121
End Property
122
123
Public Property FirstName()Property FirstName() As String
124
Get
125
FirstName = txtFirstName.Text
126
End Get
127
Set(ByVal Value As String)
128
_FirstName = Value
129
End Set
130
End Property
131
132
Public Property LastName()Property LastName() As String
133
Get
134
LastName = txtLastName.Text
135
End Get
136
Set(ByVal Value As String)
137
_LastName = Value
138
End Set
139
End Property
140
141
Public Property UserName()Property UserName() As String
142
Get
143
UserName = txtUsername.Text
144
End Get
145
Set(ByVal Value As String)
146
_UserName = Value
147
End Set
148
End Property
149
150
Public Property Password()Property Password() As String
151
Get
152
Password = txtPassword.Text
153
End Get
154
Set(ByVal Value As String)
155
_Password = Value
156
End Set
157
End Property
158
159
Public Property Confirm()Property Confirm() As String
160
Get
161
Confirm = txtConfirm.Text
162
End Get
163
Set(ByVal Value As String)
164
_Confirm = Value
165
End Set
166
End Property
167
168
Public Property Email()Property Email() As String
169
Get
170
Email = txtEmail.Text
171
End Get
172
Set(ByVal Value As String)
173
_Email = Value
174
End Set
175
End Property
176
177
Public Property Website()Property Website() As String
178
Get
179
Website = txtWebsite.Text
180
End Get
181
Set(ByVal Value As String)
182
_Website = Value
183
End Set
184
End Property
185
186
Public Property IM()Property IM() As String
187
Get
188
IM = txtIM.Text
189
End Get
190
Set(ByVal Value As String)
191
_IM = Value
192
End Set
193
End Property
194
195
Public WriteOnly Property StartTabIndex()Property StartTabIndex() As Integer
196
Set(ByVal Value As Integer)
197
_StartTabIndex = Value
198
End Set
199
End Property
200
201
Public WriteOnly Property ShowPassword()Property ShowPassword() As Boolean
202
Set(ByVal Value As Boolean)
203
_ShowPassword = Value
204
End Set
205
End Property
206
207
Public ReadOnly Property LocalResourceFile()Property LocalResourceFile() As String
208
Get
209
Return Services.Localization.Localization.GetResourceFile(Me, MyFileName)
210
End Get
211
End Property
212
213
#End Region
214
215
Event Handlers#Region "Event Handlers"
216
217
/**/''' -----------------------------------------------------------------------------
218
''' <summary>
219
''' Page_Load runs when the control is loaded
220
''' </summary>
221
''' <remarks>
222
''' </remarks>
223
''' <history>
224
''' [cnurse] 02/21/2005 created
225
''' </history>
226
''' -----------------------------------------------------------------------------
227
Private Sub Page_Load()Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
228
Try
229
230
If Page.IsPostBack = False Then
231
232
txtFirstName.TabIndex = Convert.ToInt16(_StartTabIndex)
233
txtLastName.TabIndex = Convert.ToInt16(_StartTabIndex + 1)
234
txtUsername.TabIndex = Convert.ToInt16(_StartTabIndex + 2)
235
txtPassword.TabIndex = Convert.ToInt16(_StartTabIndex + 3)
236
txtConfirm.TabIndex = Convert.ToInt16(_StartTabIndex + 4)
237
txtEmail.TabIndex = Convert.ToInt16(_StartTabIndex + 5)
238
txtWebsite.TabIndex = Convert.ToInt16(_StartTabIndex + 6)
239
txtIM.TabIndex = Convert.ToInt16(_StartTabIndex + 7)
240
241
txtFirstName.Text = _FirstName
242
txtLastName.Text = _LastName
243
txtUsername.Text = _UserName
244
lblUsername.Text = _UserName
245
txtPassword.Text = _Password
246
txtConfirm.Text = _Confirm
247
txtEmail.Text = _Email
248
txtWebsite.Text = _Website
249
txtIM.Text = _IM
250
251
If _ControlColumnWidth <> "" Then
252
txtFirstName.Width = System.Web.UI.WebControls.Unit.Parse(_ControlColumnWidth)
253
txtLastName.Width = System.Web.UI.WebControls.Unit.Parse(_ControlColumnWidth)
254
txtUsername.Width = System.Web.UI.WebControls.Unit.Parse(_ControlColumnWidth)
255
txtPassword.Width = System.Web.UI.WebControls.Unit.Parse(_ControlColumnWidth)
256
txtConfirm.Width = System.Web.UI.WebControls.Unit.Parse(_ControlColumnWidth)
257
txtEmail.Width = System.Web.UI.WebControls.Unit.Parse(_ControlColumnWidth)
258
txtWebsite.Width = System.Web.UI.WebControls.Unit.Parse(_ControlColumnWidth)
259
txtIM.Width = System.Web.UI.WebControls.Unit.Parse(_ControlColumnWidth)
260
End If
261
262
If Not _ShowPassword Then
263
valPassword.Enabled = False
264
valConfirm1.Enabled = False
265
valConfirm2.Enabled = False
266
PasswordRow.Visible = False
267
ConfirmPasswordRow.Visible = False
268
txtUsername.Visible = False
269
valUsername.Enabled = False
270
lblUsername.Visible = True
271
lblUsernameAsterisk.Visible = False
272
Else
273
txtUsername.Visible = True
274
valUsername.Enabled = True
275
lblUsername.Visible = False
276
lblUsernameAsterisk.Visible = True
277
valPassword.Enabled = True
278
valConfirm1.Enabled = True
279
valConfirm2.Enabled = True
280
PasswordRow.Visible = True
281
ConfirmPasswordRow.Visible = True
282
End If
283
284
ViewState("ModuleId") = Convert.ToString(_ModuleId)
285
ViewState("LabelColumnWidth") = _LabelColumnWidth
286
ViewState("ControlColumnWidth") = _ControlColumnWidth
287
288
End If
289
290
txtPassword.Attributes.Add("value", txtPassword.Text)
291
txtConfirm.Attributes.Add("value", txtConfirm.Text)
292
293
Catch exc As Exception 'Module failed to load
294
ProcessModuleLoadException(Me, exc)
295
End Try
296
End Sub
297
298
#End Region
299
300
End Class
301
302
End Namespace
303