Skip to content

Commit fc3e565

Browse files
committed
Cleaning up advanced settings, removing junk
1 parent ed9c709 commit fc3e565

8 files changed

Lines changed: 11 additions & 175 deletions

File tree

BlogEngine/BlogEngine.Core/BlogSettings.cs

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -763,51 +763,6 @@ public bool EnablePasswordReset
763763

764764
#endregion
765765

766-
#region White list count
767-
768-
///<summary>
769-
/// Number of comments approved to add user to white list
770-
///</summary>
771-
public int CommentWhiteListCount { get; set; }
772-
773-
#endregion
774-
775-
#region Black list count
776-
777-
///<summary>
778-
/// Number of comments approved to add user to white list
779-
///</summary>
780-
public int CommentBlackListCount { get; set; }
781-
782-
#endregion
783-
784-
#region AddIpToWhitelistFilterOnApproval
785-
786-
///<summary>
787-
/// Automatically add IP address to white list filter when comment is approved.
788-
///</summary>
789-
public bool AddIpToWhitelistFilterOnApproval { get; set; }
790-
791-
#endregion
792-
793-
#region AddIpToBlacklistFilterOnRejection
794-
795-
///<summary>
796-
/// Automatically add IP address to black list filter when comment is rejected.
797-
///</summary>
798-
public bool AddIpToBlacklistFilterOnRejection { get; set; }
799-
800-
#endregion
801-
802-
#region BlockAuthorOnCommentDelete
803-
804-
///<summary>
805-
/// Automatically add author to Block list when comment is deleted.
806-
///</summary>
807-
public bool BlockAuthorOnCommentDelete { get; set; }
808-
809-
#endregion
810-
811766
#region SecurityValidationKey
812767

813768
/// <summary>

BlogEngine/BlogEngine.Core/Data/Models/Settings.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,6 @@ public Settings() { }
173173
public string DisqusWebsiteName { get; set; }
174174

175175
// custom filters
176-
public int CommentWhiteListCount { get; set; }
177-
public int CommentBlackListCount { get; set; }
178-
public bool AddIpToWhitelistFilterOnApproval { get; set; }
179176
public bool TrustAuthenticatedUsers { get; set; }
180-
public bool BlockAuthorOnCommentDelete { get; set; }
181-
public bool AddIpToBlacklistFilterOnRejection { get; set; }
182177
}
183178
}

BlogEngine/BlogEngine.Core/Data/SettingsRepository.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,7 @@ public bool Update(Settings ns)
128128
bs.DisqusWebsiteName = ns.DisqusWebsiteName;
129129

130130
// custom filters
131-
bs.CommentWhiteListCount = ns.CommentWhiteListCount;
132-
bs.CommentBlackListCount = ns.CommentBlackListCount;
133-
bs.AddIpToWhitelistFilterOnApproval = ns.AddIpToWhitelistFilterOnApproval;
134131
bs.TrustAuthenticatedUsers = ns.TrustAuthenticatedUsers;
135-
bs.BlockAuthorOnCommentDelete = ns.BlockAuthorOnCommentDelete;
136-
bs.AddIpToBlacklistFilterOnRejection = ns.AddIpToBlacklistFilterOnRejection;
137132

138133
bs.Save();
139134
return true;
@@ -247,12 +242,7 @@ private Settings GetSettings()
247242
ns.DisqusWebsiteName = bs.DisqusWebsiteName;
248243

249244
// custom filters
250-
ns.CommentWhiteListCount = bs.CommentWhiteListCount;
251-
ns.CommentBlackListCount = bs.CommentBlackListCount;
252-
ns.AddIpToWhitelistFilterOnApproval = bs.AddIpToWhitelistFilterOnApproval;
253245
ns.TrustAuthenticatedUsers = bs.TrustAuthenticatedUsers;
254-
ns.BlockAuthorOnCommentDelete = bs.BlockAuthorOnCommentDelete;
255-
ns.AddIpToBlacklistFilterOnRejection = bs.AddIpToBlacklistFilterOnRejection;
256246

257247
return ns;
258248
}

BlogEngine/BlogEngine.Core/Services/Messaging/Protection/CommentHandlers.cs

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ public static ICustomFilter GetCustomFilter(string className)
154154
public static void Listen()
155155
{
156156
Post.AddingComment += PostAddingComment;
157-
Post.CommentRemoved += PostCommentRemoved;
158157

159158
InitFilters();
160159
InitCustomFilters();
@@ -451,18 +450,16 @@ where c.Email.ToLowerInvariant() == comment.Email.ToLowerInvariant() || c.IP ==
451450
}
452451
}
453452

454-
// user is in the white list - approve comment
455-
if (BlogSettings.Instance.CommentWhiteListCount > 0 &&
456-
whiteCnt >= BlogSettings.Instance.CommentWhiteListCount)
453+
// user posted 10 or more approved comments - trust
454+
if (whiteCnt >= 10)
457455
{
458456
comment.IsApproved = true;
459457
comment.ModeratedBy = "Rule:white list";
460458
return true;
461459
}
462460

