Hi, how can I commit a patch to the prosody-modules? Thanks.
-- You received this message because you are subscribed to the Google Groups "prosody-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to prosody-dev+unsubscr...@googlegroups.com. To post to this group, send email to prosody-dev@googlegroups.com. Visit this group at https://groups.google.com/group/prosody-dev. For more options, visit https://groups.google.com/d/optout.
# HG changeset patch # User Genilto Dallo <g...@chatseguro.net> # Date 1457227033 10800 # Sat Mar 05 22:17:13 2016 -0300 # Node ID bfe60fe03a04ddf9686b7129a6dcf4d24edb4f43 # Parent bd0c5d546bf8eef4e019a8600320e133852ef682 Finish set_password function diff -r bd0c5d546bf8 -r bfe60fe03a04 mod_auth_sql/mod_auth_sql.lua --- a/mod_auth_sql/mod_auth_sql.lua Fri Mar 04 17:16:13 2016 +0000 +++ b/mod_auth_sql/mod_auth_sql.lua Sat Mar 05 22:17:13 2016 -0300 @@ -70,6 +70,12 @@ return stmt; end +local function setsql(sql, ...) + local stmt, err = getsql(sql, ...); + if not stmt then return stmt, err; end + return stmt:affected(); +end + local function get_password(username) local stmt, err = getsql("SELECT `password` FROM `authreg` WHERE `username`=? AND `realm`=?", username, module.host); if stmt then @@ -89,7 +95,8 @@ return get_password(username); end function provider.set_password(username, password) - return nil, "Setting password is not supported."; + local stmt, err = setsql("UPDATE `authreg` SET `password`=? WHERE `username`=? AND `realm`=?", password, username, module.host); + return stmt and true, err; end function provider.user_exists(username) return get_password(username) and true;