Skip to content
This repository has been archived by the owner on Feb 12, 2018. It is now read-only.

Commit

Permalink
Fnal 01.02.00 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
peppertree committed Jun 25, 2014
1 parent d184575 commit 6f7789e
Show file tree
Hide file tree
Showing 20 changed files with 244 additions and 90 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,10 @@ $RECYCLE.BIN/

# Mac crap
.DS_Store
*.zip
*.cache
*.dll
*.pdb
obj/Release/Connect.Modules.AccountUpdate.xml
obj/Release/Connect_AccountUpdate.vbproj.FileListAbsolute.txt
*.cache
38 changes: 28 additions & 10 deletions App_LocalResources/Settings.ascx.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ControlTitle_settings.Text" xml:space="preserve">
<value>Registration Settings</value>
<value>Account Update Settings</value>
</data>
<data name="lblUsernameMode.Text" xml:space="preserve">
<value>Username Mode:</value>
Expand All @@ -130,28 +130,28 @@
<value>Let the user select</value>
</data>
<data name="Username_UseEmail.Text" xml:space="preserve">
<value>Create from E-Mail Address</value>
<value>Strore from E-Mail Address</value>
</data>
<data name="Username_FirstletterLastname.Text" xml:space="preserve">
<value>Create in the form [Firstletter from Firstname + .Lastname]</value>
<value>Strore in the form [Firstletter from Firstname + .Lastname]</value>
</data>
<data name="Displayname_FirstletterLastname" xml:space="preserve">
<value>Create in the form [Firstletter from Firstname + .Lastname]</value>
<value>Strore in the form [Firstletter from Firstname + .Lastname]</value>
</data>
<data name="Displayname_FirstnameLastname" xml:space="preserve">
<value>Create in the form [Firstname.Lastname]</value>
<value>Strore in the form [Firstname.Lastname]</value>
</data>
<data name="Displayname_FreeEnter.Text" xml:space="preserve">
<value>Let the user select</value>
</data>
<data name="Displayname_FromEmail" xml:space="preserve">
<value>Create from E-Mail Address</value>
<value>Strore from E-Mail Address</value>
</data>
<data name="Displayname_Lastname" xml:space="preserve">
<value>Create from Lastname</value>
<value>Strore from Lastname</value>
</data>
<data name="lblAddToRole.Help" xml:space="preserve">
<value>You may optionally select a role that the user is being added to once registering through this module instance</value>
<value>You may optionally select a role that the user is being added to once updating its profile through this module instance</value>
</data>
<data name="lblAddToRole.Text" xml:space="preserve">
<value>Add to Role on Submit:</value>
Expand Down Expand Up @@ -187,15 +187,33 @@
<value>Usermanagement Page:</value>
</data>
<data name="Username_FirstnameLastname" xml:space="preserve">
<value>Create in the form [Firstname.Lastname]</value>
<value>Strore in the form [Firstname.Lastname]</value>
</data>
<data name="Username_Lastname" xml:space="preserve">
<value>Create from Lastname</value>
<value>Strore from Lastname</value>
</data>
<data name="lblInterface.Help" xml:space="preserve">
<value>Enter the external interface qualifier. See &lt;a href="https://github.com/DNN-Connect/UserAccountUpdate/wiki/External-Interfaces" target="_blank"&gt;this article&lt;/a&gt; on how to do that and how it can help you.</value>
</data>
<data name="lblInterface.Text" xml:space="preserve">
<value>External Interface</value>
</data>
<data name="lblRemoveFromRole.Help" xml:space="preserve">
<value>You may optionally select a role that the user is being removed from once updating its profile through this module instance</value>
</data>
<data name="lblRemoveFromRole.Text" xml:space="preserve">
<value>Remove from Role</value>
</data>
<data name="lblAddToRoleStatus.Help" xml:space="preserve">
<value>Select the status of the role membership after submitting the form</value>
</data>
<data name="lblAddToRoleStatus.Text" xml:space="preserve">
<value>Role status after submit:</value>
</data>
<data name="StatusApproved.Text" xml:space="preserve">
<value>Approved</value>
</data>
<data name="StatusPending.Text" xml:space="preserve">
<value>Pending</value>
</data>
</root>
4 changes: 2 additions & 2 deletions AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("01.01.00")>
<Assembly: AssemblyFileVersion("01.01.00")>
<Assembly: AssemblyVersion("01.02.00")>
<Assembly: AssemblyFileVersion("01.02.00")>
2 changes: 1 addition & 1 deletion Connect_AccountUpdate.dnn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<dotnetnuke type="Package" version="5.0">
<packages>
<package name="Connect AccountUpdateForm" type="Module" version="01.01.00">
<package name="Connect AccountUpdateForm" type="Module" version="01.02.00">
<friendlyName>Connect: AccountUpdate</friendlyName>
<description>A community module that handles account updates in DNN</description>
<iconFile>Images/icon_extensions.gif</iconFile>
Expand Down
16 changes: 16 additions & 0 deletions ReleaseNotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@
<div class="License">
<h3>Release Notes</h3>

