util.prosodyctl: Prep JIDs before checking whether they exist (thanks tja)
authorMatthew Wild <mwild1@gmail.com>
Tue, 7 Dec 2010 19:26:38 +0000 (19:26 +0000)
committerMatthew Wild <mwild1@gmail.com>
Tue, 7 Dec 2010 19:26:38 +0000 (19:26 +0000)
util/prosodyctl.lua

index f6cb8d7ffd2e598e276b2de29c0bd9daf77a22fd..d7ca1a3063727abd832c6293bd2471a51fe1724d 100644 (file)
@@ -47,12 +47,13 @@ function adduser(params)
 end
 
 function user_exists(params)
-       local provider = prosody.hosts[params.host].users;
+       local user, host, password = nodeprep(params.user), nameprep(params.host), params.password;
+       local provider = prosody.hosts[host].users;
        if not(provider) or provider.name == "null" then
-               usermanager.initialize_host(params.host);
+               usermanager.initialize_host(host);
        end
        
-       return usermanager.user_exists(params.user, params.host);
+       return usermanager.user_exists(user, host);
 end
 
 function passwd(params)