mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 02:55:58 +01:00 
			
		
		
		
	| @@ -3,7 +3,7 @@ | |||||||
| 	"no_notifs": "You have no new notifications", | 	"no_notifs": "You have no new notifications", | ||||||
| 	"see_all": "See all Notifications", | 	"see_all": "See all Notifications", | ||||||
|  |  | ||||||
| 	"back_to_home": "Back to NodeBB", | 	"back_to_home": "Back to %1", | ||||||
| 	"outgoing_link": "Outgoing Link", | 	"outgoing_link": "Outgoing Link", | ||||||
| 	"outgoing_link_message": "You are now leaving", | 	"outgoing_link_message": "You are now leaving", | ||||||
| 	"continue_to": "Continue to", | 	"continue_to": "Continue to", | ||||||
|   | |||||||
| @@ -13,6 +13,7 @@ apiController.getConfig = function(req, res, next) { | |||||||
| 	var config = {}; | 	var config = {}; | ||||||
| 	config.relative_path = serverConfig.relative_path; | 	config.relative_path = serverConfig.relative_path; | ||||||
| 	config.version = pkg.version; | 	config.version = pkg.version; | ||||||
|  | 	config.siteTitle = meta.config.title || meta.config.browserTitle || 'NodeBB'; | ||||||
| 	config.postDelay = meta.config.postDelay; | 	config.postDelay = meta.config.postDelay; | ||||||
| 	config.minimumTitleLength = meta.config.minimumTitleLength; | 	config.minimumTitleLength = meta.config.minimumTitleLength; | ||||||
| 	config.maximumTitleLength = meta.config.maximumTitleLength; | 	config.maximumTitleLength = meta.config.maximumTitleLength; | ||||||
|   | |||||||
							
								
								
									
										15
									
								
								src/user.js
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								src/user.js
									
									
									
									
									
								
							| @@ -155,22 +155,29 @@ var bcrypt = require('bcryptjs'), | |||||||
| 			}, | 			}, | ||||||
| 			exists: function(next) { | 			exists: function(next) { | ||||||
| 				db.exists('user:' + uid, next); | 				db.exists('user:' + uid, next); | ||||||
|  | 			}, | ||||||
|  | 			isAdmin: function(next) { | ||||||
|  | 				User.isAdministrator(uid, next); | ||||||
| 			} | 			} | ||||||
| 		}, function(err, results) { | 		}, function(err, results) { | ||||||
| 			if (err) { | 			if (err) { | ||||||
| 				return callback(err); | 				return callback(err); | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
|  | 			if (!results.exists) { | ||||||
|  | 				return callback(new Error('[[error:no-user]]')); | ||||||
|  | 			} | ||||||
|  |  | ||||||
|  | 			if (results.isAdmin) { | ||||||
|  | 				return callback(); | ||||||
|  | 			} | ||||||
|  |  | ||||||
| 			var userData = results.userData; | 			var userData = results.userData; | ||||||
|  |  | ||||||
| 			if (parseInt(userData.banned, 10) === 1) { | 			if (parseInt(userData.banned, 10) === 1) { | ||||||
| 				return callback(new Error('[[error:user-banned]]')); | 				return callback(new Error('[[error:user-banned]]')); | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 			if (!results.exists) { |  | ||||||
| 				return callback(new Error('[[error:no-user]]')); |  | ||||||
| 			} |  | ||||||
|  |  | ||||||
| 			if (userData.email && parseInt(meta.config.requireEmailConfirmation, 10) === 1 && parseInt(userData['email:confirmed'], 10) !== 1) { | 			if (userData.email && parseInt(meta.config.requireEmailConfirmation, 10) === 1 && parseInt(userData['email:confirmed'], 10) !== 1) { | ||||||
| 				return callback(new Error('[[error:email-not-confirmed]]')); | 				return callback(new Error('[[error:email-not-confirmed]]')); | ||||||
| 			} | 			} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user