Comparison

plugins/mod_tls.lua @ 1652:ce6b91c78b9f

mod_tls: Updated to use module:get_option instead of configmanager
author Waqas Hussain <waqas20@gmail.com>
date Sat, 08 Aug 2009 23:41:45 +0500
parent 1523:841d61be198f
child 1675:bddd5ef9565e
comparison
equal deleted inserted replaced
1651:6954d8f314a1 1652:ce6b91c78b9f
4 -- 4 --
5 -- This project is MIT/X11 licensed. Please see the 5 -- This project is MIT/X11 licensed. Please see the
6 -- COPYING file in the source package for more information. 6 -- COPYING file in the source package for more information.
7 -- 7 --
8 8
9
10
11 local st = require "util.stanza"; 9 local st = require "util.stanza";
12 10
13 local xmlns_starttls ='urn:ietf:params:xml:ns:xmpp-tls'; 11 local xmlns_starttls ='urn:ietf:params:xml:ns:xmpp-tls';
14 12
15 local config = require "core.configmanager"; 13 local secure_auth_only = module:get_option("require_encryption");
16 local secure_auth_only = config.get("*", "core", "require_encryption");
17 14
18 module:add_handler("c2s_unauthed", "starttls", xmlns_starttls, 15 module:add_handler("c2s_unauthed", "starttls", xmlns_starttls,
19 function (session, stanza) 16 function (session, stanza)
20 if session.conn.starttls then 17 if session.conn.starttls then
21 session.send(st.stanza("proceed", { xmlns = xmlns_starttls })); 18 session.send(st.stanza("proceed", { xmlns = xmlns_starttls }));