Skip to content

Commit 8e44c71

Browse files
authored
Merge pull request #1221 from johnhenley/dev82/release-testing/missing-commit-392361cf
FIX: few minor issues encountered in pre-release testing
2 parents bbf6692 + 4fa21b4 commit 8e44c71

File tree

12 files changed

+193
-94
lines changed

12 files changed

+193
-94
lines changed

Dnn.CommunityForums/Classic.ascx.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ protected override void OnLoad(EventArgs e)
6868
//ForumsConfig.Install_Upgrade_CreateForumDefaultSettingsAndSecurity_080200();
6969
//new DotNetNuke.Modules.ActiveForums.Controllers.PermissionController().RemoveUnused(this.ForumModuleId);
7070
//DotNetNuke.Modules.ActiveForums.Helpers.UpgradeModuleSettings.AddUrlPrefixLikes_080200();
71-
ForumsConfig.Install_LikeNotificationType_080200();
72-
ForumsConfig.Install_PinNotificationType_080200();
71+
//ForumsConfig.Install_LikeNotificationType_080200();
72+
//ForumsConfig.Install_PinNotificationType_080200();
73+
ForumsConfig.Sort_PermissionSets_080200();
7374
#endif
7475

7576
try

Dnn.CommunityForums/ControlPanel.css

