mirror of
				https://github.com/Ylianst/MeshCentral.git
				synced 2025-03-09 15:40:18 +00:00 
			
		
		
		
	Factorize close command + bugfix
This commit is contained in:
		
							parent
							
								
									fe4d426bdb
								
							
						
					
					
						commit
						c51cfef7c0
					
				
					 1 changed files with 7 additions and 7 deletions
				
			
		
							
								
								
									
										14
									
								
								meshuser.js
									
										
									
									
									
								
							
							
						
						
									
										14
									
								
								meshuser.js
									
										
									
									
									
								
							|  | @ -3188,13 +3188,6 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use | |||
|                     } | ||||
|                     break; | ||||
|                 } | ||||
|             case 'close': | ||||
|                 { | ||||
|                     // Close the web socket session
 | ||||
|                     if (obj.req.session && obj.req.session.ws && obj.req.session.ws == ws) { delete obj.req.session.ws; } | ||||
|                     try { ws.close(); } catch (e) { } | ||||
|                     break; | ||||
|                 } | ||||
|             case 'getcookie': | ||||
|                 { | ||||
|                     // Check if this user has rights on this nodeid
 | ||||
|  | @ -5190,6 +5183,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use | |||
|         'authcookie': serverCommandAuthCookie, | ||||
|         'changeemail': serverCommandChangeEmail, | ||||
|         'changelang': serverCommandChangeLang, | ||||
|         'close': serverCommandClose, | ||||
|         'files': serverCommandFiles, | ||||
|         'getnetworkinfo': serverCommandGetNetworkInfo, | ||||
|         'getsysinfo': serverCommandGetSysInfo, | ||||
|  | @ -5793,6 +5787,12 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use | |||
|         parent.parent.DispatchEvent(targets, obj, message); | ||||
|     } | ||||
| 
 | ||||
|     function serverCommandClose(command) { | ||||
|         // Close the web socket session
 | ||||
|         try { delete obj.req.session.ws; } catch (e) { } | ||||
|         try { ws.close(); } catch (e) { } | ||||
|     } | ||||
| 
 | ||||
|     function serverCommandFiles(command) { | ||||
|         // Send the full list of server files to the browser app
 | ||||
|         updateUserFiles(user, ws, domain); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue