浏览代码

fixed admin check for token verification

master
Shawn 4 年前
父节点
当前提交
060a8628ce
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5
    1
      resources/prosody-plugins/mod_token_verification.lua

+ 5
- 1
resources/prosody-plugins/mod_token_verification.lua 查看文件

4
 local log = module._log;
4
 local log = module._log;
5
 local host = module.host;
5
 local host = module.host;
6
 local st = require "util.stanza";
6
 local st = require "util.stanza";
7
-local is_admin = require "core.usermanager".is_admin;
7
+local um_is_admin = require "core.usermanager".is_admin;
8
 
8
 
9
 
9
 
10
+local function is_admin(jid)
11
+    return um_is_admin(jid, host);
12
+end
13
+
10
 local parentHostName = string.gmatch(tostring(host), "%w+.(%w.+)")();
14
 local parentHostName = string.gmatch(tostring(host), "%w+.(%w.+)")();
11
 if parentHostName == nil then
15
 if parentHostName == nil then
12
 	log("error", "Failed to start - unable to get parent hostname");
16
 	log("error", "Failed to start - unable to get parent hostname");

正在加载...
取消
保存