mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	changed user update profile so that it only updates specific fields, before it was possible to send in rep,post count
This commit is contained in:
		
							
								
								
									
										11
									
								
								src/user.js
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								src/user.js
									
									
									
									
									
								
							| @@ -70,10 +70,15 @@ var	config = require('../config.js'), | ||||
| 		}); | ||||
| 	} | ||||
|  | ||||
| 	User.updateUserFields = function(uid, data) { | ||||
| 	User.updateProfile = function(uid, data) { | ||||
| 		 | ||||
| 		for(var key in data) { | ||||
| 			User.setUserField(uid, key, data[key]); | ||||
| 		var fields = ['email', 'fullname', 'website', 'location', 'birthday']; | ||||
| 		var key = ''; | ||||
| 		 | ||||
| 		for(var i=0,ii=fields.length; i<ii; ++i) { | ||||
| 			key = fields[i]; | ||||
| 			if(data[key] !== undefined) | ||||
| 				User.setUserField(uid, key, data[key]); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user