# HG changeset patch # User bsw # Date 1355165947 -3600 # Node ID ba824959fc1fc65e770d186ca24846ecde7897f2 # Parent 99852ec8ee37a9b29d352008bab227543ee6cf56 Fixed handling of notify_email while registering diff -r 99852ec8ee37 -r ba824959fc1f app/main/index/_action/register.lua --- a/app/main/index/_action/register.lua Sat Dec 01 23:50:18 2012 +0100 +++ b/app/main/index/_action/register.lua Mon Dec 10 19:59:07 2012 +0100 @@ -18,8 +18,6 @@ return false end -local old_notify_email = member.notify_email - local notify_email = param.get("notify_email") if not config.locked_profile_fields.notify_email and notify_email then @@ -33,10 +31,9 @@ } return false end - member.notify_email = notify_email end -if member and not member.notify_email then +if member and not notify_email then request.redirect{ mode = "redirect", module = "index", @@ -59,7 +56,7 @@ view = "register", params = { code = member.invite_code, - notify_email = member.notify_email, + notify_email = notify_email, step = 1 } } @@ -75,7 +72,7 @@ view = "register", params = { code = member.invite_code, - notify_email = member.notify_email, + notify_email = notify_email, step = 1 } } @@ -86,14 +83,14 @@ end -if member.notify_email and not member.name then +if notify_email and not member.name then request.redirect{ mode = "redirect", module = "index", view = "register", params = { code = member.invite_code, - notify_email = member.notify_email, + notify_email = notify_email, step = 1 } } @@ -112,7 +109,7 @@ view = "register", params = { code = member.invite_code, - notify_email = member.notify_email, + notify_email = notify_email, name = member.name, step = 1 } @@ -129,7 +126,7 @@ view = "register", params = { code = member.invite_code, - notify_email = member.notify_email, + notify_email = notify_email, name = member.name, step = 1 } @@ -146,7 +143,7 @@ view = "register", params = { code = member.invite_code, - notify_email = member.notify_email, + notify_email = notify_email, name = member.name, step = 1 } @@ -176,7 +173,7 @@ view = "register", params = { code = member.invite_code, - notify_email = member.notify_email, + notify_email = notify_email, name = member.name, login = member.login } @@ -203,7 +200,7 @@ member.name = name end - if notify_email ~= old_notify_email then + if notify_email ~= member.notify_email then local success = member:set_notify_email(notify_email) if not success then slot.put_into("error", _"Can't send confirmation email") @@ -233,4 +230,4 @@ view = "login", } end - \ No newline at end of file +