Comparison

plugins/mod_admin_adhoc.lua @ 8769:e809074cdc09

mod_admin_adhoc: Split a long line (improves readability) [luacheck]
author Kim Alvefur <zash@zash.se>
date Tue, 01 May 2018 20:47:52 +0200
parent 8728:41c959c5c84b
child 8770:9c9b198bab84
comparison
equal deleted inserted replaced
8768:bd88ca43d77a 8769:e809074cdc09
93 if err then 93 if err then
94 return generate_error_message(err); 94 return generate_error_message(err);
95 end 95 end
96 local username, host, resource = jid.split(fields.accountjid); 96 local username, host, resource = jid.split(fields.accountjid);
97 if module_host ~= host then 97 if module_host ~= host then
98 return { status = "completed", error = { message = "Trying to change the password of a user on " .. host .. " but command was sent to " .. module_host}}; 98 return {
99 status = "completed",
100 error = {
101 message = "Trying to change the password of a user on " .. host .. " but command was sent to " .. module_host
102 }
103 };
99 end 104 end
100 if usermanager_user_exists(username, host) and usermanager_set_password(username, fields.password, host, nil) then 105 if usermanager_user_exists(username, host) and usermanager_set_password(username, fields.password, host, nil) then
101 return { status = "completed", info = "Password successfully changed" }; 106 return { status = "completed", info = "Password successfully changed" };
102 else 107 else
103 return { status = "completed", error = { message = "User does not exist" } }; 108 return { status = "completed", error = { message = "User does not exist" } };