plugins/mod_legacyauth.lua
changeset 8771 bd88ca43d77a
parent 6490 edc63dc72566
child 10561 e1cb869e2f6c
equal deleted inserted replaced
8770:7738838a013d 8771:bd88ca43d77a
    33 
    33 
    34 module:hook("stanza/iq/jabber:iq:auth:query", function(event)
    34 module:hook("stanza/iq/jabber:iq:auth:query", function(event)
    35 	local session, stanza = event.origin, event.stanza;
    35 	local session, stanza = event.origin, event.stanza;
    36 
    36 
    37 	if session.type ~= "c2s_unauthed" then
    37 	if session.type ~= "c2s_unauthed" then
    38 		(session.sends2s or session.send)(st.error_reply(stanza, "cancel", "service-unavailable", "Legacy authentication is only allowed for unauthenticated client connections."));
    38 		(session.sends2s or session.send)(st.error_reply(stanza, "cancel", "service-unavailable",
       
    39 			"Legacy authentication is only allowed for unauthenticated client connections."));
    39 		return true;
    40 		return true;
    40 	end
    41 	end
    41 
    42 
    42 	if secure_auth_only and not session.secure then
    43 	if secure_auth_only and not session.secure then
    43 		session.send(st.error_reply(stanza, "modify", "not-acceptable", "Encryption (SSL or TLS) is required to connect to this server"));
    44 		session.send(st.error_reply(stanza, "modify", "not-acceptable", "Encryption (SSL or TLS) is required to connect to this server"));