mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-30 18:46:01 +01:00 
			
		
		
		
	fix: #7789
This commit is contained in:
		| @@ -20,6 +20,7 @@ | |||||||
|     "chatDeleteDuration": 0, |     "chatDeleteDuration": 0, | ||||||
|     "chatMessageDelay": 200, |     "chatMessageDelay": 200, | ||||||
|     "newbiePostDelayThreshold": 3, |     "newbiePostDelayThreshold": 3, | ||||||
|  |     "postQueueReputationThreshold": 0, | ||||||
|     "minimumPostLength": 8, |     "minimumPostLength": 8, | ||||||
|     "maximumPostLength": 32767, |     "maximumPostLength": 32767, | ||||||
|     "minimumTagsPerTopic": 0, |     "minimumTagsPerTopic": 0, | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| { | { | ||||||
| 	"post-queue": "Post Queue", | 	"post-queue": "Post Queue", | ||||||
| 	"description": "There are no posts in the post queue. <br> To enable this feature, go to <a href=\"%1\">Settings → Post → Posting Restrictions</a> and enable <strong>Post Queue</strong>.", | 	"description": "There are no posts in the post queue. <br> To enable this feature, go to <a href=\"%1\">Settings → Post → Post Queue</a> and enable <strong>Post Queue</strong>.", | ||||||
| 	"user": "User", | 	"user": "User", | ||||||
| 	"category": "Category", | 	"category": "Category", | ||||||
| 	"title": "Title", | 	"title": "Title", | ||||||
|   | |||||||
| @@ -7,9 +7,11 @@ | |||||||
| 	"sorting.most-posts": "Most Posts", | 	"sorting.most-posts": "Most Posts", | ||||||
| 	"sorting.topic-default": "Default Topic Sorting", | 	"sorting.topic-default": "Default Topic Sorting", | ||||||
| 	"length": "Post Length", | 	"length": "Post Length", | ||||||
|  | 	"post-queue": "Post Queue", | ||||||
| 	"restrictions": "Posting Restrictions", | 	"restrictions": "Posting Restrictions", | ||||||
| 	"restrictions-new": "New User Restrictions", | 	"restrictions-new": "New User Restrictions", | ||||||
| 	"restrictions.post-queue": "Enable post queue", | 	"restrictions.post-queue": "Enable post queue", | ||||||
|  | 	"restrictions.post-queue-rep-threshold": "Reputation required to bypass post queue", | ||||||
| 	"restrictions-new.post-queue": "Enable new user restrictions", | 	"restrictions-new.post-queue": "Enable new user restrictions", | ||||||
| 	"restrictions.post-queue-help": "Enabling post queue will put the posts of new users in a queue for approval", | 	"restrictions.post-queue-help": "Enabling post queue will put the posts of new users in a queue for approval", | ||||||
| 	"restrictions-new.post-queue-help": "Enabling new user restrictions will set restrictions on posts created by new users", | 	"restrictions-new.post-queue-help": "Enabling new user restrictions will set restrictions on posts created by new users", | ||||||
|   | |||||||
| @@ -16,7 +16,7 @@ var socketHelpers = require('../socket.io/helpers'); | |||||||
| module.exports = function (Posts) { | module.exports = function (Posts) { | ||||||
| 	Posts.shouldQueue = async function (uid, data) { | 	Posts.shouldQueue = async function (uid, data) { | ||||||
| 		const userData = await user.getUserFields(uid, ['uid', 'reputation', 'postcount']); | 		const userData = await user.getUserFields(uid, ['uid', 'reputation', 'postcount']); | ||||||
| 		const shouldQueue = meta.config.postQueue && (!userData.uid || userData.reputation < meta.config.newbiePostDelayThreshold || userData.postcount <= 0); | 		const shouldQueue = meta.config.postQueue && (!userData.uid || userData.reputation < meta.config.postQueueReputationThreshold || userData.postcount <= 0); | ||||||
| 		const result = await plugins.fireHook('filter:post.shouldQueue', { | 		const result = await plugins.fireHook('filter:post.shouldQueue', { | ||||||
| 			shouldQueue: !!shouldQueue, | 			shouldQueue: !!shouldQueue, | ||||||
| 			uid: uid, | 			uid: uid, | ||||||
|   | |||||||
| @@ -7,7 +7,7 @@ | |||||||
|  |  | ||||||
| 			<!-- IF !posts.length --> | 			<!-- IF !posts.length --> | ||||||
| 			<p class="panel-body"> | 			<p class="panel-body"> | ||||||
| 				[[admin/manage/post-queue:description, {config.relative_path}/admin/settings/post#posting-restrictions]] | 				[[admin/manage/post-queue:description, {config.relative_path}/admin/settings/post#post-queue]] | ||||||
| 			</p> | 			</p> | ||||||
| 			<!-- ENDIF !posts.length --> | 			<!-- ENDIF !posts.length --> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -94,6 +94,29 @@ | |||||||
| 				<label for="newbiePostDelayThreshold">[[admin/settings/post:restrictions.rep-threshold]]</label> | 				<label for="newbiePostDelayThreshold">[[admin/settings/post:restrictions.rep-threshold]]</label> | ||||||
| 				<input id="newbiePostDelayThreshold" type="text" class="form-control" value="3" data-field="newbiePostDelayThreshold"> | 				<input id="newbiePostDelayThreshold" type="text" class="form-control" value="3" data-field="newbiePostDelayThreshold"> | ||||||
| 			</div> | 			</div> | ||||||
|  |  | ||||||
|  | 			<div class="form-group"> | ||||||
|  | 				<label for="newbiePostDelay">[[admin/settings/post:restrictions.seconds-between-new]]</label> | ||||||
|  | 				<input id="newbiePostDelay" type="text" class="form-control" value="120" data-field="newbiePostDelay"> | ||||||
|  | 			</div> | ||||||
|  |  | ||||||
|  | 			<div class="form-group"> | ||||||
|  | 				<label for="initialPostDelay">[[admin/settings/post:restrictions.seconds-before-new]]</label> | ||||||
|  | 				<input id="initialPostDelay" type="text" class="form-control" value="10" data-field="initialPostDelay"> | ||||||
|  | 			</div> | ||||||
|  |  | ||||||
|  | 			<div class="form-group"> | ||||||
|  | 				<label for="newbiePostEditDuration">[[admin/settings/post:restrictions.seconds-edit-after]]</label> | ||||||
|  | 				<input id="newbiePostEditDuration" type="text" class="form-control" value="120" data-field="newbiePostEditDuration"> | ||||||
|  | 			</div> | ||||||
|  | 		</form> | ||||||
|  | 	</div> | ||||||
|  | </div> | ||||||
|  |  | ||||||
|  | <div class="row"> | ||||||
|  | 	<div class="col-sm-2 col-xs-12 settings-header">[[admin/settings/post:post-queue]]</div> | ||||||
|  | 	<div class="col-sm-10 col-xs-12"> | ||||||
|  | 		<form> | ||||||
| 			<div class="row"> | 			<div class="row"> | ||||||
| 				<div class="col-sm-6"> | 				<div class="col-sm-6"> | ||||||
| 					<div class="form-group"> | 					<div class="form-group"> | ||||||
| @@ -110,22 +133,8 @@ | |||||||
| 				</div> | 				</div> | ||||||
| 				<div class="col-sm-6"> | 				<div class="col-sm-6"> | ||||||
| 					<div class="form-group"> | 					<div class="form-group"> | ||||||
| 						<label for="newbiePostDelay">[[admin/settings/post:restrictions.seconds-between-new]]</label> | 						<label for="postQueueReputationThreshold">[[admin/settings/post:restrictions.post-queue-rep-threshold]]</label> | ||||||
| 						<input id="newbiePostDelay" type="text" class="form-control" value="120" data-field="newbiePostDelay"> | 						<input id="postQueueReputationThreshold" type="text" class="form-control" value="0" data-field="postQueueReputationThreshold"> | ||||||
| 					</div> |  | ||||||
| 				</div> |  | ||||||
| 			</div> |  | ||||||
| 			<div class="row"> |  | ||||||
| 				<div class="col-sm-6"> |  | ||||||
| 					<div class="form-group"> |  | ||||||
| 						<label for="initialPostDelay">[[admin/settings/post:restrictions.seconds-before-new]]</label> |  | ||||||
| 						<input id="initialPostDelay" type="text" class="form-control" value="10" data-field="initialPostDelay"> |  | ||||||
| 					</div> |  | ||||||
| 				</div> |  | ||||||
| 				<div class="col-sm-6"> |  | ||||||
| 					<div class="form-group"> |  | ||||||
| 						<label for="newbiePostEditDuration">[[admin/settings/post:restrictions.seconds-edit-after]]</label> |  | ||||||
| 						<input id="newbiePostEditDuration" type="text" class="form-control" value="120" data-field="newbiePostEditDuration"> |  | ||||||
| 					</div> | 					</div> | ||||||
| 				</div> | 				</div> | ||||||
| 			</div> | 			</div> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user