mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	This commit is contained in:
		| @@ -39,6 +39,19 @@ define('forum/groups/details', ['iconSelect', 'vendor/colorpicker/colorpicker', | ||||
| 					}); | ||||
| 					break; | ||||
|  | ||||
| 				case 'kick': | ||||
| 					socket.emit('groups.kick', { | ||||
| 						uid: uid, | ||||
| 						groupName: ajaxify.variables.get('group_name') | ||||
| 					}, function(err) { | ||||
| 						if (!err) { | ||||
| 							userRow.slideUp().remove(); | ||||
| 						} else { | ||||
| 							app.alertError(err.message); | ||||
| 						} | ||||
| 					}); | ||||
| 					break; | ||||
|  | ||||
| 				case 'update': | ||||
| 					Details.update(); | ||||
| 					break; | ||||
|   | ||||
| @@ -156,6 +156,20 @@ SocketGroups.search = function(socket, data, callback) { | ||||
| 	groups.search(data.query || '', data.options || {}, callback); | ||||
| }; | ||||
|  | ||||
| SocketGroups.kick = function(socket, data, callback) { | ||||
| 	if (!data) { | ||||
| 		return callback(new Error('[[error:invalid-data]]')); | ||||
| 	} | ||||
|  | ||||
| 	groups.ownership.isOwner(socket.uid, data.groupName, function(err, isOwner) { | ||||
| 		if (!isOwner) { | ||||
| 			return callback(new Error('[[error:no-privileges]]')); | ||||
| 		} | ||||
|  | ||||
| 		groups.leave(data.groupName, data.uid, callback); | ||||
| 	}); | ||||
| }; | ||||
|  | ||||
| SocketGroups.cover = {}; | ||||
|  | ||||
| SocketGroups.cover.get = function(socket, data, callback) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user