<p class="Owner">
<b>Version 01.02.00</b><br /><br />
</p>
<p>Extended Token Support</p>
<h4>Changes</h4>
<ul>
<li>New conditional token: [IFSOCIALMEMBERSHIPPENDING:XXX]...[/IFSOCIALMEMBERSHIPPENDING:XXX] renders everything in between the tokens if the current user is in the specified XXX social group and the group membership is pending.</li>
<li>New conditional token: [IFSOCIALMEMBERSHIPAPPROVED:XXX]...[/IFSOCIALMEMBERSHIPAPPROVED:XXX] renders everything in between the tokens if the current user is in the specified XXX social group and the group membership is pending.</li>
<li>New conditional token: [IFSOCIALMEMBERSHIPNONE:XXX]...[/IFSOCIALMEMBERSHIPNONE:XXX] renders everything in between the tokens if the current user is not yet in the specified XXX social group and also has not applied yet for becoming a member.</li>
<li>New conditional token: [IFISINROLE:XXX]...[/IFISINROLE:XXX] renders everything in between the tokens if the current user is in the specified XXX role.</li>
<li>New conditional token: [IFNOTISINROLE:XXX]...[/IFNOTISINROLE:XXX] renders everything in between the tokens if the current user is not in the specified XXX role.</li>
<li>New control token: [CTL:ROLEMEMBERSHP:XXX] renders a checkbox that - once checked - will add the user account to the specified XXX role.</li>
<li>New control token: [CTL:ROLEMEMBERSHP:XXX:Pending] will do the same but will rather make the role membership pending.</li>
<li>New Setting: When adding users to a role through the modulesettings you can now set the status of that role membership</li>
</ul>

<p class="Owner">
<b>Version 01.00.01</b><br /><br />
</p>
Expand Down
Binary file modified Resources.zip
Binary file not shown.
8 changes: 8 additions & 0 deletions Settings.ascx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@
<asp:DropDownList ID="drpAddToRole" runat="server" DataTextField="RoleName" DataValueField="RoleId"></asp:DropDownList>
</div>

<div class="dnnFormItem">
<dnn:Label ID="lblAddToRoleStatus" runat="server" Text="Role status once submitted:"></dnn:Label>
<asp:DropDownList ID="drpRoleStatus" runat="server">
<asp:ListItem Text="Pending" Value="Pending"></asp:ListItem>
<asp:ListItem Text="Approved" Value="Approved"></asp:ListItem>
</asp:DropDownList>
</div>

<div class="dnnFormItem">
<dnn:Label ID="lblRemoveFromRole" runat="server" Text="Add to role on submit:"></dnn:Label>
<asp:DropDownList ID="drpRemoveFromRole" runat="server" DataTextField="RoleName" DataValueField="RoleId"></asp:DropDownList>
Expand Down
18 changes: 18 additions & 0 deletions Settings.ascx.designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Settings.ascx.vb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Namespace Connect.Modules.UserManagement.AccountUpdate
If (Settings.Contains("RemoveFromRoleOnSubmit")) Then drpRemoveFromRole.SelectedValue = Settings("RemoveFromRoleOnSubmit").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)
If (Settings.Contains("AddToRoleStatus")) Then drpRoleStatus.SelectedValue = CType(Settings("AddToRoleStatus"), String)

End If
Catch exc As Exception 'Module failed to load
Expand All @@ -46,6 +47,7 @@ Namespace Connect.Modules.UserManagement.AccountUpdate
'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)
objModules.UpdateTabModuleSetting(TabModuleId, "AddToRoleStatus", drpRoleStatus.SelectedValue)

Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
Expand Down
15 changes: 15 additions & 0 deletions Templates/Default/Form.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@

<p>
[IFSOCIALMEMBERSHIPPENDING:Association Member]
Hello pending member
[/IFSOCIALMEMBERSHIPPENDING:Association Member]

[IFSOCIALMEMBERSHIPAPPROVED:Association Member]
Hello approved member
[/IFSOCIALMEMBERSHIPAPPROVED:Association Member]

[IFSOCIALMEMBERSHIPNONE:Association Member]
Hello non-member
[/IFSOCIALMEMBERSHIPNONE:Association Member]

</p>

<div class="dnnForm dnnClear">

<div class="dnnFormItem dnnClear">
Expand Down
37 changes: 34 additions & 3 deletions View.ascx.vb
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,12 @@ Namespace Connect.Modules.UserManagement.AccountUpdate
If AddToRoleOnSubmit <> Null.NullInteger Then
Try
Dim rc As New RoleController
rc.AddUserRole(PortalId, oUser.UserID, AddToRoleOnSubmit, Null.NullDate)

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
Expand All @@ -373,6 +378,32 @@ Namespace Connect.Modules.UserManagement.AccountUpdate
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

Expand All @@ -390,7 +421,7 @@ Namespace Connect.Modules.UserManagement.AccountUpdate
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))
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)
Expand Down Expand Up @@ -440,7 +471,7 @@ Namespace Connect.Modules.UserManagement.AccountUpdate
lblSucess.Text = "<ul><li>" & Localization.GetString("AccountUpdateSuccess.Text", LocalResourceFile) & "</li></ul>"
pnlSuccess.Visible = True

If ExternalInterface <> Null.NullInteger Then
If ExternalInterface <> Null.NullString Then

Dim objInterface As Object = Nothing

Expand Down
Binary file modified obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Binary file not shown.
Binary file modified obj/Release/Connect.Modules.AccountUpdate.dll
Binary file not shown.
Binary file modified obj/Release/Connect.Modules.AccountUpdate.pdb
Binary file not shown.
Loading

0 comments on commit 6f7789e

Please sign in to comment.