Mercurial > prosody-modules
comparison mod_adhoc_cmd_admin/mod_adhoc_cmd_admin.lua @ 97:e172f02726d9
mod_adhoc_cmd_admin: Fix global access
author | Florian Zeitz <florob@babelmonkeys.de> |
---|---|
date | Wed, 25 Nov 2009 20:13:56 +0100 |
parents | 7dad958aad15 |
children | 9b63fd1196c0 |
comparison
equal
deleted
inserted
replaced
96:c1f4edf3bea7 | 97:e172f02726d9 |
---|---|
160 end | 160 end |
161 local form = stanza.tags[1]:child_with_ns("jabber:x:data"); | 161 local form = stanza.tags[1]:child_with_ns("jabber:x:data"); |
162 local fields = get_user_password_layout:data(form); | 162 local fields = get_user_password_layout:data(form); |
163 local accountjid = st.stanza("field", {var="accountjid", label = "JID", type="jid-single"}); | 163 local accountjid = st.stanza("field", {var="accountjid", label = "JID", type="jid-single"}); |
164 local password = st.stanza("field", {var="password", label = "Password", type="text-single"}); | 164 local password = st.stanza("field", {var="password", label = "Password", type="text-single"}); |
165 user, host, resource = jid.split(fields.accountjid); | 165 local user, host, resource = jid.split(fields.accountjid); |
166 if usermanager_user_exists(user, host) then | 166 if usermanager_user_exists(user, host) then |
167 accountjid:tag("value"):text(fields.accountjid):up(); | 167 accountjid:tag("value"):text(fields.accountjid):up(); |
168 password:tag("value"):text(usermanager_get_password(user, host)):up(); | 168 password:tag("value"):text(usermanager_get_password(user, host)):up(); |
169 else | 169 else |
170 origin.send(st.error_reply(stanza, "cancel", "item-not-found", "User does not exist") | 170 origin.send(st.error_reply(stanza, "cancel", "item-not-found", "User does not exist") |