forked from DNN-Connect/UserAccountUpdate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
View.ascx.vb
560 lines (448 loc) · 26.7 KB
/
View.ascx.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
'***********************************************************************************
' Connect UsersLibrary
'
' Copyright (C) 2013-2014 DNN-Connect Association, Philipp Becker
' http://dnn-connect.org
'
' This program is free software; you can redistribute it and/or
' modify it under the terms of the GNU General Public License
' as published by the Free Software Foundation; either version 2
' of the License, or (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
'
'***********************************************************************************
Imports DotNetNuke.Entities.Modules
Imports Connect.Libraries.UserManagement
Imports DotNetNuke.Entities.Users
Imports DotNetNuke.Security.Membership
Imports Telerik.Web.UI
Imports DotNetNuke.Security.Roles
Imports DotNetNuke.Entities.Profile
Namespace Connect.Modules.UserManagement.AccountUpdate
Partial Class View
Inherits ConnectUsersModuleBase
Implements IActionable
Private blnPageNeedsToPostback As Boolean = False
#Region "Event Handlers"
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
'DotNetNuke.Framework.AJAX.RegisterScriptManager()
ProcessFormTemplate(plhProfile, GetTemplate(ModuleTheme, Constants.TemplateName_Form, CurrentLocale, False), User)
Dim btnUpdate As Button = CType(FindControlRecursive(plhProfile, plhProfile.ID & "_" & Constants.ControlId_UpdateButton), Button)
If Not btnUpdate Is Nothing Then
AddHandler btnUpdate.Click, AddressOf btnUpdate_Click
If blnPageNeedsToPostback Then
DotNetNuke.Framework.AJAX.RegisterPostBackControl(btnUpdate)
End If
End If
Dim btnDelete As Button = CType(FindControlRecursive(plhProfile, plhProfile.ID & "_" & Constants.ControlId_DeleteButton), Button)
If Not btnDelete Is Nothing Then
AddHandler btnDelete.Click, AddressOf btnDelete_Click
End If
End Sub
Protected Sub Page_PreRender(sender As Object, e As System.EventArgs) Handles Me.PreRender
ManageRegionLabel(Me.plhProfile)
End Sub
Protected Sub btnUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs)
UpdateAccount()
End Sub
Protected Sub btnDelete_Click(ByVal sender As Object, ByVal e As System.EventArgs)
DeleteAccount()
End Sub
#End Region
#Region "Private Methods"
Private Sub UpdateAccount()
pnlSuccess.Visible = False
pnlError.Visible = False
Dim strMessages As New List(Of String)
Dim strUpdated As String = ""
Dim blnUpdateUsername As Boolean = False
Dim blnUpdateFirstname As Boolean = False
Dim blnUpdateLastname As Boolean = False
Dim blnUpdateDisplayname As Boolean = False
Dim blnUpdatePassword As Boolean = False
Dim blnUpdateEmail As Boolean = False
Dim blnUpdatePasswordQuestionAndAnswer As Boolean = False
Dim txtEmail As TextBox = CType(FindControlRecursive(plhProfile, plhProfile.ID & "_" & Constants.ControlId_Email), TextBox)
blnUpdateEmail = (Not txtEmail Is Nothing)
If blnUpdateEmail Then
If Not IsValidUserAttribute(Constants.User_Email, plhProfile) Then
strMessages.Add("Error_InvalidEmail")
AddErrorIndicator(Constants.User_Email, plhProfile)
Else
RemoveErrorIndicator(Constants.User_Email, plhProfile, True)
End If
End If
Dim txtPasswordCurrent As TextBox = CType(FindControlRecursive(plhProfile, plhProfile.ID & "_" & Constants.ControlId_PasswordCurrent), TextBox)
Dim txtPassword1 As TextBox = CType(FindControlRecursive(plhProfile, plhProfile.ID & "_" & Constants.ControlId_Password1), TextBox)
Dim txtPassword2 As TextBox = CType(FindControlRecursive(plhProfile, plhProfile.ID & "_" & Constants.ControlId_Password2), TextBox)
Dim txtPasswordQuestion As TextBox = CType(FindControlRecursive(plhProfile, plhProfile.ID & "_" & Constants.ControlId_PasswordQuestion), TextBox)
Dim txtPasswordAnswer As TextBox = CType(FindControlRecursive(plhProfile, plhProfile.ID & "_" & Constants.ControlId_PasswordAnswer), TextBox)
blnUpdatePassword = (Not txtPasswordCurrent Is Nothing AndAlso Not txtPassword1 Is Nothing AndAlso Not txtPassword2 Is Nothing)
blnUpdatePasswordQuestionAndAnswer = (Not txtPasswordQuestion Is Nothing AndAlso Not txtPasswordAnswer Is Nothing AndAlso Not txtPasswordCurrent Is Nothing)
If blnUpdatePassword Then
If txtPassword1.Text = "" AndAlso txtPassword2.Text = "" Then
blnUpdatePassword = False
End If
End If
If blnUpdatePassword Then
If Not IsValidUserAttribute(Constants.User_PasswordCurrent, plhProfile) Then
strMessages.Add("Error_MissingPasswordCurrent")
AddErrorIndicator(Constants.User_PasswordCurrent, plhProfile)
Else
RemoveErrorIndicator(Constants.User_PasswordCurrent, plhProfile, True)
End If
If Not IsValidUserAttribute(Constants.User_Password1, plhProfile) Then
strMessages.Add("Error_MissingPassword")
AddErrorIndicator(Constants.User_Password1, plhProfile)
Else
RemoveErrorIndicator(Constants.User_Password1, plhProfile, True)
End If
If Not IsValidUserAttribute(Constants.User_Password2, plhProfile) Then
strMessages.Add("Error_MissingPassword")
AddErrorIndicator(Constants.User_Password2, plhProfile)
Else
RemoveErrorIndicator(Constants.User_Password2, plhProfile, True)
End If
End If
If blnUpdatePasswordQuestionAndAnswer Then
If txtPasswordAnswer.Text = "" AndAlso txtPasswordQuestion.Text = "" Then
blnUpdatePasswordQuestionAndAnswer = False
End If
End If
If blnUpdatePasswordQuestionAndAnswer Then
If Not IsValidUserAttribute(Constants.User_Password1, plhProfile) Then
strMessages.Add("Error_MissingPasswordForQuestionAndAnswer")
AddErrorIndicator(Constants.User_Password1, plhProfile)
Else
RemoveErrorIndicator(Constants.User_Password1, plhProfile, True)
End If
If Not IsValidUserAttribute(Constants.User_PasswordAnswer, plhProfile) Then
strMessages.Add("Error_MissingPasswordAnswerAndQuestion")
AddErrorIndicator(Constants.User_PasswordAnswer, plhProfile)
Else
RemoveErrorIndicator(Constants.User_PasswordAnswer, plhProfile, True)
End If
If Not IsValidUserAttribute(Constants.User_PasswordQuestion, plhProfile) Then
strMessages.Add("Error_MissingPasswordAnswerAndQuestion")
AddErrorIndicator(Constants.User_PasswordQuestion, plhProfile)
Else
RemoveErrorIndicator(Constants.User_PasswordQuestion, plhProfile, True)
End If
End If
Dim txtFirstName As TextBox = CType(FindControlRecursive(plhProfile, plhProfile.ID & "_" & Constants.ControlId_Firstname), TextBox)
blnUpdateFirstname = (Not txtFirstName Is Nothing)
If blnUpdateFirstname Then
If Not IsValidUserAttribute(Constants.User_Firstname, plhProfile) Then
strMessages.Add("Error_MissingFirstname")
AddErrorIndicator(Constants.User_Firstname, plhProfile)
Else
RemoveErrorIndicator(Constants.User_Firstname, plhProfile, True)
End If
End If
Dim txtLastName As TextBox = CType(FindControlRecursive(plhProfile, plhProfile.ID & "_" & Constants.ControlId_Lastname), TextBox)
blnUpdateLastname = (Not txtLastName Is Nothing)
If blnUpdateLastname Then
If Not IsValidUserAttribute(Constants.User_Lastname, plhProfile) Then
strMessages.Add("Error_MissingLastname")
AddErrorIndicator(Constants.User_Lastname, plhProfile)
Else
RemoveErrorIndicator(Constants.User_Lastname, plhProfile, True)
End If
End If
If CompareFirstNameLastName AndAlso (blnUpdateFirstname And blnUpdateLastname) Then
If txtLastName.Text.ToLower.Trim = txtFirstName.Text.ToLower.Trim Then
strMessages.Add("Error_LastnameLikeFirstname")
AddErrorIndicator(Constants.User_Firstname, plhProfile)
End If
End If
Dim txtDisplayName As TextBox = CType(FindControlRecursive(plhProfile, plhProfile.ID & "_" & Constants.ControlId_Displayname), TextBox)
blnUpdateDisplayname = (Not txtDisplayName Is Nothing)
If blnUpdateDisplayname Then
If Not IsValidUserAttribute(Constants.User_Displayname, plhProfile) Then
strMessages.Add("Error_MissingDisplayName")
AddErrorIndicator(Constants.User_Displayname, plhProfile)
Else
RemoveErrorIndicator(Constants.User_Displayname, plhProfile, True)
End If
End If
Dim blnProfileErrorAdded As Boolean = False
For Each itemProp As String In GetPropertiesFromTempate(GetTemplate(ModuleTheme, Constants.TemplateName_Form, CurrentLocale, False))
Try
Dim prop As ProfilePropertyDefinition = ProfileController.GetPropertyDefinitionByName(PortalId, itemProp.Substring(2)) 'itemprop comes in the form U:Propertyname or P:Propertyname
If Not prop Is Nothing Then
If Not IsValidProperty(UserInfo, prop, plhProfile) Then
If blnProfileErrorAdded = False Then
strMessages.Add("Error_MissingProfileField")
blnProfileErrorAdded = True
End If
AddErrorIndicator(prop.PropertyDefinitionId.ToString, plhProfile)
Else
RemoveErrorIndicator(prop.PropertyDefinitionId.ToString, plhProfile, prop.Required)
End If
End If
Catch
End Try
Next
If strMessages.Count > 0 Then
Me.pnlError.Visible = True
Me.lblError.Text = "<ul>"
For Each strMessage As String In strMessages
lblError.Text += "<li>" & Localization.GetString(strMessage, LocalResourceFile) & "</li>"
Next
lblError.Text += "</ul>"
Exit Sub
End If
Dim oUser As UserInfo = UserController.GetCurrentUserInfo
Dim oldAccount As UserInfo = UserController.GetCurrentUserInfo
If blnUpdateEmail Then
If UsernameMode = UsernameUpdateMode.Email Then
Try
UserController.ChangeUsername(oUser.UserID, txtEmail.Text)
Catch ex As Exception
'in use already, do not update e-mail adress
Me.pnlError.Visible = True
Me.lblError.Text = "<ul><li>" & Localization.GetString("DuplicateEmail.Text", LocalResourceFile) & "</li></ul>"
Exit Sub
End Try
End If
oUser.Email = txtEmail.Text
If oUser.Email <> oldAccount.Email Then
strUpdated += Localization.GetString(Constants.User_Email, LocalResourceFile) & ", "
End If
End If
'try updating password
If blnUpdatePassword Then
If txtPassword1.Text = txtPassword2.Text Then
If UserController.ValidatePassword(txtPassword1.Text) Then
If Not UserController.ChangePassword(oUser, txtPasswordCurrent.Text, txtPassword1.Text) Then
Me.pnlError.Visible = True
Me.lblError.Text = "<ul><li>" & Localization.GetString("PasswordUpdateError", LocalResourceFile) & "</li></ul>"
Exit Sub
End If
strUpdated += Localization.GetString(Constants.User_Password1, LocalResourceFile) & ", "
Else
Dim MinLength As Integer = 0
Dim MinNonAlphaNumeric As Integer = 0
Try
MinLength = DotNetNuke.Security.Membership.MembershipProvider.Instance().MinPasswordLength
Catch
End Try
Try
MinNonAlphaNumeric = DotNetNuke.Security.Membership.MembershipProvider.Instance().MinNonAlphanumericCharacters
Catch
End Try
Dim strPolicy As String = String.Format(Localization.GetString("PasswordPolicy_MinLength", LocalResourceFile), MinLength.ToString)
If MinNonAlphaNumeric > 0 Then
strPolicy += String.Format(Localization.GetString("PasswordPolicy_MinNonAlphaNumeric", LocalResourceFile), MinNonAlphaNumeric.ToString)
End If
Me.pnlError.Visible = True
Me.lblError.Text = "<ul><li>" & String.Format(Localization.GetString("InvalidPassword", LocalResourceFile), strPolicy) & "</li></ul>"
Exit Sub
End If
Else
Me.pnlError.Visible = True
Me.lblError.Text = "<ul><li>" & Localization.GetString("PasswordsDontMatch.Text", LocalResourceFile) & "</li></ul>"
Exit Sub
End If
End If
If blnUpdatePasswordQuestionAndAnswer Then
UserController.ChangePasswordQuestionAndAnswer(oUser, txtPasswordCurrent.Text, txtPasswordQuestion.Text, txtPasswordAnswer.Text)
oUser.Membership.PasswordQuestion = txtPasswordQuestion.Text
oUser.Membership.PasswordAnswer = txtPasswordAnswer.Text
End If
UserController.UpdateUser(PortalId, oUser)
Dim propertiesCollection As New ProfilePropertyDefinitionCollection
UpdateProfileProperties(plhProfile, oUser, propertiesCollection, strUpdated, GetPropertiesFromTempate(GetTemplate(ModuleTheme, Constants.TemplateName_Form, CurrentLocale, False)))
oUser = ProfileController.UpdateUserProfile(oUser, propertiesCollection)
'make sure first and lastname are in sync with user and profile object
If blnUpdateFirstname = True Then
If oldAccount.FirstName <> txtFirstName.Text Then
strUpdated += Localization.GetString(Constants.User_Firstname, LocalResourceFile) & ", "
End If
oUser.Profile.FirstName = txtFirstName.Text
oUser.FirstName = txtFirstName.Text
Else
If oUser.Profile.FirstName <> "" Then
oUser.FirstName = oUser.Profile.FirstName
End If
End If
If blnUpdateLastname = True Then
If oldAccount.LastName <> txtLastName.Text Then
strUpdated += Localization.GetString(Constants.User_Lastname, LocalResourceFile) & ", "
End If
oUser.Profile.LastName = txtLastName.Text
oUser.LastName = txtLastName.Text
Else
If oUser.Profile.LastName <> "" Then
oUser.LastName = oUser.Profile.LastName
End If
End If
If blnUpdateDisplayname Then
If oldAccount.DisplayName <> txtDisplayName.Text Then
strUpdated += Localization.GetString(Constants.User_Displayname, LocalResourceFile) & ", "
End If
oUser.DisplayName = txtDisplayName.Text
Else
Select Case DisplaynameMode
Case DisplaynameUpdateMode.Email
If blnUpdateEmail Then
oUser.DisplayName = txtEmail.Text.Trim
End If
Case DisplaynameUpdateMode.FirstLetterLastname
If blnUpdateLastname AndAlso blnUpdateFirstname Then
oUser.DisplayName = oUser.FirstName.Trim.Substring(0, 1) & ". " & oUser.LastName
End If
Case DisplaynameUpdateMode.FirstnameLastname
If blnUpdateLastname AndAlso blnUpdateFirstname Then
oUser.DisplayName = oUser.FirstName & " " & oUser.LastName
End If
Case DisplaynameUpdateMode.Lastname
If blnUpdateLastname Then
oUser.DisplayName = oUser.LastName
End If
End Select
End If
'update profile
UserController.UpdateUser(PortalId, oUser)
'add to role
If AddToRoleOnSubmit <> Null.NullInteger Then
Try
Dim rc As New RoleController
If AddToRoleStatus.ToLower = "pending" Then
rc.AddUserRole(PortalId, oUser.UserID, AddToRoleOnSubmit, RoleStatus.Pending, False, Date.Now, Null.NullDate)
Else
rc.AddUserRole(PortalId, oUser.UserID, AddToRoleOnSubmit, RoleStatus.Approved, False, Date.Now, Null.NullDate)
End If
Catch
End Try
End If
'remove from role
If RemoveFromRoleOnSubmit <> Null.NullInteger Then
Try
Dim rc As New RoleController
Dim r As RoleInfo = rc.GetRole(RemoveFromRoleOnSubmit, PortalId)
RoleController.DeleteUserRole(oUser, r, PortalSettings, False)
Catch
End Try
End If
Dim chkTest As CheckBox = CType(FindMembershipControlsRecursive(plhProfile, plhProfile.ID & "_" & Constants.ControlId_RoleMembership), CheckBox)
If Not chkTest Is Nothing Then
'at least on role membership checkbox found. Now lookup roles that could match
Dim rc As New RoleController
Dim roles As ArrayList
roles = rc.GetPortalRoles(PortalId)
For Each objRole As RoleInfo In roles
Dim blnPending As Boolean = False
Dim chkRole As CheckBox = CType(FindControlRecursive(plhProfile, plhProfile.ID & "_" & Constants.ControlId_RoleMembership & objRole.RoleName.Replace(" ", "")), CheckBox)
If chkRole Is Nothing Then
chkRole = CType(FindControlRecursive(plhProfile, plhProfile.ID & "_" & Constants.ControlId_RoleMembership & objRole.RoleName.Replace(" ", "") & "_Pending"), CheckBox)
blnPending = True
End If
If Not chkRole Is Nothing Then
If blnPending Then
rc.AddUserRole(PortalId, oUser.UserID, objRole.RoleID, RoleStatus.Pending, False, Date.Now, Null.NullDate)
Else
rc.AddUserRole(PortalId, oUser.UserID, objRole.RoleID, RoleStatus.Approved, False, Date.Now, Null.NullDate)
End If
End If
Next
End If
'notify admin
If NotifyRole <> "" AndAlso strUpdated.Length > 0 Then
Dim strBody As String = GetTemplate(ModuleTheme, Constants.TemplateName_EmailToAdmin, CurrentLocale, False)
strBody = strBody.Replace("[PORTALURL]", PortalSettings.PortalAlias.HTTPAlias)
strBody = strBody.Replace("[PORTALNAME]", PortalSettings.PortalName)
strBody = strBody.Replace("[USERID]", oUser.UserID)
strBody = strBody.Replace("[DISPLAYNAME]", oUser.DisplayName)
If MembershipProvider.Instance().PasswordRetrievalEnabled Then
strBody = strBody.Replace("[PASSWORD]", MembershipProvider.Instance().GetPassword(oUser, ""))
End If
strBody = strBody.Replace("[USERNAME]", oUser.Username)
strBody = strBody.Replace("[FIRSTNAME]", oUser.FirstName)
strBody = strBody.Replace("[LASTNAME]", oUser.LastName)
strBody = strBody.Replace("[UPDATED]", strUpdated.Substring(0, strUpdated.LastIndexOf(",")).Replace(":", ""))
strBody = strBody.Replace("[USERURL]", NavigateURL(UsermanagementTab, "", "uid=" & oUser.UserID.ToString, "RoleId=" & PortalSettings.RegisteredRoleId.ToString))
strBody = strBody.Replace("[RECIPIENTUSERID]", oUser.UserID.ToString)
strBody = strBody.Replace("[USERID]", oUser.UserID.ToString)
Dim ctrlRoles As New RoleController
Dim NotificationUsers As ArrayList = ctrlRoles.GetUsersByRoleName(PortalId, NotifyRole)
For Each NotificationUser As UserInfo In NotificationUsers
Try
strBody = strBody.Replace("[RECIPIENTUSERID]", NotificationUser.UserID.ToString)
strBody = strBody.Replace("[USERID]", NotificationUser.UserID.ToString)
DotNetNuke.Services.Mail.Mail.SendMail(PortalSettings.Email, NotificationUser.Email, "", String.Format(Localization.GetString("NotifySubject_ProfileUpdate.Text", LocalResourceFile), PortalSettings.PortalName), strBody, "", "HTML", "", "", "", "")
Catch
End Try
Next
End If
If NotifyUser AndAlso strUpdated.Length > 0 Then
Dim strBody As String = GetTemplate(ModuleTheme, Constants.TemplateName_EmailToUser, CurrentLocale, False)
strBody = strBody.Replace("[PORTALURL]", PortalSettings.PortalAlias.HTTPAlias)
strBody = strBody.Replace("[PORTALNAME]", PortalSettings.PortalName)
strBody = strBody.Replace("[USERID]", oUser.UserID)
strBody = strBody.Replace("[DISPLAYNAME]", oUser.DisplayName)
If MembershipProvider.Instance().PasswordRetrievalEnabled Then
strBody = strBody.Replace("[PASSWORD]", MembershipProvider.Instance().GetPassword(oUser, ""))
End If
strBody = strBody.Replace("[USERNAME]", oUser.Username)
strBody = strBody.Replace("[FIRSTNAME]", oUser.FirstName)
strBody = strBody.Replace("[LASTNAME]", oUser.LastName)
strBody = strBody.Replace("[UPDATED]", strUpdated.Substring(0, strUpdated.LastIndexOf(",")).Replace(":", ""))
strBody = strBody.Replace("[USERURL]", NavigateURL(TabId))
strBody = strBody.Replace("[RECIPIENTUSERID]", oUser.UserID.ToString)
strBody = strBody.Replace("[USERID]", oUser.UserID.ToString)
Try
DotNetNuke.Services.Mail.Mail.SendMail(PortalSettings.Email, oUser.Email, "", String.Format(Localization.GetString("NotifySubject_UserDetails", LocalResourceFile), PortalSettings.PortalName), strBody, "", "HTML", "", "", "", "")
Catch
End Try
End If
lblSucess.Text = "<ul><li>" & Localization.GetString("AccountUpdateSuccess.Text", LocalResourceFile) & "</li></ul>"
pnlSuccess.Visible = True
If ExternalInterface <> Null.NullString Then
Dim objInterface As Object = Nothing
If ExternalInterface.Contains(",") Then
Dim strClass As String = ExternalInterface.Split(Char.Parse(","))(0).Trim
Dim strAssembly As String = ExternalInterface.Split(Char.Parse(","))(1).Trim
objInterface = System.Activator.CreateInstance(strAssembly, strClass).Unwrap
End If
If Not objInterface Is Nothing Then
CType(objInterface, Interfaces.iAccountUpdate).FinalizeAccountUpdate(Server, Response, Request, oUser)
End If
End If
If Not Request.QueryString("ReturnURL") Is Nothing Then
Response.Redirect(Server.UrlDecode(Request.QueryString("ReturnURL")), True)
End If
If RedirectAfterSubmit <> Null.NullInteger Then
Response.Redirect(NavigateURL(RedirectAfterSubmit))
End If
End Sub
Private Sub DeleteAccount()
Dim oUser As UserInfo = UserController.GetCurrentUserInfo
If UserController.DeleteUser(oUser, False, False) Then
lblSucess.Text = "<ul><li>" & Localization.GetString("AccountDeleted.Text", LocalResourceFile) & "</li></ul>"
pnlSuccess.Visible = True
Else
lblError.Text = "<ul><li>" & Localization.GetString("AccountNotDeleted.Text", LocalResourceFile) & "</li></ul>"
pnlError.Visible = True
End If
End Sub
#End Region
#Region "Optional Interfaces"
Public ReadOnly Property ModuleActions() As Entities.Modules.Actions.ModuleActionCollection Implements Entities.Modules.IActionable.ModuleActions
Get
Dim Actions As New Entities.Modules.Actions.ModuleActionCollection
Actions.Add(GetNextActionID, Localization.GetString("ManageTemplates.Action", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.AddContent, "", "", EditUrl("ManageTemplates"), False, DotNetNuke.Security.SecurityAccessLevel.Edit, True, False)
Return Actions
End Get
End Property
#End Region
End Class
End Namespace