diff --git a/App_LocalResources/Settings.ascx.resx b/App_LocalResources/Settings.ascx.resx
new file mode 100644
index 0000000..253cd63
--- /dev/null
+++ b/App_LocalResources/Settings.ascx.resx
@@ -0,0 +1,195 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Registration Settings
+
+
+ Username Mode:
+
+
+ Select how to create usernames. Note that your template must reflect this setting by using the correct tokens!
+
+
+ Let the user select
+
+
+ Create from E-Mail Address
+
+
+ Create in the form [Firstletter from Firstname + .Lastname]
+
+
+ Create in the form [Firstletter from Firstname + .Lastname]
+
+
+ Create in the form [Firstname.Lastname]
+
+
+ Let the user select
+
+
+ Create from E-Mail Address
+
+
+ Create from Lastname
+
+
+ You may optionally select a role that the user is being added to once registering through this module instance
+
+
+ Add to Role on Submit:
+
+
+ Select how to create displaynames. Note that your template must reflect this setting by using the correct tokens!
+
+
+ Displayname Mode:
+
+
+ You may optionally select a role where all members of that role receive an e-mail notification on submitting the form
+
+
+ Send confirmation role to select role:
+
+
+ Select wether the user receives an e-mail verification on submitting the form
+
+
+ Send confirmation to user:
+
+
+ Select the page that the user gets redirected to after submitting the form
+
+
+ Redirect after Submit:
+
+
+ Select the page where the usermanagement module resides on. This setting is being used for generating the link to the user's details in the administrator notification e-mail
+
+
+ Usermanagement Page:
+
+
+ Create in the form [Firstname.Lastname]
+
+
+ Create from Lastname
+
+
\ No newline at end of file
diff --git a/App_LocalResources/Templates.ascx.resx b/App_LocalResources/Templates.ascx.resx
new file mode 100644
index 0000000..c48a48b
--- /dev/null
+++ b/App_LocalResources/Templates.ascx.resx
@@ -0,0 +1,207 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ <p>Use the template managing control to edit the templates used by this module</p>
+
+
+ Manage Templates
+
+
+ Back to Registration Form
+
+
+ Copy Selected
+
+
+ Delete Selected
+
+
+ Save Templates and Exit
+
+
+ This will delete the selected theme. Are you sure?
+
+
+ An error occured while creating a copy of the selected theme. Make sure you have setup write permissions correctly in the file system of this installation
+
+
+ An error occured while saving the selected theme. Make sure you have setup write permissions correctly in the file system of this installation and that none of the files in the theme is opened by another program.
+
+
+ An error occured while deleting the selected theme. Make sure you have setup write permissions correctly in the file system of this installation and that none of the files in the theme is opened by another program.
+
+
+ E-Mail to Admin
+
+
+ Email to User
+
+
+ E-Mail to User (private)
+
+
+ E-Mail to User (verified)
+
+
+ Registration Form
+
+
+ A folder with that name could not be created. Please provide a valid name for the theme.
+
+
+ You must fill in each template
+
+
+ You must enter a name for the new theme
+
+
+ Note that password retrieval is disabled in this installation. Make sure your e-mail templates take this into account (e.g. dot not use the [password] token).
+
+
+ Also note that this system requires members to maintain a question and answer. Your form template therefor should include those fields.
+
+
+ This theme is being used by this module instance. Deleting this them will cause the module to use the default theme.
+
+
+ Enter a name to better identify the template set
+
+
+ Theme Name:
+
+
+ Select the theme used by this module. You may create a new theme based on the currently selected one.
+
+
+ Select Theme
+
+
+ Use the selected theme in this module instance
+
+
+ Use selected theme
+
+
+ Select the locale that you want to edit
+
+
+ Template Locale:
+
+
\ No newline at end of file
diff --git a/App_LocalResources/View.ascx.resx b/App_LocalResources/View.ascx.resx
new file mode 100644
index 0000000..3631256
--- /dev/null
+++ b/App_LocalResources/View.ascx.resx
@@ -0,0 +1,318 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ The account needs to be authorized
+
+
+ Create Account
+
+
+ Create new Account
+
+
+ The account could not be created. Please inform the site administrator. The server responded with "{0}"
+
+
+ An account with this e-mail address is already registered on this site
+
+
+ Enter your e-mail address
+
+
+ E-Mail Address:
+
+
+ You must fill in a valid e-mail address
+
+
+ You must fill in a displayname
+
+
+ You must fill in your firstname
+
+
+ You must fill in your lastname
+
+
+ You must fill in a password
+
+
+ You must repeat the password
+
+
+ You must fill in a password answer
+
+
+ You must fill in in a password question
+
+
+ You must fill in all required profile fields
+
+
+ You must fill in a username
+
+
+ You must fill in all required fields
+
+
+ Enter your firstname
+
+
+ Firstname:
+
+
+ The selected password does not meet our password policy. {0}
+
+
+ This username is not valid. Most likely it has been taken already.
+
+
+ Enter your lastname
+
+
+ Lastname:
+
+
+ Login
+
+
+ Login with existing account
+
+
+ Enter the e-mail address that you have asscoiated with our website
+
+
+ E-Mail Address:
+
+
+ You could not be authenticated. Make sure you have entered the correct username and password. Note that passwords are case-sensitive.
+
+
+ Enter your password
+
+
+ Password:
+
+
+ If checked we will store a cookie on your computer that keeps you logged on to this website until you log off.
+
+
+ Remember me on this computer
+
+
+ Your account is locked out due to too many login attempts.
+
+
+ Enter your username
+
+
+ Username:
+
+
+ Your accout is not approved yet.
+
+
+ I lost my password
+
+
+ Manage Templates
+
+
+ The account registration module allows site visitors to register on your site. Since the registration form is templating based, you have full control over the visuals in this module.
+
+
+ This name already exists
+
+
+ No further action required
+
+
+ [{0}] - Your User Account
+
+
+ [{0}] - New Account Registration
+
+
+ Enter a password. {0}.
+
+
+ Password:
+
+
+ Re-Enter your password
+
+
+ Confirm Password:
+
+
+ Enter the answer to the question above. You may only reset your password later on once you enter the correct answer to the question above!
+
+
+ Security Answer:
+
+
+ A valid passsword must contain at least {0} chars
+
+
+ , {0} of those must be non-alpha-numeric
+
+
+ Enter a question that we ask you once you need to reset your password in case you have forgotten the password
+
+
+ Security Question:
+
+
+ The passwords do not match!
+
+
+ Your account has been created sucessfully. <a href="{0}">Proceed</a>
+
+
+ private
+
+
+ public
+
+
+ verified
+
+
+ The templates for this instance are not setup correctly. Please let the site administrator know.
+
+
+ Enter a username that you would like to use for logging on to our website
+
+
+ Username:
+
+
+ This username is not valid. Most likely it has been taken already.
+
+
+ Username is valid
+
+
+ Password is valid
+
+
+ The e-mail address needs to be verified
+
+
\ No newline at end of file
diff --git a/AssemblyInfo.vb b/AssemblyInfo.vb
new file mode 100644
index 0000000..60f6adc
--- /dev/null
+++ b/AssemblyInfo.vb
@@ -0,0 +1,35 @@
+Imports System
+Imports System.Reflection
+Imports System.Runtime.InteropServices
+
+' General Information about an assembly is controlled through the following
+' set of attributes. Change these attribute values to modify the information
+' associated with an assembly.
+
+' Review the values of the assembly attributes
+
+
+
+
+
+
+
+
+
+
+'The following GUID is for the ID of the typelib if this project is exposed to COM
+
+
+' Version information for an assembly consists of the following four values:
+'
+' Major Version
+' Minor Version
+' Build Number
+' Revision
+'
+' You can specify all the values or you can default the Build and Revision Numbers
+' by using the '*' as shown below:
+'
+
+
+
diff --git a/BuildScripts/MSBuild.Community.Tasks.Targets b/BuildScripts/MSBuild.Community.Tasks.Targets
new file mode 100644
index 0000000..5e1de4c
--- /dev/null
+++ b/BuildScripts/MSBuild.Community.Tasks.Targets
@@ -0,0 +1,105 @@
+
+
+
+
+
+ $(MSBuildProjectDirectory)\BuildScripts
+ ..\..\..\bin
+ $(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BuildScripts/ModulePackage.targets b/BuildScripts/ModulePackage.targets
new file mode 100644
index 0000000..b1df696
--- /dev/null
+++ b/BuildScripts/ModulePackage.targets
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Connect_AccountRegistration.dnn b/Connect_AccountRegistration.dnn
new file mode 100644
index 0000000..4ef6535
--- /dev/null
+++ b/Connect_AccountRegistration.dnn
@@ -0,0 +1,109 @@
+
+
+
+ Connect: AccountRegistration
+ A community module that handles account registrations and login in DNN
+ Images/icon_extensions.gif
+
+ Philipp Becker
+ DNN-Connect
+ http://dnn-connect.org
+ connectmodules.usermanagement@dnn-connect.org
+
+
+
+
+
+ 07.01.00
+
+
+
+
+
+
+ DesktopModules\Connect\AccountRegistration
+
+
+
+
+
+
+
+ DesktopModules/Connect/AccountRegistration
+
+ Resources.zip
+
+
+
+
+
+
+ Connect AccountRegistration
+ AccountRegistration
+
+
+
+
+ Connect AccountRegistration
+ 0
+
+
+
+ DesktopModules/Connect/AccountRegistration/View.ascx
+ False
+
+ View
+
+
+ 0
+
+
+ ManageTemplates
+ DesktopModules/Connect/AccountRegistration/Templates.ascx
+ False
+ Manage Templates
+ Edit
+
+
+ 0
+
+
+ Settings
+ DesktopModules/Connect/AccountRegistration/Settings.ascx
+ False
+ Registration Settings
+ Edit
+
+
+ 0
+
+
+
+
+
+
+
+
+
+ bin
+
+ Connect.Modules.AccountRegistration.dll
+
+
+ Connect.Libraries.UserManagement.dll
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Connect_AccountRegistration.vbproj b/Connect_AccountRegistration.vbproj
new file mode 100644
index 0000000..48fbda1
--- /dev/null
+++ b/Connect_AccountRegistration.vbproj
@@ -0,0 +1,201 @@
+
+
+
+
+ 10.0
+ $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
+
+
+
+
+
+
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {8C863196-4C19-4117-9DE0-55DA8EBE7ADB}
+ {349c5851-65df-11da-9384-00065b846f21};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}
+ Library
+
+
+ Connect.Modules.AccountRegistration
+
+
+ 4.0
+ On
+ Binary
+ Off
+ On
+
+
+ v4.0
+ false
+
+
+
+ true
+ full
+ true
+ true
+ ..\..\..\bin\
+ Connect.Modules.AccountRegistration.xml
+ 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355
+ AllRules.ruleset
+
+
+ pdbonly
+ false
+ true
+ true
+ ..\..\..\bin\
+ Connect.Modules.AccountRegistration.xml
+ 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355
+ AllRules.ruleset
+
+
+
+ ..\..\..\bin\DotNetNuke.dll
+
+
+ False
+ ..\..\..\bin\DotNetNuke.Web.dll
+
+
+ False
+ ..\..\..\bin\DotNetNuke.WebUtility.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ False
+ ..\..\..\bin\Telerik.Web.UI.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Templates.ascx
+
+
+ Templates.ascx
+ ASPXCodeBehind
+
+
+ Settings.ascx
+
+
+ Settings.ascx
+ ASPXCodeBehind
+
+
+ View.ascx
+
+
+ View.ascx
+ ASPXCodeBehind
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {4F9B447A-D262-439A-822E-34849356966E}
+ Connect_Users
+
+
+
+
+
+
+
+
+
+ True
+ True
+ 62597
+ /
+ http://dnn7/DesktopModules/Connect/AccountRegistration
+ True
+ http://dnn7/
+ False
+ False
+
+
+ False
+
+
+
+
+
+ zip
+ Connect_AccountRegistration
+ Connect_AccountRegistration
+ $(MSBuildProjectDirectory)\BuildScripts
+
+
+
+
+
\ No newline at end of file
diff --git a/Documentation/Documentation.css b/Documentation/Documentation.css
new file mode 100644
index 0000000..62d028e
--- /dev/null
+++ b/Documentation/Documentation.css
@@ -0,0 +1,82 @@
+
+Body, A
+{
+ font-family: Verdana, Arial, Helvetica, Sans Serif;
+ font-size: 10pt;
+ font-weight: normal;
+ color: black;
+}
+
+Body
+{
+ background-color: white;
+ margin-left:25px;
+}
+
+H1
+{
+ font-size: 2.0em;
+ font-weight: bold;
+ color: #75808A;
+ text-decoration: underline;
+}
+
+H2 {
+ font-size: 1.6em;
+ font-weight: bold;
+ color: #75808A;
+}
+
+H3 {
+ font-size: 1.4em;
+ font-weight: bold;
+ color: #75808A;
+}
+
+H4 {
+ font-size: 1.2em;
+ font-weight: bold;
+ color: #75808A;
+}
+
+H5 {
+ font-size: 1.1em;
+ font-weight: bold;
+ color: #75808A;
+}
+
+H6 {
+ font-size: 1.0em;
+ font-weight: bold;
+ color: #75808A;
+}
+
+A:link {
+ font-size: 1.0em;
+ text-decoration: underline;
+ color: #0000cc;
+}
+
+A:visited {
+ font-size: 1.0em;
+ text-decoration: underline;
+ color: #0000cc;
+}
+
+A:active {
+ font-size: 1.0em;
+ text-decoration: underline;
+ color: #0000cc;
+}
+
+A:hover {
+ font-size: 1.0em;
+ text-decoration: underline;
+ color: #cc0000;
+}
+
+HR {
+ color: dimgrey;
+ height:1pt;
+ text-align:left
+}
diff --git a/Documentation/Documentation.html b/Documentation/Documentation.html
new file mode 100644
index 0000000..6994bdd
--- /dev/null
+++ b/Documentation/Documentation.html
@@ -0,0 +1,67 @@
+
+
+
+ DotNetNuke Corporation Template
+
+
+
+
+ When creating a project using this template, you should have named your project
+ simply "ModuleName", not "DotNetNuke CorporationModuleName". If you didn't do this, the
+ easiest thing to do is close the solution, delete the folder from your DesktopModules
+ folder, then create a new project.
+
+ Due to limitations in the templating capabilities of Visual Studio, you will need
+ to make some minor changes, and double check a few things, before you package this module.
+
+
BEFORE checking the
+ module into your source control environment check the following.
+
Edit the Project properties by double-clicking on the Properties folder in Solution
+ Explorer
+
On the Application tab:
+
+
Make sure the Assembly name textbox is set to "Connect_AccountRegistration".
+
Make sure the Default namespace is set to "DotNetNuke.Modules.Connect_AccountRegistration".
+
+
+
On the Web tab:
+
+
Under 'Start Action', make sure to set your Start URL to the correct site (ex: http://dnndev/).
+
Under 'Servers', make sure to "Use IIS Web Server" with a project url of http://dnndev/desktopmodules/Connect_AccountRegistration
+ and an Override application root URL of http://dnndev/
+
+
+
+
+ Steps after your project is setup.
+
+
To Build and Package your Module you need to change to Release mode and then
+ simply choose Build from the Build menu. The MSBuild scripts will do the packaging
+ process for you. The packaging process creates an INSTALL and a SOURCE package in
+ the PACKAGES folder within your desktopmodule/modulename folder.
+
Installing your module in your development DotNetNuke instance is easy.Take the
+ SOURCE ZIP file that is created in the Packages folder, upload that using the Host/Extensions
+ page, Installation Wizard.
+
After you've done a release for your module (typically deploying to an environment
+ outside of your development environment) you should change the Version number, you
+ need to do this in two places, the assemblyinfo file, and the .DNN manifest file.
+ Next time you build the module in release mode you will get a new package (using
+ the version number) created.
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+
+ * Neither the name of dnnWerk nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
\ No newline at end of file
diff --git a/Providers/DataProviders/SqlDataProvider/01.00.00.SqlDataProvider b/Providers/DataProviders/SqlDataProvider/01.00.00.SqlDataProvider
new file mode 100644
index 0000000..2e3f11e
--- /dev/null
+++ b/Providers/DataProviders/SqlDataProvider/01.00.00.SqlDataProvider
@@ -0,0 +1,213 @@
+-- no longer needed
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Users_ListByPortal]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_Users_ListByPortal]
+GO
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Users_ListByRole]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_Users_ListByRole]
+GO
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Users_RestoreUser]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_Users_RestoreUser]
+GO
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Users_HardDeleteUser]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_Users_HardDeleteUser]
+GO
+
+-- delete for recreation
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Users_GetValueList]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_Users_GetValueList]
+GO
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_GetUserList]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_GetUserList]
+GO
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Users_AddReport]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_Users_AddReport]
+GO
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Users_GetReport]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_Users_GetReport]
+GO
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Users_GetReports]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_Users_GetReports]
+GO
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Users_UpdateReport]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_Users_UpdateReport]
+GO
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Users_DeleteReport]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_Users_DeleteReport]
+GO
+
+
+-- create tables
+IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'{databaseOwner}[{objectQualifier}Connect_UsersReports]') AND OBJECTPROPERTY(id, N'IsTable') = 1)
+ BEGIN
+ CREATE TABLE {databaseOwner}[{objectQualifier}Connect_UsersReports]
+ (
+ [ReportId] [int] NOT NULL IDENTITY(0, 1),
+ [PortalId] [int] NOT NULL,
+ [FriendlyName] nvarchar(256) NULL,
+ [SQL] nvarchar(max) NULL,
+ [NeedsParameters] [bit] NULL
+ )
+
+ ALTER TABLE {databaseOwner}{objectQualifier}Connect_UsersReports ADD CONSTRAINT
+ PK_{objectQualifier}Connect_UsersReports PRIMARY KEY CLUSTERED
+ (
+ ReportId
+ )
+ ALTER TABLE {databaseOwner}{objectQualifier}Connect_UsersReports WITH NOCHECK ADD CONSTRAINT
+ FK_{objectQualifier}Connect_UsersReports_{objectQualifier}Portals FOREIGN KEY
+ (
+ PortalId
+ ) REFERENCES {databaseOwner}{objectQualifier}Portals
+ (
+ PortalId
+ ) ON UPDATE NO ACTION
+ ON DELETE CASCADE
+ END
+GO
+
+-- create sprocs
+
+CREATE PROCEDURE {databaseOwner}[{objectQualifier}Connect_Users_GetValueList]
+ @PropertyDefinitionId int
+AS
+SELECT
+ [PropertyValue]
+FROM
+ {objectQualifier}UserProfile
+WHERE
+ (PropertyDefinitionID = @PropertyDefinitionID)
+GO
+
+CREATE PROCEDURE {databaseOwner}[{objectQualifier}Connect_Users_AddReport]
+ @PortalId int,
+ @FriendlyName nvarchar(256),
+ @SQL nvarchar(max),
+ @NeedsParameters bit
+as
+ INSERT INTO {databaseOwner}[{objectQualifier}Connect_UsersReports]
+ ([PortalId],[FriendlyName],[SQL],[NeedsParameters])
+ VALUES
+ (@PortalId,@FriendlyName,@SQL,@NeedsParameters)
+ RETURN SCOPE_IDENTITY()
+GO
+
+CREATE PROCEDURE {databaseOwner}[{objectQualifier}Connect_Users_UpdateReport]
+ @ReportId int,
+ @PortalId int,
+ @FriendlyName nvarchar(256),
+ @SQL nvarchar(max),
+ @NeedsParameters bit
+as
+ UPDATE
+ {databaseOwner}[{objectQualifier}Connect_UsersReports]
+ SET
+ [PortalId] = @PortalId,
+ [FriendlyName] = @FriendlyName,
+ [SQL] = @SQL,
+ [NeedsParameters] = @NeedsParameters
+ WHERE
+ [ReportId] = @ReportId
+GO
+
+CREATE PROCEDURE {databaseOwner}[{objectQualifier}Connect_Users_GetReport]
+ @ReportId int
+as
+ SELECT
+ *
+ FROM
+ {databaseOwner}[{objectQualifier}Connect_UsersReports]
+ WHERE
+ [ReportId] = @ReportId
+GO
+
+CREATE PROCEDURE {databaseOwner}[{objectQualifier}Connect_Users_GetReports]
+ @PortalId int
+as
+ SELECT
+ *
+ FROM
+ {databaseOwner}[{objectQualifier}Connect_UsersReports]
+ WHERE
+ [PortalId] = @PortalId
+GO
+
+CREATE PROCEDURE {databaseOwner}[{objectQualifier}Connect_Users_DeleteReport]
+ @ReportId int
+as
+ DELETE FROM
+ {databaseOwner}[{objectQualifier}Connect_UsersReports]
+ WHERE
+ [ReportId] = @ReportId
+GO
+
+CREATE PROCEDURE {databaseOwner}[{objectQualifier}Connect_GetUserList]
+ @RoleId int,
+ @PortalId int,
+ @SearchText nvarchar(256),
+ @SearchCols nvarchar(256),
+ @ShowDeleted bit
+as
+
+SELECT DISTINCT
+ U.[UserID],
+ U.[Username],
+ U.[FirstName],
+ U.[LastName],
+ U.[DisplayName],
+ UP.[CreatedDate],
+ U.[Email],
+ UP.[PortalId],
+ (Select Top 1 [PropertyValue] From {databaseOwner}[{objectQualifier}UserProfile] Inner Join {databaseOwner}[{objectQualifier}ProfilePropertyDefinition] On {databaseOwner}[{objectQualifier}ProfilePropertyDefinition].[PropertyDefinitionID] = {databaseOwner}[{objectQualifier}UserProfile].[PropertyDefinitionID] Where {databaseOwner}[{objectQualifier}ProfilePropertyDefinition].[PropertyName] = 'PostalCode' and {databaseOwner}[{objectQualifier}UserProfile].[UserID] = U.[UserID]) as [PostalCode],
+ (Select Top 1 [PropertyValue] From {databaseOwner}[{objectQualifier}UserProfile] Inner Join {databaseOwner}[{objectQualifier}ProfilePropertyDefinition] On {databaseOwner}[{objectQualifier}ProfilePropertyDefinition].[PropertyDefinitionID] = {databaseOwner}[{objectQualifier}UserProfile].[PropertyDefinitionID] Where {databaseOwner}[{objectQualifier}ProfilePropertyDefinition].[PropertyName] = 'City' and {databaseOwner}[{objectQualifier}UserProfile].[UserID] = U.[UserID]) as [City],
+ (Select Top 1 [PropertyValue] From {databaseOwner}[{objectQualifier}UserProfile] Inner Join {databaseOwner}[{objectQualifier}ProfilePropertyDefinition] On {databaseOwner}[{objectQualifier}ProfilePropertyDefinition].[PropertyDefinitionID] = {databaseOwner}[{objectQualifier}UserProfile].[PropertyDefinitionID] Where {databaseOwner}[{objectQualifier}ProfilePropertyDefinition].[PropertyName] = 'Country' and {databaseOwner}[{objectQualifier}UserProfile].[UserID] = U.[UserID]) as [Country],
+ (Select Top 1 [PropertyValue] From {databaseOwner}[{objectQualifier}UserProfile] Inner Join {databaseOwner}[{objectQualifier}ProfilePropertyDefinition] On {databaseOwner}[{objectQualifier}ProfilePropertyDefinition].[PropertyDefinitionID] = {databaseOwner}[{objectQualifier}UserProfile].[PropertyDefinitionID] Where {databaseOwner}[{objectQualifier}ProfilePropertyDefinition].[PropertyName] = 'Telephone' and {databaseOwner}[{objectQualifier}UserProfile].[UserID] = U.[UserID]) as [Telephone],
+ (Select Top 1 [PropertyValue] From {databaseOwner}[{objectQualifier}UserProfile] Inner Join {databaseOwner}[{objectQualifier}ProfilePropertyDefinition] On {databaseOwner}[{objectQualifier}ProfilePropertyDefinition].[PropertyDefinitionID] = {databaseOwner}[{objectQualifier}UserProfile].[PropertyDefinitionID] Where {databaseOwner}[{objectQualifier}ProfilePropertyDefinition].[PropertyName] = 'Cell' and {databaseOwner}[{objectQualifier}UserProfile].[UserID] = U.[UserID]) as [Cell],
+ (Select Top 1 [PropertyValue] From {databaseOwner}[{objectQualifier}UserProfile] Inner Join {databaseOwner}[{objectQualifier}ProfilePropertyDefinition] On {databaseOwner}[{objectQualifier}ProfilePropertyDefinition].[PropertyDefinitionID] = {databaseOwner}[{objectQualifier}UserProfile].[PropertyDefinitionID] Where {databaseOwner}[{objectQualifier}ProfilePropertyDefinition].[PropertyName] = 'PreferredLocale' and {databaseOwner}[{objectQualifier}UserProfile].[UserID] = U.[UserID]) as [PreferredLocale]
+FROM
+ {databaseOwner}[{objectQualifier}Users] U
+ INNER JOIN {databaseOwner}[{objectQualifier}UserPortals] UP on UP.[UserId] = U.[UserID]
+ INNER JOIN {databaseOwner}[{objectQualifier}UserProfile] P on p.[UserID] = U.[UserID]
+ INNER JOIN {databaseOwner}[{objectQualifier}ProfilePropertyDefinition] PD on PD.[PropertyDefinitionID] = p.[PropertyDefinitionID]
+WHERE
+ UP.[PortalId] = @PortalId
+AND
+ ((UP.[IsDeleted] = 0 and @ShowDeleted = 0) or (UP.[IsDeleted] = 1 and @ShowDeleted = 1))
+AND
+ (
+ (
+ (P.[PropertyValue] Like '%' + @SearchText + '%' And (PatIndex('%' + Pd.[PropertyName] + ',%' , @SearchCols) > 0))
+ or
+ (
+ (U.[FirstName] Like '%' + @SearchText + '%' and PATINDEX('%FirstName%', @SearchCols) > 0)
+ OR
+ (U.[LastName] Like '%' + @SearchText + '%' and PATINDEX('%LastName%', @SearchCols) > 0)
+ OR
+ (U.[DisplayName] Like '%' + @SearchText + '%' and PATINDEX('%DisplayName%', @SearchCols) > 0)
+ OR
+ (U.[Email] Like '%' + @SearchText + '%' and PATINDEX('%Email%', @SearchCols) > 0)
+ OR
+ (U.[Username] Like '%' + @SearchText + '%' and PATINDEX('%Username%', @SearchCols) > 0)
+ )
+ )
+ or @SearchText is Null
+ )
+AND
+ (
+ (U.[UserID] in(Select [UserId] from {databaseOwner}[{objectQualifier}UserRoles] where [RoleID] = @RoleId))
+ or
+ (@ShowDeleted = 1)
+ )
+Order By
+ UP.[CreatedDate] desc
+GO
diff --git a/Providers/DataProviders/SqlDataProvider/Uninstall.SqlDataProvider b/Providers/DataProviders/SqlDataProvider/Uninstall.SqlDataProvider
new file mode 100644
index 0000000..0b482d8
--- /dev/null
+++ b/Providers/DataProviders/SqlDataProvider/Uninstall.SqlDataProvider
@@ -0,0 +1,53 @@
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Users_ListByPortal]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_Users_ListByPortal]
+GO
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Users_ListByRole]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_Users_ListByRole]
+GO
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Users_RestoreUser]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_Users_RestoreUser]
+GO
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Users_HardDeleteUser]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_Users_HardDeleteUser]
+GO
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Users_GetValueList]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_Users_GetValueList]
+GO
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_GetUserList]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_GetUserList]
+GO
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Users_AddReport]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_Users_AddReport]
+GO
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Users_GetReport]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_Users_GetReport]
+GO
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Users_GetReports]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_Users_GetReports]
+GO
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Users_UpdateReport]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_Users_UpdateReport]
+GO
+
+if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Users_DeleteReport]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+ drop procedure {databaseOwner}[{objectQualifier}Connect_Users_DeleteReport]
+GO
+
+ALTER TABLE {databaseOwner}{objectQualifier}Connect_UsersReports Drop Constraint PK_{objectQualifier}Connect_UsersReports
+GO
+
+ALTER TABLE {databaseOwner}{objectQualifier}Connect_UsersReports Drop Constraint FK_{objectQualifier}Connect_UsersReports_{objectQualifier}Portals
+GO
+
+DROP TABLE {databaseOwner}[{objectQualifier}Connect_UsersReports
+GO
diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt
new file mode 100644
index 0000000..f0f3efd
--- /dev/null
+++ b/ReleaseNotes.txt
@@ -0,0 +1,37 @@
+
Connect: AccountRegistration
+
+ Philipp Becker
+ DNN-Connect
+ http://dnn-connect.org
+
+
+
+
Release Notes
+
+
+ Version 01.00.01
+
+
Service release. Mainly focused on better support for password management in newer dnn installations where password retrieval is disabled.
+
Changes
+
+
New token in e-mail templates: [RESETLINK]
+
New token in forms: [PASSWORDCURRENT]; needed for setting a new password in the account update form
+
+
+
+ Version 01.00.00
+
+
Initial release of Account registration, login and update module. The formly module dnnWerk.Users has been separated into dedocated modules for registering and updating account. The main task for this release was to extract the actual modules from the original package. I do have improved the feature set in various ways though:
+
Changes
+
+
Added template management view to simplify template management
+
Made sharing templates across module instances possible
+
Added tokens for letting users login from within the registration module
+
Changed notification e-mail setting to notification role. This will now send e-mails to all members of a given role on submitting the form
+
Made tokens compatible with the DNN form pattern
+
Added support for question and answer fields
+
Added support for changing usernames when registering through e-mail address is configured
+
Improved error handling
+
+
+
\ No newline at end of file
diff --git a/Resources.zip b/Resources.zip
new file mode 100644
index 0000000..ec29b8e
Binary files /dev/null and b/Resources.zip differ
diff --git a/Settings.ascx b/Settings.ascx
new file mode 100644
index 0000000..e407a6c
--- /dev/null
+++ b/Settings.ascx
@@ -0,0 +1,51 @@
+<%@ Control Language="vb" AutoEventWireup="false" Inherits="Connect.Modules.UserManagement.AccountRegistration.Settings" Codebehind="Settings.ascx.vb" %>
+<%@ Register TagPrefix="dnn" Assembly="DotNetNuke.Web" Namespace="DotNetNuke.Web.UI.WebControls" %>
+<%@ Register TagName="label" TagPrefix="dnn" Src="~/controls/labelcontrol.ascx" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Settings.ascx.designer.vb b/Settings.ascx.designer.vb
new file mode 100644
index 0000000..0803ecd
--- /dev/null
+++ b/Settings.ascx.designer.vb
@@ -0,0 +1,143 @@
+'------------------------------------------------------------------------------
+'
+' This code was generated by a tool.
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+Namespace Connect.Modules.UserManagement.AccountRegistration
+
+ Partial Public Class Settings
+
+ '''
+ '''lblUsernameMode control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblUsernameMode As Global.DotNetNuke.UI.UserControls.LabelControl
+
+ '''
+ '''drpUsernameMode control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents drpUsernameMode As Global.System.Web.UI.WebControls.DropDownList
+
+ '''
+ '''lblDisplaynameMode control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblDisplaynameMode As Global.DotNetNuke.UI.UserControls.LabelControl
+
+ '''
+ '''drpDisplaynameMode control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents drpDisplaynameMode As Global.System.Web.UI.WebControls.DropDownList
+
+ '''
+ '''lblRedirectAfterSubmit control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblRedirectAfterSubmit As Global.DotNetNuke.UI.UserControls.LabelControl
+
+ '''
+ '''drpRedirectAfterSubmit control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents drpRedirectAfterSubmit As Global.System.Web.UI.WebControls.DropDownList
+
+ '''
+ '''lblUsermanagementTab control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblUsermanagementTab As Global.DotNetNuke.UI.UserControls.LabelControl
+
+ '''
+ '''drpUserManagementTab control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents drpUserManagementTab As Global.System.Web.UI.WebControls.DropDownList
+
+ '''
+ '''lblAddToRole control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblAddToRole As Global.DotNetNuke.UI.UserControls.LabelControl
+
+ '''
+ '''drpAddToRole control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents drpAddToRole As Global.System.Web.UI.WebControls.DropDownList
+
+ '''
+ '''lblNotifyRole control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblNotifyRole As Global.DotNetNuke.UI.UserControls.LabelControl
+
+ '''
+ '''drpNotifyRole control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents drpNotifyRole As Global.System.Web.UI.WebControls.DropDownList
+
+ '''
+ '''lblNotifyUser control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblNotifyUser As Global.DotNetNuke.UI.UserControls.LabelControl
+
+ '''
+ '''chkNotifyUser control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents chkNotifyUser As Global.System.Web.UI.WebControls.CheckBox
+ End Class
+End Namespace
diff --git a/Settings.ascx.vb b/Settings.ascx.vb
new file mode 100644
index 0000000..a2cccc7
--- /dev/null
+++ b/Settings.ascx.vb
@@ -0,0 +1,86 @@
+
+Imports DotNetNuke
+Imports DotNetNuke.Services.Exceptions
+Imports DotNetNuke.Entities.Tabs
+Imports DotNetNuke.Common.Utilities
+
+Namespace Connect.Modules.UserManagement.AccountRegistration
+ Partial Class Settings
+ Inherits Entities.Modules.ModuleSettingsBase
+
+#Region "Base Method Implementations"
+
+ Public Overrides Sub LoadSettings()
+ Try
+ If (Page.IsPostBack = False) Then
+
+ BindPages()
+ BindRoles()
+
+ If (Settings.Contains("ShowUserName")) Then drpUsernameMode.SelectedValue = Settings("ShowUserName").ToString()
+ If (Settings.Contains("ShowDisplayName")) Then drpDisplaynameMode.SelectedValue = Settings("ShowDisplayName").ToString()
+ If (Settings.Contains("RedirectAfterSubmit")) Then drpRedirectAfterSubmit.SelectedValue = Settings("RedirectAfterSubmit").ToString()
+ If (Settings.Contains("UsermanagementTab")) Then drpUserManagementTab.SelectedValue = Settings("UsermanagementTab").ToString()
+ If (Settings.Contains("AddToRoleOnSubmit")) Then drpAddToRole.SelectedValue = Settings("AddToRoleOnSubmit").ToString()
+ If (Settings.Contains("NotifyRole")) Then drpNotifyRole.Items.FindByText(Settings("NotifyRole").ToString()).Selected = True
+ If (Settings.Contains("NotifyUser")) Then chkNotifyUser.Checked = CType(Settings("NotifyUser"), Boolean)
+
+ End If
+ Catch exc As Exception 'Module failed to load
+ ProcessModuleLoadException(Me, exc)
+ End Try
+ End Sub
+
+ Public Overrides Sub UpdateSettings()
+ Try
+ Dim objModules As New Entities.Modules.ModuleController
+
+
+ objModules.UpdateTabModuleSetting(TabModuleId, "ShowUserName", drpUsernameMode.SelectedValue)
+ objModules.UpdateTabModuleSetting(TabModuleId, "ShowDisplayName", drpDisplaynameMode.SelectedValue)
+ objModules.UpdateTabModuleSetting(TabModuleId, "RedirectAfterSubmit", drpRedirectAfterSubmit.SelectedValue)
+ objModules.UpdateTabModuleSetting(TabModuleId, "UsermanagementTab", drpUserManagementTab.SelectedValue)
+ objModules.UpdateTabModuleSetting(TabModuleId, "AddToRoleOnSubmit", drpAddToRole.SelectedValue)
+ 'we need the rolename for sending mails to users, therefor store here the rolename rather than the id!
+ objModules.UpdateTabModuleSetting(TabModuleId, "NotifyRole", drpNotifyRole.SelectedItem.Text)
+ objModules.UpdateTabModuleSetting(TabModuleId, "NotifyUser", chkNotifyUser.Checked.ToString)
+
+ Catch exc As Exception 'Module failed to load
+ ProcessModuleLoadException(Me, exc)
+ End Try
+ End Sub
+
+ Private Sub BindPages()
+
+ Dim tabs As System.Collections.Generic.List(Of Entities.Tabs.TabInfo) = TabController.GetPortalTabs(PortalId, Null.NullInteger, True, True, False, False)
+
+ drpRedirectAfterSubmit.DataSource = tabs
+ drpRedirectAfterSubmit.DataBind()
+
+ drpUserManagementTab.DataSource = tabs
+ drpUserManagementTab.DataBind()
+
+ End Sub
+
+ Private Sub BindRoles()
+
+ Dim rc As New Security.Roles.RoleController
+ Dim roles As ArrayList = rc.GetPortalRoles(PortalId)
+
+ drpAddToRole.DataSource = roles
+ drpAddToRole.DataBind()
+ drpAddToRole.Items.Insert(0, New ListItem("---", "-1"))
+
+ drpNotifyRole.DataSource = roles
+ drpNotifyRole.DataBind()
+ drpNotifyRole.Items.Insert(0, New ListItem("---", "-1"))
+
+ End Sub
+
+
+#End Region
+
+ End Class
+End Namespace
+
+
diff --git a/Templates.ascx b/Templates.ascx
new file mode 100644
index 0000000..b5e2ec6
--- /dev/null
+++ b/Templates.ascx
@@ -0,0 +1,85 @@
+<%@ Control Language="vb" AutoEventWireup="false" Inherits="Connect.Modules.UserManagement.AccountRegistration.Templates" Codebehind="Templates.ascx.vb" %>
+<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
+<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.UI.WebControls" Assembly="DotNetNuke.Web" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Templates.ascx.designer.vb b/Templates.ascx.designer.vb
new file mode 100644
index 0000000..6c01e28
--- /dev/null
+++ b/Templates.ascx.designer.vb
@@ -0,0 +1,242 @@
+'------------------------------------------------------------------------------
+'
+' This code was generated by a tool.
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+Namespace Connect.Modules.UserManagement.AccountRegistration
+
+ Partial Public Class Templates
+
+ '''
+ '''plTheme control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents plTheme As Global.DotNetNuke.UI.UserControls.LabelControl
+
+ '''
+ '''drpThemes control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents drpThemes As Global.System.Web.UI.WebControls.DropDownList
+
+ '''
+ '''cmdCopySelected control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents cmdCopySelected As Global.System.Web.UI.WebControls.LinkButton
+
+ '''
+ '''cmdDeleteSelected control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents cmdDeleteSelected As Global.System.Web.UI.WebControls.LinkButton
+
+ '''
+ '''pnlLocales control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents pnlLocales As Global.System.Web.UI.HtmlControls.HtmlGenericControl
+
+ '''
+ '''plLocale control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents plLocale As Global.DotNetNuke.UI.UserControls.LabelControl
+
+ '''
+ '''drpLocales control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents drpLocales As Global.System.Web.UI.WebControls.DropDownList
+
+ '''
+ '''plUseTheme control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents plUseTheme As Global.DotNetNuke.UI.UserControls.LabelControl
+
+ '''
+ '''chkUseTheme control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents chkUseTheme As Global.System.Web.UI.WebControls.CheckBox
+
+ '''
+ '''pnlTemplateName control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents pnlTemplateName As Global.System.Web.UI.HtmlControls.HtmlGenericControl
+
+ '''
+ '''plTemplateName control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents plTemplateName As Global.DotNetNuke.UI.UserControls.LabelControl
+
+ '''
+ '''txtTemplateName control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents txtTemplateName As Global.System.Web.UI.WebControls.TextBox
+
+ '''
+ '''RegisterTemplatesTabs control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents RegisterTemplatesTabs As Global.System.Web.UI.HtmlControls.HtmlGenericControl
+
+ '''
+ '''lblFormTemplate control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblFormTemplate As Global.System.Web.UI.WebControls.Label
+
+ '''
+ '''lblEmailUser control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblEmailUser As Global.System.Web.UI.WebControls.Label
+
+ '''
+ '''lblEmailUserPrivate control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblEmailUserPrivate As Global.System.Web.UI.WebControls.Label
+
+ '''
+ '''lblEmailUserVerified control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblEmailUserVerified As Global.System.Web.UI.WebControls.Label
+
+ '''
+ '''lblEmailAdminTemplate control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblEmailAdminTemplate As Global.System.Web.UI.WebControls.Label
+
+ '''
+ '''txtFormTemplate control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents txtFormTemplate As Global.System.Web.UI.WebControls.TextBox
+
+ '''
+ '''txtEmailUser control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents txtEmailUser As Global.System.Web.UI.WebControls.TextBox
+
+ '''
+ '''txtEmailUserPrivate control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents txtEmailUserPrivate As Global.System.Web.UI.WebControls.TextBox
+
+ '''
+ '''txtEmailUserVerified control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents txtEmailUserVerified As Global.System.Web.UI.WebControls.TextBox
+
+ '''
+ '''txtEmailAdminTemplate control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents txtEmailAdminTemplate As Global.System.Web.UI.WebControls.TextBox
+
+ '''
+ '''cmdUpdateSettings control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents cmdUpdateSettings As Global.System.Web.UI.WebControls.LinkButton
+
+ '''
+ '''cmdCancel control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents cmdCancel As Global.System.Web.UI.WebControls.LinkButton
+ End Class
+End Namespace
diff --git a/Templates.ascx.vb b/Templates.ascx.vb
new file mode 100644
index 0000000..2a94eb4
--- /dev/null
+++ b/Templates.ascx.vb
@@ -0,0 +1,330 @@
+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
+Imports DotNetNuke.UI.Skins.Controls
+Imports DotNetNuke.Services.Localization
+Imports DotNetNuke.Common.Globals
+
+Namespace Connect.Modules.UserManagement.AccountRegistration
+
+ Partial Class Templates
+ Inherits ConnectUsersModuleBase
+
+
+ Private Sub Page_Init(sender As Object, e As System.EventArgs) Handles Me.Init
+
+ DotNetNuke.Framework.jQuery.RequestDnnPluginsRegistration()
+
+ End Sub
+
+ Private Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
+
+ LocalizeForm()
+
+ If Not Page.IsPostBack Then
+
+ BindThemes()
+ BindLocales()
+
+ If Settings.Contains("ModuleTheme") Then
+ Try
+ SelectTheme(CType(Settings("ModuleTheme"), String))
+ Catch
+ End Try
+ End If
+
+ BindSelectedTheme()
+ VerifyPasswordSettings()
+
+ End If
+
+ End Sub
+
+ Private Sub drpThemes_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles drpThemes.SelectedIndexChanged
+ BindSelectedTheme()
+ End Sub
+
+ Private Sub cmdUpdateSettings_Click(sender As Object, e As System.EventArgs) Handles cmdUpdateSettings.Click
+
+ Dim blnSucess As Boolean = False
+
+ SaveTemplates(blnSucess)
+
+ If blnSucess Then
+ UpdateSettings()
+ End If
+
+ End Sub
+
+ Private Sub cmdDeleteSelected_Click(sender As Object, e As System.EventArgs) Handles cmdDeleteSelected.Click
+
+ Try
+ DeleteTheme()
+ Catch ex As Exception
+ DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me, Localization.GetString("lblDeleteThemeError", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError)
+ End Try
+
+ End Sub
+
+ Private Sub cmdCancel_Click(sender As Object, e As System.EventArgs) Handles cmdCancel.Click
+ Response.Redirect(NavigateURL())
+ End Sub
+
+ Private Sub drpLocales_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles drpLocales.SelectedIndexChanged
+ BindSelectedTheme()
+ End Sub
+
+ Private Sub cmdCopySelected_Click(sender As Object, e As System.EventArgs) Handles cmdCopySelected.Click
+ pnlTemplateName.Visible = True
+ End Sub
+
+ Private Sub VerifyPasswordSettings()
+
+ If MembershipProvider.Instance().PasswordRetrievalEnabled = False Then
+
+ Dim strNote As String = Localization.GetString("lblPasswordRetrievalDisabled", LocalResourceFile)
+ If MembershipProvider.Instance().RequiresQuestionAndAnswer Then
+ strNote += Localization.GetString("lblRequiresQuestionAndAnswer", LocalResourceFile)
+ End If
+ DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me, strNote, ModuleMessage.ModuleMessageType.BlueInfo)
+
+ End If
+
+ End Sub
+
+ Private Sub LocalizeForm()
+
+ cmdCancel.Text = Localization.GetString("cmdCancel", LocalResourceFile)
+ cmdUpdateSettings.Text = Localization.GetString("cmdUpdateSettings", LocalResourceFile)
+ cmdCopySelected.Text = Localization.GetString("cmdCopySelected", LocalResourceFile)
+ cmdDeleteSelected.Text = Localization.GetString("cmdDeleteSelected", LocalResourceFile)
+
+ End Sub
+
+ Private Sub BindThemes()
+
+ drpThemes.Items.Clear()
+ Dim basepath As String = Server.MapPath(Me.TemplateSourceDirectory & "/templates/")
+
+ For Each folder As String In System.IO.Directory.GetDirectories(basepath)
+ Dim foldername As String = folder.Substring(folder.LastIndexOf("\") + 1)
+
+ drpThemes.Items.Add(New ListItem(foldername, folder))
+
+ Next
+
+ End Sub
+
+ Private Sub SelectTheme(ThemeName As String)
+ drpThemes.Items.FindByText(ThemeName).Selected = True
+ End Sub
+
+ Private Sub BindSelectedTheme()
+
+ cmdDeleteSelected.Visible = (drpThemes.SelectedIndex <> 0)
+
+ If Settings.Contains("ModuleTheme") Then
+ Try
+ If CType(Settings("ModuleTheme"), String) = drpThemes.SelectedItem.Text Then
+ chkUseTheme.Checked = True
+ DotNetNuke.UI.Utilities.ClientAPI.AddButtonConfirm(cmdDeleteSelected, Localization.GetSafeJSString(Localization.GetString("lblThemeInUse", LocalResourceFile)))
+ Else
+ chkUseTheme.Checked = False
+ DotNetNuke.UI.Utilities.ClientAPI.AddButtonConfirm(cmdDeleteSelected, Localization.GetSafeJSString(Localization.GetString("lblConfirmDelete", LocalResourceFile)))
+ End If
+ Catch
+ End Try
+ Else
+ DotNetNuke.UI.Utilities.ClientAPI.AddButtonConfirm(cmdDeleteSelected, Localization.GetSafeJSString(Localization.GetString("lblConfirmDelete", LocalResourceFile)))
+ chkUseTheme.Checked = False
+ End If
+
+ Dim path As String = drpThemes.SelectedValue
+
+ For Each file As String In System.IO.Directory.GetFiles(path)
+
+ If file.EndsWith(Constants.TemplateName_EmailToAdmin) Then
+ txtEmailAdminTemplate.Text = GetTemplate(drpThemes.SelectedItem.Value, Constants.TemplateName_EmailToAdmin, drpLocales.SelectedValue, True)
+ End If
+ If file.EndsWith(Constants.TemplateName_EmailToUser_Private) Then
+ txtEmailUserPrivate.Text = GetTemplate(drpThemes.SelectedItem.Value, Constants.TemplateName_EmailToUser_Private, drpLocales.SelectedValue, True)
+ End If
+ If file.EndsWith(Constants.TemplateName_EmailToUser_Verified) Then
+ txtEmailUserVerified.Text = GetTemplate(drpThemes.SelectedItem.Value, Constants.TemplateName_EmailToUser_Verified, drpLocales.SelectedValue, True)
+ End If
+ If file.EndsWith(Constants.TemplateName_EmailToUser) Then
+ txtEmailUser.Text = GetTemplate(drpThemes.SelectedItem.Value, Constants.TemplateName_EmailToUser, drpLocales.SelectedValue, True)
+ End If
+ If file.EndsWith(Constants.TemplateName_Form) Then
+ txtFormTemplate.Text = GetTemplate(drpThemes.SelectedItem.Value, Constants.TemplateName_Form, drpLocales.SelectedValue, True)
+ End If
+
+ Next
+
+
+ End Sub
+
+ Private Sub SaveTemplate(SelectedTheme As String, TemplateName As String, Locale As String)
+
+ Dim path As String = SelectedTheme & "\" & TemplateName.Replace(Constants.TemplateName_Extension, "." & Locale & Constants.TemplateName_Extension)
+
+ If (PortalSettings.DefaultLanguage.ToLower = Locale.ToLower) Or String.IsNullOrEmpty(Locale) Then
+ path = SelectedTheme & "\" & TemplateName
+ End If
+
+ Dim sw As New System.IO.StreamWriter(path, False)
+
+ If TemplateName = Constants.TemplateName_EmailToAdmin Then
+ sw.Write(txtEmailAdminTemplate.Text)
+ End If
+ If TemplateName = Constants.TemplateName_EmailToUser_Private Then
+ sw.Write(txtEmailUserPrivate.Text)
+ End If
+ If TemplateName = Constants.TemplateName_EmailToUser_Verified Then
+ sw.Write(txtEmailUserVerified.Text)
+ End If
+ If TemplateName = Constants.TemplateName_EmailToUser Then
+ sw.Write(txtEmailUser.Text)
+ End If
+ If TemplateName = Constants.TemplateName_Form Then
+ sw.Write(txtFormTemplate.Text)
+ End If
+
+ sw.Close()
+ sw.Dispose()
+
+ End Sub
+
+ Private Sub SaveTemplates(ByRef blnSucess As Boolean)
+
+ Dim basepath As String = drpThemes.SelectedValue
+
+ If pnlTemplateName.Visible Then
+
+ If String.IsNullOrEmpty(txtTemplateName.Text) Then
+ DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me, Localization.GetString("lblMustEnterTemplateName", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError)
+ blnSucess = False
+ Exit Sub
+ End If
+
+ If String.IsNullOrEmpty(txtEmailAdminTemplate.Text) Or String.IsNullOrEmpty(txtEmailUser.Text) Or String.IsNullOrEmpty(txtEmailUserPrivate.Text) Or String.IsNullOrEmpty(txtEmailUserVerified.Text) Or String.IsNullOrEmpty(txtFormTemplate.Text) Then
+ DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me, Localization.GetString("lblMustEnterTemplate", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError)
+ blnSucess = False
+ Exit Sub
+ End If
+
+ Dim newpath As String = Server.MapPath(Me.TemplateSourceDirectory & "/templates/") & txtTemplateName.Text
+ Try
+ System.IO.Directory.CreateDirectory(newpath)
+ Catch
+ DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me, Localization.GetString("lblInvalidFolderName", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError)
+ blnSucess = False
+ Exit Sub
+ End Try
+
+ Try
+ For Each file As String In System.IO.Directory.GetFiles(basepath)
+ Dim destinationpath As String = newpath & "\" & file.Substring(file.LastIndexOf("\") + 1)
+ System.IO.File.Copy(file, destinationpath)
+ Next
+ basepath = newpath
+ Catch ex As Exception
+ DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me, Localization.GetString("lblCouldNotCopyTheme", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError)
+ blnSucess = False
+ Exit Sub
+ End Try
+
+ pnlTemplateName.Visible = False
+ BindThemes()
+ SelectTheme(txtTemplateName.Text)
+ cmdDeleteSelected.Visible = True
+
+ End If
+
+ Try
+
+ For Each file As String In System.IO.Directory.GetFiles(basepath)
+
+ If file.EndsWith(Constants.TemplateName_EmailToAdmin) Then
+ SaveTemplate(drpThemes.SelectedValue, Constants.TemplateName_EmailToAdmin, drpLocales.SelectedValue)
+ End If
+ If file.EndsWith(Constants.TemplateName_EmailToUser_Private) Then
+ SaveTemplate(drpThemes.SelectedValue, Constants.TemplateName_EmailToUser_Private, drpLocales.SelectedValue)
+ End If
+ If file.EndsWith(Constants.TemplateName_EmailToUser_Verified) Then
+ SaveTemplate(drpThemes.SelectedValue, Constants.TemplateName_EmailToUser_Verified, drpLocales.SelectedValue)
+ End If
+ If file.EndsWith(Constants.TemplateName_EmailToUser) Then
+ SaveTemplate(drpThemes.SelectedValue, Constants.TemplateName_EmailToUser, drpLocales.SelectedValue)
+ End If
+ If file.EndsWith(Constants.TemplateName_Form) Then
+ SaveTemplate(drpThemes.SelectedValue, Constants.TemplateName_Form, drpLocales.SelectedValue)
+ End If
+
+ Next
+
+ Catch ex As Exception
+ DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me, Localization.GetString("lblCouldNotWriteTheme", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError)
+ blnSucess = False
+ Exit Sub
+ End Try
+
+
+ blnSucess = True
+
+ End Sub
+
+ Private Sub UpdateSettings()
+
+ Dim ctrl As New ModuleController
+ ctrl.UpdateTabModuleSetting(TabModuleId, "ModuleTheme", drpThemes.SelectedItem.Text)
+
+ End Sub
+
+ Private Sub DeleteTheme()
+ Dim basepath As String = drpThemes.SelectedValue
+ For Each file As String In System.IO.Directory.GetFiles(basepath)
+ System.IO.File.Delete(file)
+ Next
+ System.IO.Directory.Delete(basepath)
+ BindThemes()
+ UpdateSettings()
+ BindSelectedTheme()
+
+ End Sub
+
+ Private Sub BindLocales()
+
+ Dim dicLocales As Dictionary(Of String, DotNetNuke.Services.Localization.Locale) = LocaleController.Instance().GetLocales(PortalId)
+
+ If dicLocales.Count > 1 Then
+ pnlLocales.Visible = True
+ End If
+
+ For Each objLocale As DotNetNuke.Services.Localization.Locale In dicLocales.Values
+
+ Dim item As New ListItem
+ item.Text = objLocale.Text
+ item.Value = objLocale.Code
+
+ Me.drpLocales.Items.Add(item)
+
+ Next
+
+ Try
+ drpLocales.Items(0).Selected = True
+ Catch
+ End Try
+
+
+ End Sub
+
+ End Class
+
+End Namespace
+
+
diff --git a/Templates/Default/Email.Admin.txt b/Templates/Default/Email.Admin.txt
new file mode 100644
index 0000000..6517be1
--- /dev/null
+++ b/Templates/Default/Email.Admin.txt
@@ -0,0 +1,24 @@
+
+
A user has registered an account on the website [PORTALNAME].
+
The registration mode of the portal is set to [REGISTRATIONMODE], so the following action is necessary:
your user account on the website [PORTALNAME] has been created succesfully. In order to log on to your account you will have to wait until we have verified your account details and activate your account. This may take up to 24 hours and you will receive another notification e-mail as soon as this process has been finished.
+
+
For now it is already adviseable to keep your registration details in a safe place in case you need it one day.
+
+
Details about your account
+
+
+
+
Username:
[USERNAME]
+
+
+
Password:
[PASSWORD]
+
+
+
E-Mail Adress:
[EMAIL]
+
+
+
+
+ Once we have activated your account you can use the following link to manage your account details:
+
+
+
diff --git a/Templates/Default/Email.User.Verified.txt b/Templates/Default/Email.User.Verified.txt
new file mode 100644
index 0000000..5855d7f
--- /dev/null
+++ b/Templates/Default/Email.User.Verified.txt
@@ -0,0 +1,36 @@
+This is the default template:
+
+
Dear [DISPLAYNAME],
+
your user account on the website [PORTALNAME] has been created succesfully. To finalize the activation of the account we require you to verify your e-mail address. This is to prevent automated systems to register accounts on our website and we're trying to make that last step as easy as possible for you. Simply click on the link below and your account will be activated instantly. In case you will be asked of a verification code while logging on to the website you can also enter the key provided below.
+
+
\ No newline at end of file
diff --git a/View.ascx b/View.ascx
new file mode 100644
index 0000000..834b4fc
--- /dev/null
+++ b/View.ascx
@@ -0,0 +1,19 @@
+<%@ Control Language="vb" AutoEventWireup="false" Inherits="Connect.Modules.UserManagement.AccountRegistration.View" Codebehind="View.ascx.vb" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/View.ascx.designer.vb b/View.ascx.designer.vb
new file mode 100644
index 0000000..fb07ac0
--- /dev/null
+++ b/View.ascx.designer.vb
@@ -0,0 +1,62 @@
+'------------------------------------------------------------------------------
+'
+' This code was generated by a tool.
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+Namespace Connect.Modules.UserManagement.AccountRegistration
+
+ Partial Public Class View
+
+ '''
+ '''pnlError control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents pnlError As Global.System.Web.UI.WebControls.Panel
+
+ '''
+ '''lblError control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblError As Global.System.Web.UI.WebControls.Literal
+
+ '''
+ '''pnlSuccess control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents pnlSuccess As Global.System.Web.UI.WebControls.Panel
+
+ '''
+ '''lblSucess control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblSucess As Global.System.Web.UI.WebControls.Literal
+
+ '''
+ '''plhRegister control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents plhRegister As Global.System.Web.UI.WebControls.PlaceHolder
+ End Class
+End Namespace
diff --git a/View.ascx.vb b/View.ascx.vb
new file mode 100644
index 0000000..7374c14
--- /dev/null
+++ b/View.ascx.vb
@@ -0,0 +1,698 @@
+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
+Imports DotNetNuke
+Imports DotNetNuke.Services.Localization
+Imports DotNetNuke.Common.Globals
+Imports DotNetNuke.Common.Utilities
+
+Namespace Connect.Modules.UserManagement.AccountRegistration
+
+ Partial Class View
+ Inherits ConnectUsersModuleBase
+
+ Implements IActionable
+
+#Region "Event Handlers"
+
+
+#Region "Event Handlers"
+
+ Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
+
+ 'DotNetNuke.Framework.AJAX.RegisterScriptManager()
+
+ ProcessFormTemplate(plhRegister, GetTemplate(ModuleTheme, Constants.TemplateName_Form, CurrentLocale, False), Nothing)
+
+ Dim btnUpdate As Button = CType(FindControlRecursive(plhRegister, plhRegister.ID & "_" & Constants.ControlId_UpdateButton), Button)
+ If Not btnUpdate Is Nothing Then
+ AddHandler btnUpdate.Click, AddressOf btnUpdate_Click
+ End If
+
+ Dim btnLogin As Button = CType(FindControlRecursive(plhRegister, plhRegister.ID & "_" & Constants.ControlId_LoginButton), Button)
+ If Not btnLogin Is Nothing Then
+ AddHandler btnLogin.Click, AddressOf btnLogin_Click
+ End If
+
+ Dim btnLostPassword As Button = CType(FindControlRecursive(plhRegister, plhRegister.ID & "_" & Constants.ControlId_LostPasswordButton), Button)
+ If Not btnLostPassword Is Nothing Then
+ AddHandler btnLostPassword.Click, AddressOf btnLostPassword_Click
+ End If
+
+ End Sub
+
+ Protected Sub btnUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs)
+ Register()
+ End Sub
+
+ Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs)
+ HandleLogin()
+ End Sub
+
+ Protected Sub btnLostPassword_Click(ByVal sender As Object, ByVal e As System.EventArgs)
+ HandleLostPassword()
+ End Sub
+
+#End Region
+
+#Region "Private Methods"
+
+ Private Sub HandleLostPassword()
+ Response.Redirect(NavigateURL(TabId, "", "ctl=SendPassword"))
+ End Sub
+
+ Private Sub HandleLogin()
+
+ Dim txtUsername As TextBox = CType(FindControlRecursive(plhRegister, plhRegister.ID & "_" & Constants.ControlId_UsernameForLogin), TextBox)
+ Dim txtPassword As TextBox = CType(FindControlRecursive(plhRegister, plhRegister.ID & "_" & Constants.ControlId_PasswordForLogin), TextBox)
+ Dim chkRemember As CheckBox = CType(FindControlRecursive(plhRegister, plhRegister.ID & "_" & Constants.ControlId_RememberForLogin), CheckBox)
+
+ If Not txtUsername Is Nothing AndAlso Not txtPassword Is Nothing Then
+
+ Dim loginStatus As DotNetNuke.Security.Membership.UserLoginStatus
+ Dim objUser As UserInfo = UserController.ValidateUser(PortalId, txtUsername.Text, txtPassword.Text, "", PortalSettings.PortalName, Request.UserHostAddress, loginStatus)
+
+ Select Case loginStatus
+
+ Case UserLoginStatus.LOGIN_FAILURE
+
+ lblError.Text = Localization.GetString("LOGIN_FAILURE", LocalResourceFile)
+ pnlError.Visible = True
+
+ Case UserLoginStatus.LOGIN_INSECUREADMINPASSWORD, UserLoginStatus.LOGIN_INSECUREHOSTPASSWORD, UserLoginStatus.LOGIN_SUPERUSER, UserLoginStatus.LOGIN_SUCCESS
+
+ Dim blnPersistent As Boolean = False
+ If Not chkRemember Is Nothing Then
+ blnPersistent = chkRemember.Checked
+ End If
+ UserController.UserLogin(PortalId, objUser, PortalSettings.PortalName, Request.UserHostAddress, blnPersistent)
+
+ 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
+
+ Response.Redirect(NavigateURL(PortalSettings.HomeTabId))
+
+ Case UserLoginStatus.LOGIN_USERLOCKEDOUT
+
+ lblError.Text = Localization.GetString("LOGIN_USERLOCKEDOUT", LocalResourceFile)
+ pnlError.Visible = True
+
+ Case UserLoginStatus.LOGIN_USERNOTAPPROVED
+
+ lblError.Text = Localization.GetString("LOGIN_USERNOTAPPROVED", LocalResourceFile)
+ pnlError.Visible = True
+
+ End Select
+
+ End If
+ End Sub
+
+ Private Sub Register()
+
+
+ pnlSuccess.Visible = False
+ pnlError.Visible = False
+
+ Dim strMessages As New List(Of 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 txtUsername As TextBox = CType(FindControlRecursive(plhRegister, plhRegister.ID & "_" & Constants.ControlId_Username), TextBox)
+ blnUpdateUsername = (Not txtUsername Is Nothing)
+
+ If blnUpdateUsername Then
+ If Not IsValidUserAttribute(Constants.User_Username, plhRegister) Then
+ strMessages.Add("Error_MissingUsername")
+ AddErrorIndicator(Constants.User_Username, plhRegister)
+ Else
+ RemoveErrorIndicator(Constants.User_Username, plhRegister, True)
+ End If
+ End If
+
+ Dim txtEmail As TextBox = CType(FindControlRecursive(plhRegister, plhRegister.ID & "_" & Constants.ControlId_Email), TextBox)
+ blnUpdateEmail = (Not txtEmail Is Nothing)
+
+ If blnUpdateEmail Then
+ If Not IsValidUserAttribute(Constants.User_Email, plhRegister) Then
+ strMessages.Add("Error_InvalidEmail")
+ AddErrorIndicator(Constants.User_Email, plhRegister)
+ Else
+ RemoveErrorIndicator(Constants.User_Email, plhRegister, True)
+ End If
+ End If
+
+ Dim txtPassword As TextBox = CType(FindControlRecursive(plhRegister, plhRegister.ID & "_" & Constants.ControlId_Password1), TextBox)
+ Dim txtPassword2 As TextBox = CType(FindControlRecursive(plhRegister, plhRegister.ID & "_" & Constants.ControlId_Password2), TextBox)
+ blnUpdatePassword = (Not txtPassword Is Nothing AndAlso Not txtPassword2 Is Nothing)
+
+ If blnUpdatePassword Then
+ If Not IsValidUserAttribute(Constants.User_Password1, plhRegister) Then
+ strMessages.Add("Error_MissingPassword1")
+ AddErrorIndicator(Constants.User_Password1, plhRegister)
+ Else
+ RemoveErrorIndicator(Constants.User_Password1, plhRegister, True)
+ End If
+ If Not IsValidUserAttribute(Constants.User_Password2, plhRegister) Then
+ strMessages.Add("Error_MissingPassword2")
+ AddErrorIndicator(Constants.User_Password2, plhRegister)
+ Else
+ RemoveErrorIndicator(Constants.User_Password2, plhRegister, True)
+ End If
+ End If
+
+ Dim txtPasswordQuestion As TextBox = CType(FindControlRecursive(plhRegister, plhRegister.ID & "_" & Constants.ControlId_PasswordQuestion), TextBox)
+ Dim blnUpdatePasswordQuestion As Boolean = (Not txtPasswordQuestion Is Nothing)
+ If blnUpdatePasswordQuestion Then
+ If Not IsValidUserAttribute(Constants.User_PasswordQuestion, plhRegister) Then
+ strMessages.Add("Error_MissingPasswordQuestion")
+ AddErrorIndicator(Constants.User_PasswordQuestion, plhRegister)
+ Else
+ RemoveErrorIndicator(Constants.User_PasswordQuestion, plhRegister, True)
+ End If
+ End If
+
+ Dim txtPasswordAnswer As TextBox = CType(FindControlRecursive(plhRegister, plhRegister.ID & "_" & Constants.ControlId_PasswordAnswer), TextBox)
+ Dim blnUpdatePasswordAnswer As Boolean = (Not txtPasswordAnswer Is Nothing)
+ If blnUpdatePasswordAnswer Then
+ If Not IsValidUserAttribute(Constants.User_PasswordAnswer, plhRegister) Then
+ strMessages.Add("Error_MissingPasswordAnswer")
+ AddErrorIndicator(Constants.User_PasswordAnswer, plhRegister)
+ Else
+ RemoveErrorIndicator(Constants.User_PasswordAnswer, plhRegister, True)
+ End If
+ End If
+
+
+ Dim txtFirstName As TextBox = CType(FindControlRecursive(plhRegister, plhRegister.ID & "_" & Constants.ControlId_Firstname), TextBox)
+ blnUpdateFirstname = (Not txtFirstName Is Nothing)
+
+ If blnUpdateFirstname Then
+ If Not IsValidUserAttribute(Constants.User_Firstname, plhRegister) Then
+ strMessages.Add("Error_MissingFirstname")
+ AddErrorIndicator(Constants.User_Firstname, plhRegister)
+ Else
+ RemoveErrorIndicator(Constants.User_Firstname, plhRegister, True)
+ End If
+ End If
+
+ Dim txtLastName As TextBox = CType(FindControlRecursive(plhRegister, plhRegister.ID & "_" & Constants.ControlId_Lastname), TextBox)
+ blnUpdateLastname = (Not txtLastName Is Nothing)
+
+ If blnUpdateLastname Then
+ If Not IsValidUserAttribute(Constants.User_Lastname, plhRegister) Then
+ strMessages.Add("Error_MissingLastname")
+ AddErrorIndicator(Constants.User_Lastname, plhRegister)
+ Else
+ RemoveErrorIndicator(Constants.User_Lastname, plhRegister, True)
+ End If
+ End If
+
+ Dim txtDisplayName As TextBox = CType(FindControlRecursive(plhRegister, plhRegister.ID & "_" & Constants.ControlId_Displayname), TextBox)
+ blnUpdateDisplayname = (Not txtDisplayName Is Nothing)
+
+ If blnUpdateDisplayname Then
+ If Not IsValidUserAttribute(Constants.User_Displayname, plhRegister) Then
+ strMessages.Add("Error_MissingDisplayName")
+ AddErrorIndicator(Constants.User_Displayname, plhRegister)
+ Else
+ RemoveErrorIndicator(Constants.User_Displayname, plhRegister, 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(Nothing, prop, plhRegister) Then
+ If blnProfileErrorAdded = False Then
+ strMessages.Add("Error_MissingProfileField")
+ blnProfileErrorAdded = True
+ End If
+ AddErrorIndicator(prop.PropertyDefinitionId.ToString, plhRegister)
+ Else
+ RemoveErrorIndicator(prop.PropertyDefinitionId.ToString, plhRegister, prop.Required)
+ End If
+ End If
+ Catch
+ End Try
+ Next
+
+ If strMessages.Count > 0 Then
+ Me.pnlError.Visible = True
+ Me.lblError.Text = "
"
+ For Each strMessage As String In strMessages
+ lblError.Text += "
"
+ Exit Sub
+ End If
+
+
+ Dim oUser As UserInfo = New UserInfo
+
+ 'approve membership if applicable
+ If PortalSettings.UserRegistration = PortalRegistrationType.PublicRegistration Then
+ oUser.Membership.Approved = True
+ Else
+ oUser.Membership.Approved = False
+ End If
+
+ 'set defaults
+ oUser.AffiliateID = Null.NullInteger
+ oUser.PortalID = PortalSettings.PortalId
+
+ oUser.IsDeleted = False
+ oUser.IsSuperUser = False
+ oUser.LastIPAddress = Request.UserHostAddress
+ oUser.Profile = New UserProfile
+ oUser.Username = ""
+ oUser.DisplayName = ""
+ oUser.Email = ""
+ oUser.Membership.Password = ""
+
+
+
+ 'set username depending on setting
+ Select Case UsernameMode
+ Case UsernameUpdateMode.Email
+ If blnUpdateEmail Then
+ oUser.Username = txtEmail.Text.Trim
+ End If
+ Case UsernameUpdateMode.FirstLetterLastname
+ If blnUpdateLastname AndAlso blnUpdateFirstname Then
+ oUser.Username = txtFirstName.Text.Trim.Substring(0, 1) & "." & txtLastName.Text
+ End If
+ Case UsernameUpdateMode.FirstnameLastname
+ If blnUpdateLastname AndAlso blnUpdateFirstname Then
+ oUser.Username = txtFirstName.Text & "." & txtLastName.Text
+ End If
+ Case UsernameUpdateMode.Lastname
+ If blnUpdateLastname Then
+ oUser.Username = txtLastName.Text
+ End If
+ Case UsernameUpdateMode.UserSelect
+ If blnUpdateUsername Then
+ oUser.Username = txtUsername.Text
+ End If
+ End Select
+
+ 'set displayname depending on setting
+ 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 = txtFirstName.Text.Trim.Substring(0, 1) & ". " & txtLastName.Text
+ End If
+ Case DisplaynameUpdateMode.FirstnameLastname
+ If blnUpdateLastname AndAlso blnUpdateFirstname Then
+ oUser.DisplayName = txtFirstName.Text & " " & txtLastName.Text
+ Else
+
+ End If
+ Case DisplaynameUpdateMode.Lastname
+ If blnUpdateLastname Then
+ oUser.DisplayName = txtLastName.Text
+ End If
+ Case DisplaynameUpdateMode.UserSelect
+ If blnUpdateDisplayname Then
+ oUser.DisplayName = txtDisplayName.Text
+ End If
+ End Select
+
+ If blnUpdateEmail Then
+ oUser.Email = txtEmail.Text
+ End If
+
+ 'try updating password
+ If blnUpdatePassword Then
+ If txtPassword.Text = txtPassword2.Text Then
+ If UserController.ValidatePassword(txtPassword.Text) Then
+ oUser.Membership.Password = txtPassword.Text
+ 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 = "
"
+ Exit Sub
+ End If
+ Else
+ 'auto-generate password
+ oUser.Membership.Password = UserController.GeneratePassword(7)
+ End If
+
+ If blnUpdatePasswordQuestion AndAlso blnUpdatePasswordAnswer Then
+ oUser.Membership.PasswordQuestion = txtPasswordQuestion.Text
+ oUser.Membership.PasswordAnswer = txtPasswordAnswer.Text
+ End If
+
+ If oUser.Username = "" Or oUser.Email = "" Or oUser.DisplayName = "" Or oUser.Membership.Password = "" Then
+ 'template must be setup up wrong
+ Me.pnlError.Visible = True
+ Me.lblError.Text = "
" & String.Format(Localization.GetString("TemplateingError.Text", LocalResourceFile), PortalSettings.Email)
+
+ If oUser.Username = "" Then
+ lblError.Text += " | Username is empty"
+ End If
+
+ If oUser.Email = "" Then
+ lblError.Text += " | E-mail is empty"
+ End If
+
+ If oUser.DisplayName = "" Then
+ lblError.Text += " | Displayname is empty"
+ End If
+
+ If oUser.Username = "" Then
+ lblError.Text += " | password is empty"
+ End If
+
+ lblError.Text += "
"
+
+ Exit Sub
+ End If
+
+ 'set up profile
+ oUser.Profile = New UserProfile
+ oUser.Profile.InitialiseProfile(PortalSettings.PortalId, True)
+ oUser.Profile.PreferredLocale = PortalSettings.DefaultLanguage
+ oUser.Profile.PreferredTimeZone = PortalSettings.TimeZone
+ 'todo: create account
+ Dim createStatus As UserCreateStatus = UserController.CreateUser(oUser)
+
+ Dim strStatus As String = ""
+
+ If createStatus <> UserCreateStatus.Success Then
+
+ Select Case createStatus
+ Case UserCreateStatus.UsernameAlreadyExists
+
+ Select Case UsernameMode
+ Case UsernameUpdateMode.UserSelect
+ strStatus = Localization.GetString("UsernameAlreadyExists", Me.LocalResourceFile)
+ Case UsernameUpdateMode.Email
+ strStatus = Localization.GetString("DuplicateEmail", Me.LocalResourceFile)
+ Case UsernameUpdateMode.FirstnameLastname, UsernameUpdateMode.FirstLetterLastname, UsernameUpdateMode.Lastname
+ strStatus = Localization.GetString("NameAlreadyExists", Me.LocalResourceFile)
+ End Select
+
+ Case Else
+
+ strStatus = String.Format(Localization.GetString("CreateError", Me.LocalResourceFile), createStatus.ToString)
+
+ End Select
+
+ If strStatus <> "" Then
+ strStatus = "
" & strStatus & "
"
+ Else
+ strStatus = "
" & createStatus.ToString & "
"
+ End If
+
+ Me.pnlError.Visible = True
+ Me.lblError.Text = "
" & strStatus & "
"
+
+ Exit Sub
+ End If
+
+ Dim propertiesCollection As New ProfilePropertyDefinitionCollection
+ UpdateProfileProperties(plhRegister, oUser, propertiesCollection, GetPropertiesFromTempate(GetTemplate(ModuleTheme, Constants.TemplateName_Form, CurrentLocale, False)))
+ oUser = ProfileController.UpdateUserProfile(oUser, propertiesCollection)
+
+ If blnUpdateFirstname = True Then
+ 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
+ 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 oUser.Username = "" Or oUser.Email = "" Or oUser.DisplayName = "" Or oUser.Membership.Password = "" Or oUser.FirstName = "" Or oUser.LastName = "" Then
+ 'template must be setup up wrong
+ Me.pnlError.Visible = True
+ Me.lblError.Text = "
" & String.Format(Localization.GetString("TemplateingError.Text", LocalResourceFile), PortalSettings.Email)
+
+ If oUser.Username = "" Then
+ lblError.Text += " | Username is empty"
+ End If
+
+ If oUser.Email = "" Then
+ lblError.Text += " | E-mail is empty"
+ End If
+
+ If oUser.DisplayName = "" Then
+ lblError.Text += " | Displayname is empty"
+ End If
+
+ If oUser.Username = "" Then
+ lblError.Text += " | password is empty"
+ End If
+
+
+ If oUser.FirstName = "" Then
+ lblError.Text += " | Firstname is empty"
+ End If
+
+ If oUser.LastName = "" Then
+ lblError.Text += " | LastName is empty"
+ End If
+
+ lblError.Text += "
"
+
+ Exit Sub
+ End If
+
+ Try
+ oUser.Profile.SetProfileProperty("Email", oUser.Email)
+ Catch
+ End Try
+
+ 'update profile
+ ProfileController.UpdateUserProfile(oUser)
+ UserController.UpdateUser(PortalId, oUser)
+
+
+ Dim strUserBody As String = ""
+ Dim strAdminBody As String = ""
+
+
+ If NotifyUser Then
+ If PortalSettings.UserRegistration = PortalRegistrationType.PrivateRegistration Then
+ strUserBody = GetTemplate(ModuleTheme, Constants.TemplateName_EmailToUser_Private, CurrentLocale, False)
+ ElseIf PortalSettings.UserRegistration = PortalRegistrationType.VerifiedRegistration Then
+ strUserBody = GetTemplate(ModuleTheme, Constants.TemplateName_EmailToUser_Verified, CurrentLocale, False)
+ Else
+ strUserBody = GetTemplate(ModuleTheme, Constants.TemplateName_EmailToUser, CurrentLocale, False)
+ End If
+ End If
+
+ If NotifyRole <> "" Then
+ strAdminBody = GetTemplate(ModuleTheme, Constants.TemplateName_EmailToAdmin, CurrentLocale, False)
+ End If
+
+ If strAdminBody <> "" Then
+
+ strAdminBody = strAdminBody.Replace("[PORTALURL]", PortalSettings.PortalAlias.HTTPAlias)
+ strAdminBody = strAdminBody.Replace("[PORTALNAME]", PortalSettings.PortalName)
+ strAdminBody = strAdminBody.Replace("[USERID]", oUser.UserID)
+ strAdminBody = strAdminBody.Replace("[DISPLAYNAME]", oUser.DisplayName)
+
+ If MembershipProvider.Instance().PasswordRetrievalEnabled Then
+ strAdminBody = strAdminBody.Replace("[PASSWORD]", MembershipProvider.Instance().GetPassword(oUser, ""))
+ End If
+
+ strAdminBody = strAdminBody.Replace("[USERNAME]", oUser.Username)
+ strAdminBody = strAdminBody.Replace("[FIRSTNAME]", oUser.FirstName)
+ strAdminBody = strAdminBody.Replace("[LASTNAME]", oUser.LastName)
+ strAdminBody = strAdminBody.Replace("[EMAIL]", oUser.Email)
+
+ If PortalSettings.UserRegistration = PortalRegistrationType.PrivateRegistration Then
+ strAdminBody = strAdminBody.Replace("[ADMINACTION]", Localization.GetString("AuthorizeAccount.Action", LocalResourceFile))
+ strAdminBody = strAdminBody.Replace("[REGISTRATIONMODE]", Localization.GetString("RegistrationMode_Private.Text", LocalResourceFile))
+ ElseIf PortalSettings.UserRegistration = PortalRegistrationType.VerifiedRegistration Then
+ strAdminBody = strAdminBody.Replace("[ADMINACTION]", Localization.GetString("VerifyAccount.Action", LocalResourceFile))
+ strAdminBody = strAdminBody.Replace("[REGISTRATIONMODE]", Localization.GetString("RegistrationMode_Verified.Text", LocalResourceFile))
+ Else
+ strAdminBody = strAdminBody.Replace("[ADMINACTION]", Localization.GetString("NoAction.Action", LocalResourceFile))
+ strAdminBody = strAdminBody.Replace("[REGISTRATIONMODE]", Localization.GetString("RegistrationMode_Public.Text", LocalResourceFile))
+ End If
+
+ strAdminBody = strAdminBody.Replace("[USERURL]", NavigateURL(UsermanagementTab, "", "uid=" & oUser.UserID.ToString))
+
+
+
+ Dim ctrlRoles As New RoleController
+ Dim NotificationUsers As ArrayList = ctrlRoles.GetUsersByRoleName(PortalId, NotifyRole)
+ For Each NotificationUser As UserInfo In NotificationUsers
+ Try
+
+ strAdminBody = strAdminBody.Replace("[RECIPIENTUSERID]", NotificationUser.UserID.ToString)
+ strAdminBody = strAdminBody.Replace("[USERID]", NotificationUser.UserID.ToString)
+
+ DotNetNuke.Services.Mail.Mail.SendMail(PortalSettings.Email, NotificationUser.Email, "", String.Format(Localization.GetString("NotifySubject_UserRegistered.Text", LocalResourceFile), PortalSettings.PortalName), strAdminBody, "", "HTML", "", "", "", "")
+ Catch
+ End Try
+ Next
+
+ End If
+
+ If strUserBody <> "" Then
+
+ strUserBody = strUserBody.Replace("[PORTALURL]", PortalSettings.PortalAlias.HTTPAlias)
+ strUserBody = strUserBody.Replace("[PORTALNAME]", PortalSettings.PortalName)
+ strUserBody = strUserBody.Replace("[USERID]", oUser.UserID)
+ strUserBody = strUserBody.Replace("[DISPLAYNAME]", oUser.DisplayName)
+
+ If MembershipProvider.Instance().PasswordRetrievalEnabled Then
+ strUserBody = strUserBody.Replace("[PASSWORD]", MembershipProvider.Instance().GetPassword(oUser, ""))
+ End If
+
+ strUserBody = strUserBody.Replace("[USERNAME]", oUser.Username)
+ strUserBody = strUserBody.Replace("[FIRSTNAME]", oUser.FirstName)
+ strUserBody = strUserBody.Replace("[LASTNAME]", oUser.LastName)
+ strUserBody = strUserBody.Replace("[EMAIL]", oUser.Email)
+ strUserBody = strUserBody.Replace("[VERIFICATIONCODE]", PortalSettings.PortalId.ToString & "-" & oUser.UserID.ToString)
+
+ strUserBody = strUserBody.Replace("[RECIPIENTUSERID]", oUser.UserID.ToString)
+ strUserBody = strUserBody.Replace("[USERID]", oUser.UserID.ToString)
+
+ If PortalSettings.UserTabId <> Null.NullInteger Then
+ strUserBody = strUserBody.Replace("[USERURL]", NavigateURL(PortalSettings.UserTabId))
+ Else
+ strUserBody = strUserBody.Replace("[USERURL]", NavigateURL(PortalSettings.HomeTabId, "ctl=Profile"))
+ End If
+
+ Dim returnurl As String = ""
+ Dim loginurl As String = ""
+ Dim verificationkey As String = PortalSettings.PortalId.ToString & "-" & oUser.UserID.ToString
+
+ If PortalSettings.LoginTabId <> Null.NullInteger Then
+ loginurl = NavigateURL(PortalSettings.LoginTabId, "", "VerificationCode=" & verificationkey)
+ Else
+ loginurl = NavigateURL(PortalSettings.HomeTabId, "", "ctl=Login", "VerificationCode=" & verificationkey)
+ End If
+
+ strUserBody = strUserBody.Replace("[VERIFYURL]", loginurl)
+
+ Try
+ DotNetNuke.Services.Mail.Mail.SendMail(PortalSettings.Email, oUser.Email, "", String.Format(Localization.GetString("NotifySubject_UserDetails.Text", LocalResourceFile), PortalSettings.PortalName), strUserBody, "", "HTML", "", "", "", "")
+ Catch
+ End Try
+
+
+ End If
+
+ 'add to role
+ If AddToRoleOnSubmit <> Null.NullInteger Then
+ Try
+ Dim rc As New RoleController
+ rc.AddUserRole(PortalId, oUser.UserID, AddToRoleOnSubmit, Null.NullDate)
+ Catch
+ End Try
+ End If
+
+
+ If PortalSettings.UserRegistration = PortalRegistrationType.PublicRegistration Then
+
+ 'logon user
+ Dim logonStatus As DotNetNuke.Security.Membership.UserLoginStatus = UserLoginStatus.LOGIN_FAILURE
+ UserController.UserLogin(PortalId, oUser.Username, oUser.Membership.Password, "", PortalSettings.PortalName, Request.UserHostAddress, logonStatus, True)
+
+ 'see if all worked
+ If logonStatus <> UserLoginStatus.LOGIN_SUCCESS Then
+
+ strStatus += logonStatus.ToString
+ Me.pnlError.Visible = True
+ Me.lblError.Text = strStatus
+ Exit Sub
+
+ End If
+
+ End If
+
+ lblSucess.Text = "