certmanager: Fix global access
[prosody.git] / tools / ejabberd2prosody.lua
index 3bcf8a2e80f0a439aabf7ba21e8e3dfd71bc92d1..d0c22df71843c51cfcdb7976c04aa39a4827c05c 100755 (executable)
@@ -49,7 +49,7 @@ function vcard(node, host, stanza)
 end
 function password(node, host, password)
        local ret, err = dm.store(node, host, "accounts", {password = password});
-       print("["..(err or "success").."] accounts: "..node.."@"..host.." = "..password);
+       print("["..(err or "success").."] accounts: "..node.."@"..host);
 end
 function roster(node, host, jid, item)
        local roster = dm.load(node, host, "roster") or {};
@@ -104,7 +104,11 @@ local filters = {
                else error("Unknown ask type: "..ask); end
                if subscription ~= "both" and subscription ~= "from" and subscription ~= "to" and subscription ~= "none" then error(subscription) end
                local item = {name = name, ask = ask, subscription = subscription, groups = {}};
-               for _, g in ipairs(groups) do item.groups[g] = true; end
+               for _, g in ipairs(groups) do
+                       if type(g) == "string" then
+                               item.groups[g] = true;
+                       end
+               end
                roster(node, host, contact, item);
        end;
        private_storage = function(tuple)