+3-2
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,8 @@ ul.amcpformlist li div.amcpradiorow input[type="checkbox"]{font-size:14px;margin
433433
.dcf-controlpanel .dcf-controlpanel-tooltip::after{content: "?"; display:inline-block; line-height: 1.5em; width: 1.6em; text-align:center; color: var(--tooltip-icon-color); border: solid 1px var(--tooltip-icon-color); border-radius: 50%; margin-left: 0.5em;}
434434
.dcf-controlpanel .dcf-controlpanel-tooltip:hover::after{ background: var(--tooltip-bg-color); border-color: var(--tooltip-bg-color); color: var(--tooltip-color);}
435435

436-
.dcf-controlpanel .dcf-controlpanel-inheritance-label { width: 150px; padding-left: 3px; padding-right: 3px; text-align: center; }
437436
.dcf-controlpanel .dcf-controlpanel-inheritance-img { width: 16px; height: 16px; }
438-
.dcf-controlpanel .dcf-controlpanel-inheritance-heading-settings { margin-left: 500px; cursor: auto; }
437+
.dcf-controlpanel .dcf-controlpanel-inheritance-label { width: 150px; padding-left: 3px; padding-right: 3px; text-align: center; }
439438
.dcf-controlpanel .dcf-controlpanel-inheritance-heading-security { margin-left: 30px; cursor: auto; }
439+
.dcf-controlpanel .dcf-controlpanel-inheritance-heading-settings { margin-left: 665px; cursor: auto; }
440+

Dnn.CommunityForums/Controllers/PermissionController.cs

+32-16
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,10 @@ namespace DotNetNuke.Modules.ActiveForums.Controllers
2222
{
2323
using System;
2424
using System.Collections.Specialized;
25-
using System.Data;
26-
using System.Drawing;
2725
using System.Linq;
28-
using System.Reflection;
29-
using System.Security.Cryptography;
30-
using System.Web.Razor.Parser.SyntaxTree;
31-
using System.Web.Security;
32-
using System.Web.UI.WebControls;
26+
using System.Linq.Expressions;
3327

3428
using DotNetNuke.Abstractions.Portals;
35-
using DotNetNuke.Common.Controls;
36-
using DotNetNuke.Entities.Portals;
37-
using DotNetNuke.Modules.ActiveForums.API;
38-
using DotNetNuke.Modules.ActiveForums.DAL2;
39-
using Microsoft.ApplicationBlocks.Data;
4029

4130
internal class PermissionController : DotNetNuke.Modules.ActiveForums.Controllers.RepositoryControllerBase<DotNetNuke.Modules.ActiveForums.Entities.PermissionInfo>
4231
{
@@ -67,6 +56,7 @@ internal class PermissionController : DotNetNuke.Modules.ActiveForums.Controller
6756
internal new DotNetNuke.Modules.ActiveForums.Entities.PermissionInfo Update(DotNetNuke.Modules.ActiveForums.Entities.PermissionInfo permissionInfo)
6857
{
6958
var cachekey = this.GetCacheKey(moduleId: permissionInfo.ModuleId, id: permissionInfo.PermissionsId);
59+
DataCache.SettingsCacheClear(permissionInfo.ModuleId, cachekey);
7060
base.Update(permissionInfo);
7161
return this.GetById(permissionInfo.PermissionsId, permissionInfo.ModuleId);
7262
}
@@ -616,12 +606,38 @@ public static string RemovePermFromSet(string objectId, int objectType, string p
616606
return newSet;
617607
}
618608

609+
public static string SortPermissionSetMembers(string permissionSet)
610+
{
611+
if (string.IsNullOrEmpty(permissionSet))
612+
{
613+
return string.Empty;
614+
}
615+
616+
string newSet = string.Empty;
617+
618+
string[] permSet = permissionSet.Split('|');
619+
for (int section = 0; section < 2; section++)
620+
{
621+
var members = permSet[section].Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).ToArray();
622+
Array.Sort(members);
623+
permSet[section] = string.Join(";", members);
624+
if (!string.IsNullOrEmpty(permSet[section]))
625+
{
626+
permSet[section] += ";";
627+
}
628+
629+
newSet += string.Concat(permSet[section], "|");
630+
}
631+
632+
return newSet;
633+
}
634+
619635
public static string AddPermToSet(string objectId, int objectType, string permissionSet)
620636
{
621637
string newSet = RemovePermFromSet(objectId, objectType, permissionSet);
622638
string[] permSet = newSet.Split('|');
623-
permSet[objectType] += string.Concat(objectId, ";");
624-
newSet = string.Concat(permSet[0] + "|" + permSet[1] + "|" + permSet[2], "|");
639+
permSet[objectType] += SortPermissionSetMembers(string.Concat(objectId, ";"));
640+
newSet = string.Concat(permSet[0] + "|" + (permSet.Length > 1 ? permSet[1] : string.Empty) + "|" + (permSet.Length > 2 ? permSet[2] : string.Empty), "|");
625641
return newSet;
626642
}
627643

@@ -647,20 +663,20 @@ internal static string GetSecureObjectList(IPortalSettings portalSettings, DotNe
647663

648664
roleObjects = GetObjFromSecObj(portalSettings, s.Announce, objectType, roleObjects);
649665
roleObjects = GetObjFromSecObj(portalSettings, s.Attach, objectType, roleObjects);
666+
roleObjects = GetObjFromSecObj(portalSettings, s.Ban, objectType, roleObjects);
650667
roleObjects = GetObjFromSecObj(portalSettings, s.Categorize, objectType, roleObjects);
651668
roleObjects = GetObjFromSecObj(portalSettings, s.Create, objectType, roleObjects);
652669
roleObjects = GetObjFromSecObj(portalSettings, s.Delete, objectType, roleObjects);
653670
roleObjects = GetObjFromSecObj(portalSettings, s.Edit, objectType, roleObjects);
654671
roleObjects = GetObjFromSecObj(portalSettings, s.Lock, objectType, roleObjects);
655672
roleObjects = GetObjFromSecObj(portalSettings, s.Moderate, objectType, roleObjects);
656673
roleObjects = GetObjFromSecObj(portalSettings, s.Move, objectType, roleObjects);
657-
roleObjects = GetObjFromSecObj(portalSettings, s.Split, objectType, roleObjects);
658-
roleObjects = GetObjFromSecObj(portalSettings, s.Ban, objectType, roleObjects);
659674
roleObjects = GetObjFromSecObj(portalSettings, s.Pin, objectType, roleObjects);
660675
roleObjects = GetObjFromSecObj(portalSettings, s.Poll, objectType, roleObjects);
661676
roleObjects = GetObjFromSecObj(portalSettings, s.Prioritize, objectType, roleObjects);
662677
roleObjects = GetObjFromSecObj(portalSettings, s.Read, objectType, roleObjects);
663678
roleObjects = GetObjFromSecObj(portalSettings, s.Reply, objectType, roleObjects);
679+
roleObjects = GetObjFromSecObj(portalSettings, s.Split, objectType, roleObjects);
664680
roleObjects = GetObjFromSecObj(portalSettings, s.Subscribe, objectType, roleObjects);
665681
roleObjects = GetObjFromSecObj(portalSettings, s.Tag, objectType, roleObjects);
666682
roleObjects = GetObjFromSecObj(portalSettings, s.Trust, objectType, roleObjects);

Dnn.CommunityForums/Entities/FeatureSettings.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,11 @@ public bool EqualSettings(FeatureSettings other)
301301
this.AutoSubscribeRoles == other.AutoSubscribeRoles &&
302302
this.AutoSubscribeNewTopicsOnly == other.AutoSubscribeNewTopicsOnly &&
303303
this.CreatePostCount == other.CreatePostCount &&
304-
this.ReplyPostCount == other.ReplyPostCount &&
305-
this.AttachMaxHeight == other.AttachMaxHeight &&
306-
this.AttachMaxWidth == other.AttachMaxWidth &&
307-
this.EditorStyle == other.EditorStyle &&
308-
this.EditorToolBar == other.EditorToolBar;
304+
this.ReplyPostCount == other.ReplyPostCount /*&&*/
305+
/*this.AttachMaxHeight == other.AttachMaxHeight &&*/
306+
/*this.AttachMaxWidth == other.AttachMaxWidth &&*/
307+
/*this.EditorStyle == other.EditorStyle &&*/
308+
/*this.EditorToolBar == other.EditorToolBar*/;
309309
}
310310
}
311311
}

