plugins/mod_c2s.lua
changeset 8204 a0ad62a269df
parent 8047 e38e3300b955
parent 8195 4354f556c5db
child 8238 7d9a2c200736
equal deleted inserted replaced
8188:e89320b8a789 8204:a0ad62a269df
   199 			session:close{ condition = "not-authorized", text = "Account deleted" };
   199 			session:close{ condition = "not-authorized", text = "Account deleted" };
   200 		end
   200 		end
   201 	end
   201 	end
   202 end, 200);
   202 end, 200);
   203 
   203 
       
   204 module:hook_global("user-password-changed", function(event)
       
   205 	local username, host, resource = event.username, event.host, event.resource;
       
   206 	local user = hosts[host].sessions[username];
       
   207 	if user and user.sessions then
       
   208 		for r, session in pairs(user.sessions) do
       
   209 			if r ~= resource then
       
   210 				session:close{ condition = "reset", text = "Password changed" };
       
   211 			end
       
   212 		end
       
   213 	end
       
   214 end, 200);
       
   215 
   204 function runner_callbacks:ready()
   216 function runner_callbacks:ready()
   205 	self.data.conn:resume();
   217 	self.data.conn:resume();
   206 end
   218 end
   207 
   219 
   208 function runner_callbacks:waiting()
   220 function runner_callbacks:waiting()