463-
// user is in the black list - reject comment
464-
if (BlogSettings.Instance.CommentBlackListCount > 0 &&
465-
blackCnt >= BlogSettings.Instance.CommentBlackListCount)
461+
// user posted 10 or more spam comments - reject
462+
if (blackCnt >= 10)
466463
{
467464
comment.IsSpam = true;
468465
comment.IsApproved = false;
@@ -510,26 +507,6 @@ private static void PostAddingComment(object sender, CancelEventArgs e)
510507
}
511508
}
512509

513-
/// <summary>
514-
/// Handles the CommentRemoved event.
515-
/// </summary>
516-
/// <param name="sender">
517-
/// The source of the event.
518-
/// </param>
519-
/// <param name="e">
520-
/// The <see cref="System.ComponentModel.CancelEventArgs"/> instance containing the event data.
521-
/// </param>
522-
private static void PostCommentRemoved(object sender, EventArgs e)
523-
{
524-
var comment = (Comment)sender;
525-
if (comment == null) { return; }
526-
527-
if (BlogSettings.Instance.BlockAuthorOnCommentDelete)
528-
{
529-
AddEmailToFilter(comment.Email, true);
530-
}
531-
}
532-
533510
/// <summary>
534511
/// The run custom moderators.
535512
/// </summary>

BlogEngine/BlogEngine.NET/Web.sitemap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<siteMapNode url="default.aspx" title="Blog Engine" description="">
44
<siteMapNode url="~/admin/index.cshtml" title="dashboard" description="" rights="ViewDashboard" />
55
<siteMapNode url="~/admin/#/content/posts" title="content" description="" rightsAuthorizationCheck="HasAny" rights="CreateNewPosts, EditOwnPosts, EditOtherUsersPosts, PublishOwnPosts, PublishOtherUsersPosts" />
6-
<siteMapNode url="~/admin/#/custom/extensions" title="custom" description="" rightsAuthorizationCheck="HasAny" rights="ManageExtensions, ManageWidgets, ManageThemes, ManagePackages" />
6+
<siteMapNode url="~/admin/#/custom/plugins" title="custom" description="" rightsAuthorizationCheck="HasAny" rights="ManageExtensions, ManageWidgets, ManageThemes, ManagePackages" />
77
<siteMapNode url="~/admin/#/settings/basic" title="settings" rights="AccessAdminSettingsPages" description="" />
88
</siteMapNode>
99
</siteMap>

BlogEngine/BlogEngine.NET/admin/app/controllers/settings.js

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,6 @@
1919
{ "OptionName": "20", "OptionValue": "20", "IsSelected": false },
2020
{ "OptionName": "50", "OptionValue": "50", "IsSelected": false }
2121
];
22-
$scope.whiteListOptions = [
23-
{ "OptionName": "0", "OptionValue": "0", "IsSelected": false },
24-
{ "OptionName": "1", "OptionValue": "1", "IsSelected": false },
25-
{ "OptionName": "2", "OptionValue": "2", "IsSelected": false },
26-
{ "OptionName": "3", "OptionValue": "3", "IsSelected": false },
27-
{ "OptionName": "4", "OptionValue": "4", "IsSelected": false },
28-
{ "OptionName": "5", "OptionValue": "5", "IsSelected": false }
29-
];
30-
$scope.blackListOptions = [
31-
{ "OptionName": "0", "OptionValue": "0", "IsSelected": false },
32-
{ "OptionName": "1", "OptionValue": "1", "IsSelected": false },
33-
{ "OptionName": "2", "OptionValue": "2", "IsSelected": false },
34-
{ "OptionName": "3", "OptionValue": "3", "IsSelected": false },
35-
{ "OptionName": "4", "OptionValue": "4", "IsSelected": false },
36-
{ "OptionName": "5", "OptionValue": "5", "IsSelected": false }
37-
];
3822
$scope.timeZoneOptions = [];
3923

4024
$scope.load = function () {
@@ -63,8 +47,6 @@
6347
$scope.selCloseDays = selectedOption($scope.vm.CloseDaysOptions, $scope.settings.DaysCommentsAreEnabled);
6448
$scope.selCommentsPerPage = selectedOption($scope.commentsPerPageOptions, $scope.settings.CommentsPerPage);
6549
$scope.selTimeZone = selectedOption($scope.timeZoneOptions, $scope.settings.TimeZoneId);
66-
$scope.whiteListSelected = selectedOption($scope.whiteListOptions, $scope.settings.CommentWhiteListCount);
67-
$scope.blackListSelected = selectedOption($scope.blackListOptions, $scope.settings.CommentBlackListCount);
6850
$scope.setCommentProviders($scope.settings.CommentProvider);
6951
spinOff();
7052
})
@@ -87,10 +69,6 @@
8769
$scope.settings.DaysCommentsAreEnabled = $scope.selCloseDays.OptionValue;
8870
$scope.settings.CommentsPerPage = $scope.selCommentsPerPage.OptionValue;
8971
$scope.settings.TimeZoneId = $scope.selTimeZone.OptionValue;
90-
91-
$scope.settings.CommentWhiteListCount = $scope.whiteListSelected.OptionValue;
92-
$scope.settings.CommentBlackListCount = $scope.blackListSelected.OptionValue;
93-
9472
$scope.settings.txtErrorTitle = $scope.txtErrorTitle;
9573

9674
dataService.updateItem("/api/settings", $scope.settings)
@@ -154,8 +132,6 @@
154132
}
155133

156134
$scope.selectProvider = function (provider) {
157-
//alert(provider);
158-
159135
if (provider == 'be') {
160136
$("#dq-provider").fadeOut();
161137
$("#be-provider").fadeIn();

BlogEngine/BlogEngine.NET/admin/views/settings/advanced.html

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ <h2 class="page-title pull-left">
4848
{{lbl.compressWebResource}}
4949
</label>
5050
</div>
51-
<div class="checkbox">
52-
<label>
53-
<input type="checkbox" name="ckRequireSslForMetaWeblogApi" data-ng-model="settings.RequireSslForMetaWeblogApi" />
54-
{{lbl.requireSslForMetaWeblogApi}}
55-
</label>
56-
</div>
5751
<div class="checkbox">
5852
<label>
5953
<input type="checkbox" name="ckEnableOpenSearch" data-ng-model="settings.EnableOpenSearch" />
@@ -163,64 +157,7 @@ <h4> {{lbl.securitySettings}}</h4>
163157
<input type="text" class=" form-control" id="txtRemoteMaxFileSize" name="txtRemoteMaxFileSize" data-ng-model="settings.RemoteMaxFileSize" data-ng-disabled="settings.AllowServerToDownloadRemoteFiles == false" />
164158
</div>
165159
</div>
166-
<hr />
167-
168-
169-
<div class="form-group">
170-
<label class="col-md-4">
171-
</label>
172-
<div class="col-md-8">
173-
<h4>{{lbl.rules}}</h4>
174-
175-
</div>
176-
</div>
177-
178-
<div class="form-group">
179-
<label class="col-md-4">
180-
181-
182-
</label>
183-
<div class="col-md-8">
184-
<div class="checkbox">
185-
<label>
186-
<input type="checkbox" data-ng-model="settings.AddIpToWhitelistFilterOnApproval" />
187-
{{lbl.whitelistIpOnCommentApproval}}
188-
</label>
189-
</div>
190-
<div class="checkbox">
191-
<label>
192-
<input type="checkbox" data-ng-model="settings.TrustAuthenticatedUsers" />
193-
{{lbl.trustAuthenticated}}
194-
</label>
195-
</div>
196-
<select id="selWiteListCount" class="form-control" data-ng-options="o.OptionName for o in whiteListOptions" data-ng-model="whiteListSelected"></select>
197-
<label for="selCultures">{{lbl.addToWhiteList}}</label>
198-
<label for="selCultures">{{lbl.authorApproved}}</label>
199-
</div>
200-
</div>
201-
202-
<div class="form-group">
203-
<label class="col-md-4">
204-
</label>
205-
<div class="col-md-8">
206-
<div class="checkbox">
207-
<label>
208-
<input type="checkbox" data-ng-model="settings.BlockAuthorOnCommentDelete" />
209-
{{lbl.commentsBlockOnDelete}}
210-
</label>
211-
</div>
212-
<div class="checkbox">
213-
<label>
214-
<input type="checkbox" data-ng-model="settings.AddIpToBlacklistFilterOnRejection" />
215-
{{lbl.blacklistIpOnCommentRejection}}
216-
</label>
217-
</div>
218-
<select id="selBlackListCount" class="form-control" data-ng-options="o.OptionName for o in blackListOptions" data-ng-model="blackListSelected"></select>
219-
<label for="selCultures">{{lbl.commentsBlacklist}}</label>
220-
<label for="selCultures">{{lbl.authorRejected}}</label>
221160

222-
</div>
223-
</div>
224161
</div>
225162
</div>
226163
</form>

BlogEngine/BlogEngine.NET/admin/views/settings/comments.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ <h2 class="page-title pull-left">
5656
{{lbl.enableCommentsModeration}}
5757
</label>
5858
</div>
59+
<div class="checkbox">
60+
<label>
61+
<input type="checkbox" ng-model="settings.TrustAuthenticatedUsers" ng-disabled="settings.IsCommentsEnabled == false || settings.CommentProvider > 0" />
62+
{{lbl.trustAuthenticated}}
63+
</label>
64+
</div>
5965
<div class="checkbox">
6066
<label>
6167
<input type="checkbox" name="ckIsCommentNestingEnabled" data-ng-model="settings.IsCommentNestingEnabled" data-ng-disabled="settings.IsCommentsEnabled == false || settings.CommentProvider > 0" />

0 commit comments

Comments
 (0)