util.prosodyctl: Prep JIDs before checking whether they exist (thanks tja)

Tue, 07 Dec 2010 19:26:38 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Tue, 07 Dec 2010 19:26:38 +0000
changeset 3833
f1833a3e0b4e
parent 3832
8eff6e82570d
child 3834
1bb987224406

util.prosodyctl: Prep JIDs before checking whether they exist (thanks tja)

util/prosodyctl.lua file | annotate | diff | comparison | revisions
--- a/util/prosodyctl.lua	Tue Dec 07 19:22:08 2010 +0000
+++ b/util/prosodyctl.lua	Tue Dec 07 19:26:38 2010 +0000
@@ -47,12 +47,13 @@
 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)

mercurial