Mercurial > prosody-modules
comparison mod_privilege/mod_privilege.lua @ 1989:2c9b227dd580
mod_privilege: fixed module import which was causing SALS issues
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 21 Dec 2015 10:31:36 +0100 |
parents | f719d5e6c627 |
children | c4da3d9f212d |
comparison
equal
deleted
inserted
replaced
1988:d7c1daaf2dea | 1989:2c9b227dd580 |
---|---|
10 | 10 |
11 local jid = require("util/jid") | 11 local jid = require("util/jid") |
12 local set = require("util/set") | 12 local set = require("util/set") |
13 local st = require("util/stanza") | 13 local st = require("util/stanza") |
14 local roster_manager = require("core/rostermanager") | 14 local roster_manager = require("core/rostermanager") |
15 local user_manager = require("core/usermanager") | 15 local usermanager_user_exists = require "core.usermanager".user_exists; |
16 local hosts = prosody.hosts | 16 local hosts = prosody.hosts |
17 local full_sessions = prosody.full_sessions; | 17 local full_sessions = prosody.full_sessions; |
18 | 18 |
19 local priv_session = module:shared("/*/privilege/session") | 19 local priv_session = module:shared("/*/privilege/session") |
20 | 20 |
248 local session_privileges = get_session_privileges(session, from_host) | 248 local session_privileges = get_session_privileges(session, from_host) |
249 | 249 |
250 if session_privileges and _ROSTER_SET_PERM:contains(session_privileges.roster) then | 250 if session_privileges and _ROSTER_SET_PERM:contains(session_privileges.roster) then |
251 module:log("debug", "Roster set from allowed privileged entity received") | 251 module:log("debug", "Roster set from allowed privileged entity received") |
252 -- following code is adapted from mod_remote_roster | 252 -- following code is adapted from mod_remote_roster |
253 if not(user_manager.user_exists(from_node, from_host)) then return; end | 253 if not(usermanager_user_exists(from_node, from_host)) then return; end |
254 local roster = roster_manager.load_roster(from_node, from_host); | 254 local roster = roster_manager.load_roster(from_node, from_host); |
255 if not(roster) then return; end | 255 if not(roster) then return; end |
256 | 256 |
257 local query = stanza.tags[1]; | 257 local query = stanza.tags[1]; |
258 for _, item in ipairs(query.tags) do | 258 for _, item in ipairs(query.tags) do |