mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	forgot to commit oops
This commit is contained in:
		
							
								
								
									
										5
									
								
								app.js
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								app.js
									
									
									
									
									
								
							| @@ -100,11 +100,16 @@ if(nconf.get('upgrade')) { | |||||||
| 						console.log('Info: Hardcoding uid 1 as an admin'); | 						console.log('Info: Hardcoding uid 1 as an admin'); | ||||||
| 						var user = require('./src/user.js'); | 						var user = require('./src/user.js'); | ||||||
| 						user.makeAdministrator(1); | 						user.makeAdministrator(1); | ||||||
|  |  | ||||||
|  |  | ||||||
| 					} else { | 					} else { | ||||||
| 						console.log('Info: Categories OK. Found ' + data.categories.length + ' categories.'); | 						console.log('Info: Categories OK. Found ' + data.categories.length + ' categories.'); | ||||||
| 					} | 					} | ||||||
| 				}); | 				}); | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| 			setup_categories(); | 			setup_categories(); | ||||||
| 		}(global.configuration)); | 		}(global.configuration)); | ||||||
| 	}); | 	}); | ||||||
|   | |||||||
| @@ -11,7 +11,6 @@ var	RDB = require('./redis.js'), | |||||||
| 	plugins = require('./plugins'), | 	plugins = require('./plugins'), | ||||||
| 	reds = require('reds'), | 	reds = require('reds'), | ||||||
| 	nconf = require('nconf'), | 	nconf = require('nconf'), | ||||||
| 	clientConfig = require('../public/config.json'), |  | ||||||
| 	postSearch = reds.createSearch('nodebbpostsearch'); | 	postSearch = reds.createSearch('nodebbpostsearch'); | ||||||
|  |  | ||||||
| (function(Posts) { | (function(Posts) { | ||||||
| @@ -174,7 +173,7 @@ var	RDB = require('./redis.js'), | |||||||
| 			type: 'error', | 			type: 'error', | ||||||
| 			timeout: 2000, | 			timeout: 2000, | ||||||
| 			title: 'Content too short', | 			title: 'Content too short', | ||||||
| 			message: "Please enter a longer post. At least " + Posts.minimumPostLength + " characters.", | 			message: "Please enter a longer post. At least " + config.minimumPostLength + " characters.", | ||||||
| 			alert_id: 'post_error' | 			alert_id: 'post_error' | ||||||
| 		}); | 		}); | ||||||
| 	} | 	} | ||||||
| @@ -182,7 +181,7 @@ var	RDB = require('./redis.js'), | |||||||
| 	Posts.emitTooManyPostsAlert = function(socket) { | 	Posts.emitTooManyPostsAlert = function(socket) { | ||||||
| 		socket.emit('event:alert', { | 		socket.emit('event:alert', { | ||||||
| 			title: 'Too many posts!', | 			title: 'Too many posts!', | ||||||
| 			message: 'You can only post every '+ (nconf.get('post_delay') / 1000) + ' seconds.', | 			message: 'You can only post every '+ config.postDelay/1000 + ' seconds.', | ||||||
| 			type: 'error', | 			type: 'error', | ||||||
| 			timeout: 2000 | 			timeout: 2000 | ||||||
| 		}); | 		}); | ||||||
| @@ -193,13 +192,13 @@ var	RDB = require('./redis.js'), | |||||||
| 			content = content.trim(); | 			content = content.trim(); | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		if (!content || content.length < clientConfig.minimumPostLength) { | 		if (!content || content.length < config.minimumPostLength) { | ||||||
| 			callback(new Error('content-too-short'), null); | 			callback(new Error('content-too-short'), null); | ||||||
| 			return; | 			return; | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		user.getUserField(uid, 'lastposttime', function(lastposttime) { | 		user.getUserField(uid, 'lastposttime', function(lastposttime) { | ||||||
| 			if(Date.now() - lastposttime < nconf.get('post_delay')) { | 			if(Date.now() - lastposttime < config.postDelay)) { | ||||||
| 				callback(new Error('too-many-posts'), null); | 				callback(new Error('too-many-posts'), null); | ||||||
| 				return; | 				return; | ||||||
| 			} | 			} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user