liquid_feedback_frontend
changeset 91:3da86120cadd
Security related fix of locking during registration process
author | bsw |
---|---|
date | Thu Aug 19 15:36:13 2010 +0200 (2010-08-19) |
parents | 8183cc841c00 |
children | 42547a48774d |
files | app/main/index/_action/register.lua |
line diff
1.1 --- a/app/main/index/_action/register.lua Thu Aug 05 11:56:44 2010 +0200 1.2 +++ b/app/main/index/_action/register.lua Thu Aug 19 15:36:13 2010 +0200 1.3 @@ -1,4 +1,10 @@ 1.4 -local invite_code = InviteCode:by_code(param.get("code")) 1.5 +local code = param.get("code") 1.6 + 1.7 +local invite_code = InviteCode:new_selector() 1.8 + :add_where{ "code = ?", code } 1.9 + :optional_object_mode() 1.10 + :for_update() 1.11 + :exec() 1.12 1.13 if not invite_code or invite_code.used then 1.14 slot.put_into("error", _"The code you've entered is invalid")