Dnn.CommunityForums/Entities/ForumInfo.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ namespace DotNetNuke.Modules.ActiveForums.Entities
3838
// TODO [Cacheable("activeforums_Forums", CacheItemPriority.Low)] /* TODO: DAL2 caching cannot be used until all CRUD methods use DAL2; must update Save method to use DAL2 rather than stored procedure */
3939
public class ForumInfo : DotNetNuke.Services.Tokens.IPropertyAccess
4040
{
41-
[IgnoreColumn] private string cacheKeyTemplate => CacheKeys.ForumInfo;
41+
[IgnoreColumn]
42+
private string cacheKeyTemplate => CacheKeys.ForumInfo;
4243
private DotNetNuke.Modules.ActiveForums.Entities.ForumGroupInfo forumGroup;
4344
private List<DotNetNuke.Modules.ActiveForums.Entities.ForumInfo> subforums;
4445
private DotNetNuke.Modules.ActiveForums.Entities.PermissionInfo security;

Dnn.CommunityForums/Entities/ForumUserInfo.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ namespace DotNetNuke.Modules.ActiveForums.Entities
3636
[Scope("PortalId")]
3737
public class ForumUserInfo : DotNetNuke.Services.Tokens.IPropertyAccess
3838
{
39-
[IgnoreColumn] private string cacheKeyTemplate => CacheKeys.ForumUser;
39+
[IgnoreColumn]
40+
private string cacheKeyTemplate => CacheKeys.ForumUser;
4041
private DotNetNuke.Entities.Users.UserInfo userInfo;
4142
private PortalSettings portalSettings;
4243
private SettingsInfo mainSettings;
@@ -134,7 +135,8 @@ public ForumUserInfo(int moduleId)
134135
[IgnoreColumn]
135136
public string[] Roles => this.UserInfo?.Roles;
136137

137-
[IgnoreColumn] public string FirstName => this.UserInfo?.FirstName;
138+
[IgnoreColumn]
139+
public string FirstName => this.UserInfo?.FirstName;
138140

139141
[IgnoreColumn]
140142
public string LastName => string.IsNullOrEmpty(this.UserInfo?.LastName) ? string.Empty : this.UserInfo?.LastName;

Dnn.CommunityForums/Entities/PermissionInfo.cs

+29-22
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ namespace DotNetNuke.Modules.ActiveForums.Entities
3232
[Scope("ModuleId")]
3333
public class PermissionInfo
3434
{
35-
[IgnoreColumn] private string cacheKeyTemplate => CacheKeys.PermissionsInfo;
35+
[IgnoreColumn]
36+
private string cacheKeyTemplate => CacheKeys.PermissionsInfo;
3637

3738
public int PermissionsId { get; set; }
3839

@@ -117,27 +118,33 @@ public class PermissionInfo
117118
public bool EqualPermissions(PermissionInfo other)
118119
{
119120
return !(other is null) &&
120-
this.View == other.View &&
121-
this.Read == other.Read &&
122-
this.Create == other.Create &&
123-
this.Reply == other.Reply &&
124-
this.Edit == other.Edit &&
125-
this.Delete == other.Delete &&
126-
this.Lock == other.Lock &&
127-
this.Pin == other.Pin &&
128-
this.Attach == other.Attach &&
129-
this.Poll == other.Poll &&
130-
this.Block == other.Block &&
131-
this.Trust == other.Trust &&
132-
this.Subscribe == other.Subscribe &&
133-
this.Announce == other.Announce &&
134-
this.Tag == other.Tag &&
135-
this.Categorize == other.Categorize &&
136-
this.Prioritize == other.Prioritize &&
137-
this.Moderate == other.Moderate &&
138-
this.Move == other.Move &&
139-
this.Split == other.Split &&
140-
this.Ban == other.Ban;
121+
EqualPermissionMembers(this.Announce, other.Announce) &&
122+
EqualPermissionMembers(this.Attach, other.Attach) &&
123+
EqualPermissionMembers(this.Ban, other.Ban) &&
124+
//EqualPermissionMembers(this.Block, other.Block) &&
125+
EqualPermissionMembers(this.Categorize, other.Categorize) &&
126+
EqualPermissionMembers(this.Create, other.Create) &&
127+
EqualPermissionMembers(this.Delete, other.Delete) &&
128+
EqualPermissionMembers(this.Edit, other.Edit) &&
129+
EqualPermissionMembers(this.Lock, other.Lock) &&
130+
EqualPermissionMembers(this.Moderate, other.Moderate) &&
131+
EqualPermissionMembers(this.Moderate, other.Moderate) &&
132+
EqualPermissionMembers(this.Move, other.Move) &&
133+
EqualPermissionMembers(this.Pin, other.Pin) &&
134+
EqualPermissionMembers(this.Poll, other.Poll) &&
135+
EqualPermissionMembers(this.Prioritize, other.Prioritize) &&
136+
EqualPermissionMembers(this.Read, other.Read) &&
137+
EqualPermissionMembers(this.Reply, other.Reply) &&
138+
EqualPermissionMembers(this.Split, other.Split) &&
139+
EqualPermissionMembers(this.Subscribe, other.Subscribe) &&
140+
EqualPermissionMembers(this.Tag, other.Tag) &&
141+
EqualPermissionMembers(this.Trust, other.Trust) &&
142+
EqualPermissionMembers(this.View, other.View);
143+
144+
bool EqualPermissionMembers(string thisPermissions, string otherPermissions)
145+
{
146+
return (thisPermissions == otherPermissions || (thisPermissions.Equals("||") && string.IsNullOrEmpty(otherPermissions)) || string.IsNullOrEmpty(thisPermissions) && otherPermissions.Equals("||"));
147+
}
141148
}
142149

143150
internal string GetCacheKey() => string.Format(this.cacheKeyTemplate, this.ModuleId, this.PermissionsId);

Dnn.CommunityForums/Entities/ReplyInfo.cs

+25-10
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,13 @@ namespace DotNetNuke.Modules.ActiveForums.Entities
3737
[TableName("activeforums_Replies")]
3838
[PrimaryKey("ReplyId")]
3939
public partial class ReplyInfo : DotNetNuke.Modules.ActiveForums.Entities.IPostInfo
40+
<<<<<<< HEAD
41+
{
42+
private string cacheKeyTemplate => CacheKeys.ReplyInfo;
43+
=======
4044
{
4145
[IgnoreColumn] private string cacheKeyTemplate => CacheKeys.ReplyInfo;
46+
>>>>>>> dev
4247
private DotNetNuke.Modules.ActiveForums.Entities.TopicInfo topicInfo;
4348
private DotNetNuke.Modules.ActiveForums.Entities.ContentInfo contentInfo;
4449
private DotNetNuke.Modules.ActiveForums.Entities.AuthorInfo author;
@@ -51,11 +56,14 @@ public int ForumId
5156
set => this.Topic.ForumId = value;
5257
}
5358

54-
[IgnoreColumn] public int PostId { get => this.ReplyId; }
59+
[IgnoreColumn]
60+
public int PostId { get => this.ReplyId; }
5561

56-
[IgnoreColumn] public bool IsTopic => false;
62+
[IgnoreColumn]
63+
public bool IsTopic => false;
5764

58-
[IgnoreColumn] public bool IsReply => true;
65+
[IgnoreColumn]
66+
public bool IsReply => true;
5967

6068
public int ReplyId { get; set; }
6169

@@ -73,13 +81,17 @@ public int ForumId
7381

7482
public bool IsDeleted { get; set; }
7583

76-
[IgnoreColumn] public Uri RequestUri { get; set; }
84+
[IgnoreColumn]
85+
public Uri RequestUri { get; set; }
7786

78-
[IgnoreColumn] public string RawUrl { get; set; }
87+
[IgnoreColumn]
88+
public string RawUrl { get; set; }
7989

80-
[IgnoreColumn] public int PortalId { get; set; }
90+
[IgnoreColumn]
91+
public int PortalId { get; set; }
8192

82-
[IgnoreColumn] public int ModuleId { get; set; }
93+
[IgnoreColumn]
94+
public int ModuleId { get; set; }
8395

8496
[IgnoreColumn]
8597
public DotNetNuke.Modules.ActiveForums.Entities.TopicInfo Topic
@@ -103,11 +115,14 @@ internal DotNetNuke.Modules.ActiveForums.Entities.TopicInfo GetTopic()
103115
return this.topicInfo = new DotNetNuke.Modules.ActiveForums.Controllers.TopicController(this.ModuleId).GetById(this.TopicId);
104116
}
105117

106-
[IgnoreColumn] public string Subject => this.Content.Subject;
118+
[IgnoreColumn]
119+
public string Subject => this.Content.Subject;
107120

108-
[IgnoreColumn] public string Body => this.Content.Body;
121+
[IgnoreColumn]
122+
public string Body => this.Content.Body;
109123

110-
[IgnoreColumn] public string Summary => this.Content.Summary;
124+
[IgnoreColumn]
125+
public string Summary => this.Content.Summary;
111126

112127
[IgnoreColumn]
113128
public int LikeCount

0 commit comments

Comments
 (0)