mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 03:25:23 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
@@ -82,7 +82,9 @@ namespace Orchard.Comments.Services {
|
||||
comment.Record.UserName = (CurrentUser == null ? context.Author : CurrentUser.UserName);
|
||||
comment.Record.CommentedOn = context.CommentedOn;
|
||||
|
||||
comment.Record.Status = _commentValidator.ValidateComment(comment) ? moderateComments ? CommentStatus.Pending : CommentStatus.Approved : CommentStatus.Spam;
|
||||
comment.Record.Status = _commentValidator.ValidateComment(comment)
|
||||
? moderateComments ? CommentStatus.Pending : CommentStatus.Approved
|
||||
: CommentStatus.Spam;
|
||||
|
||||
// store id of the next layer for large-grained operations, e.g. rss on blog
|
||||
//TODO:(rpaquay) Get rid of this (comment aspect takes care of container)
|
||||
|
@@ -44,14 +44,14 @@ namespace Orchard.Comments.Services {
|
||||
AkismetComment akismetComment = new AkismetComment {
|
||||
CommentAuthor = commentPart.Record.Author,
|
||||
CommentAuthorEmail = commentPart.Record.Email,
|
||||
Blog = commentPart.Record.SiteName,
|
||||
Blog = akismetUrl,
|
||||
CommentAuthorUrl = commentPart.Record.SiteName,
|
||||
CommentContent = commentPart.Record.CommentText,
|
||||
UserAgent = HttpContext.Current.Request.UserAgent,
|
||||
};
|
||||
|
||||
if (akismetApi.VerifyKey()) {
|
||||
return akismetApi.CommentCheck(akismetComment);
|
||||
return !akismetApi.CommentCheck(akismetComment); // CommentCheck returning true == spam
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@@ -9,16 +9,16 @@
|
||||
</div>
|
||||
<div>
|
||||
<%: Html.EditorFor(m => m.EnableSpamProtection) %>
|
||||
<label class="forcheckbox" for="CommentSettings_EnableSpamProtection"><%: T("Enable spam protection") %></label>
|
||||
<label class="forcheckbox" for="<%:Html.FieldIdFor(m => m.EnableSpamProtection) %>"><%: T("Enable spam protection") %></label>
|
||||
<%: Html.ValidationMessage("EnableSpamProtection", "*")%>
|
||||
</div>
|
||||
<div data-controllerid="CommentSettings_EnableSpamProtection">
|
||||
<div data-controllerid="<%:Html.FieldIdFor(m => m.EnableSpamProtection) %>">
|
||||
<label for="CommentSettings_AkismetKey"><%: T("Akismet key") %></label>
|
||||
<%: Html.EditorFor(m => m.AkismetKey) %>
|
||||
<%: Html.ValidationMessage("AkismetKey", "*")%>
|
||||
</div>
|
||||
<div data-controllerid="CommentSettings_EnableSpamProtection">
|
||||
<label for="CommentSettings_AkismetUrl"><%: T("Akismet endpoint URL") %></label>
|
||||
<div data-controllerid="<%:Html.FieldIdFor(m => m.EnableSpamProtection) %>">
|
||||
<label for="CommentSettings_AkismetUrl"><%: T("Blog URL")%></label>
|
||||
<%: Html.EditorFor(m => m.AkismetUrl) %>
|
||||
<%: Html.ValidationMessage("AkismetUrl", "*")%>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user