Skip to content

Commit 57d7c38

Browse files
authored
Merge pull request #1565 from johnhenley/issues/cant-edit-post-1562
FIX: Regular user can't edit own post if "edit interval" module setting used for spam control
2 parents de4b707 + 9522d85 commit 57d7c38

File tree

8 files changed

+12
-11
lines changed

8 files changed

+12
-11
lines changed

Dnn.CommunityForums/App_LocalResources/SharedResources.de-DE.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ Von
580580
<data name="[RESX:MemberSince].Text" xml:space="preserve">
581581
<value>Mitglied seit</value>
582582
</data>
583-
<data name="[RESX:Message:EditIntervalReached].Text" xml:space="preserve">
583+
<data name="[RESX:Message:EditIntervalNotReached].Text" xml:space="preserve">
584584
<value>In diesem Forum können Sie Ihren Beitrag nur innerhalb von {0} Minuten ab dem Zeitpunkt bearbeiten, an dem Sie Ihren Beitrag erstellt haben.</value>
585585
</data>
586586
<data name="[RESX:Message].Text" xml:space="preserve">

Dnn.CommunityForums/App_LocalResources/SharedResources.es-ES.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ De
580580
<data name="[RESX:MemberSince].Text" xml:space="preserve">
581581
<value>Miembro desde</value>
582582
</data>
583-
<data name="[RESX:Message:EditIntervalReached].Text" xml:space="preserve">
583+
<data name="[RESX:Message:EditIntervalNotReached].Text" xml:space="preserve">
584584
<value>Este foro solo te permite editar una publicación durante {0} minutos desde el momento en que se publicó.</value>
585585
</data>
586586
<data name="[RESX:Message].Text" xml:space="preserve">

Dnn.CommunityForums/App_LocalResources/SharedResources.fr-FR.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ De,
580580
<data name="[RESX:MemberSince].Text" xml:space="preserve">
581581
<value>Membre depuis</value>
582582
</data>
583-
<data name="[RESX:Message:EditIntervalReached].Text" xml:space="preserve">
583+
<data name="[RESX:Message:EditIntervalNotReached].Text" xml:space="preserve">
584584
<value>Ce forums permet seulement l'édition de publications en moins de {0} minutes suite à la publication initiale.</value>
585585
</data>
586586
<data name="[RESX:Message].Text" xml:space="preserve">

Dnn.CommunityForums/App_LocalResources/SharedResources.it-IT.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ Da
580580
<data name="[RESX:MemberSince].Text" xml:space="preserve">
581581
<value>Membro dal</value>
582582
</data>
583-
<data name="[RESX:Message:EditIntervalReached].Text" xml:space="preserve">
583+
<data name="[RESX:Message:EditIntervalNotReached].Text" xml:space="preserve">
584584
<value>Questo forum ti consente di modificare il tuo post solo entro {0} minuti dal momento in cui hai creato il tuo post.</value>
585585
</data>
586586
<data name="[RESX:Message].Text" xml:space="preserve">

Dnn.CommunityForums/App_LocalResources/SharedResources.nl-NL.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ Van,
10991099
<data name="[RESX:PrefTopicSubscribe].Help" xml:space="preserve">
11001100
<value>Dit is uw standaardinstelling wanneer u een onderwerp maakt of een antwoord toevoegt. Dit heeft geen invloed op abonnementen op forumniveau.</value>
11011101
</data>
1102-
<data name="[RESX:Message:EditIntervalReached].Text" xml:space="preserve">
1102+
<data name="[RESX:Message:EditIntervalNotReached].Text" xml:space="preserve">
11031103
<value>Dit forum staat toe dat u uw berichten kunt wijzigen tenminste {0} minuten nadat u het bericht heeft geplaatst.</value>
11041104
</data>
11051105
<data name="[RESX:SubmitVote].Text" xml:space="preserve">

Dnn.CommunityForums/App_LocalResources/SharedResources.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,7 @@ From,
11021102
<data name="[RESX:PrefTopicSubscribe].Help" xml:space="preserve">
11031103
<value>This will be your default setting when you are creating a topic or adding a reply. This does not affect forum level subscriptions.</value>
11041104
</data>
1105-
<data name="[RESX:Message:EditIntervalReached].Text" xml:space="preserve">
1105+
<data name="[RESX:Message:EditIntervalNotReached].Text" xml:space="preserve">
11061106
<value>This forum only allows you to edit your post within {0} minutes from the time you created your post.</value>
11071107
</data>
11081108
<data name="[RESX:SubmitVote].Text" xml:space="preserve">

Dnn.CommunityForums/ReleaseNotes.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@
8080
<h4>Bug Fixes</h4>
8181
<ul>
8282
<li>FIX: Update indexes on forum/topic tracking tables for uniqueness; upgrade script to detect and remove duplicates, keeping the latest entries (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1434">Issue 1434</a>)</li>
83-
<li>FIX: Forum Viewer updated to working correctly with friendly URLs and localized sites (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1557">Issue 1557</a>)</li>
84-
<li>FIX: Permissions preventing viewing of attachments (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1559">Issue 1559</a>)</li>
83+
<li>FIX: Friendly URLs updated to working correctly with Forum Viewer and/or localized sites (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1557">Issue 1557</a>)</li>
84+
<li>FIX: Incorrect logic in permissions checking for attachments (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1559">Issue 1559</a>)</li>
85+
<li>FIX: Non-Admin/Non-Moderator is unable to edit their own post when edit interval/spam control feature used (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1562">Issue 1562</a>)</li>
8586

8687
<!--
8788
<li>None at this time.</li>

Dnn.CommunityForums/controls/af_post.ascx.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,11 +377,11 @@ private void LoadTopic()
377377
this.Response.Redirect(this.NavigateUrl(this.TabId), false);
378378
this.Context.ApplicationInstance.CompleteRequest();
379379
}
380-
else if (!this.canModEdit && ti.Content.AuthorId == this.UserId && this.canEdit && this.MainSettings.EditInterval > 0 && DateTime.UtcNow.Subtract(ti.Content.DateCreated).TotalMinutes > this.MainSettings.EditInterval)
380+
else if (!this.canModEdit && ti.Content.AuthorId == this.UserId && this.canEdit && !Utilities.HasEditIntervalPassed(editInterval: this.ForumInfo.MainSettings.EditInterval, forumUser: this.ForumUser, forumInfo: this.ForumInfo, postInfo: ti))
381381
{
382382
var im = new InfoMessage
383383
{
384-
Message = "<div class=\"afmessage\">" + string.Format(this.GetSharedResource("[RESX:Message:EditIntervalReached]"), this.MainSettings.EditInterval) + "</div>",
384+
Message = "<div class=\"afmessage\">" + string.Format(this.GetSharedResource("[RESX:Message:EditIntervalNotReached]"), this.MainSettings.EditInterval) + "</div>",
385385
};
386386
this.plhMessage.Controls.Add(im);
387387
this.plhContent.Controls.Clear();
@@ -467,7 +467,7 @@ private void LoadReply()
467467
{
468468
var im = new Controls.InfoMessage
469469
{
470-
Message = "<div class=\"afmessage\">" + string.Format(this.GetSharedResource("[RESX:Message:EditIntervalReached]"), this.MainSettings.EditInterval.ToString()) + "</div>",
470+
Message = "<div class=\"afmessage\">" + string.Format(this.GetSharedResource("[RESX:Message:EditIntervalNotReached]"), this.MainSettings.EditInterval.ToString()) + "</div>",
471471
};
472472
this.plhMessage.Controls.Add(im);
473473
this.plhContent.Controls.Clear();

0 commit comments

Comments
 (0)