Software /
code /
prosody
Comparison
util/prosodyctl.lua @ 3771:428882c438bf
util.prosodyctl: Initialize storagemanager on hosts we modify
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 18 Dec 2010 02:33:47 +0000 |
parent | 3711:2a1cfaf3ee61 |
child | 3777:5ecbcef42ffb |
comparison
equal
deleted
inserted
replaced
3770:4de73ae45163 | 3771:428882c438bf |
---|---|
8 | 8 |
9 | 9 |
10 local config = require "core.configmanager"; | 10 local config = require "core.configmanager"; |
11 local encodings = require "util.encodings"; | 11 local encodings = require "util.encodings"; |
12 local stringprep = encodings.stringprep; | 12 local stringprep = encodings.stringprep; |
13 local storagemanager = require "core.storagemanager"; | |
13 local usermanager = require "core.usermanager"; | 14 local usermanager = require "core.usermanager"; |
14 local signal = require "util.signal"; | 15 local signal = require "util.signal"; |
15 local set = require "util.set"; | 16 local set = require "util.set"; |
16 local lfs = require "lfs"; | 17 local lfs = require "lfs"; |
17 | 18 |
36 | 37 |
37 local provider = prosody.hosts[host].users; | 38 local provider = prosody.hosts[host].users; |
38 if not(provider) or provider.name == "null" then | 39 if not(provider) or provider.name == "null" then |
39 usermanager.initialize_host(host); | 40 usermanager.initialize_host(host); |
40 end | 41 end |
42 storagemanager.initialize_host(host); | |
41 | 43 |
42 local ok = usermanager.create_user(user, password, host); | 44 local ok = usermanager.create_user(user, password, host); |
43 if not ok then | 45 if not ok then |
44 return false, "unable-to-save-data"; | 46 return false, "unable-to-save-data"; |
45 end | 47 end |
50 local user, host, password = nodeprep(params.user), nameprep(params.host), params.password; | 52 local user, host, password = nodeprep(params.user), nameprep(params.host), params.password; |
51 local provider = prosody.hosts[host].users; | 53 local provider = prosody.hosts[host].users; |
52 if not(provider) or provider.name == "null" then | 54 if not(provider) or provider.name == "null" then |
53 usermanager.initialize_host(host); | 55 usermanager.initialize_host(host); |
54 end | 56 end |
57 storagemanager.initialize_host(host); | |
55 | 58 |
56 return usermanager.user_exists(user, host); | 59 return usermanager.user_exists(user, host); |
57 end | 60 end |
58 | 61 |
59 function passwd(params) | 62 function passwd(params) |