liquid_feedback_frontend

changeset 1421:5f26df65672f

Allow configuration of minimum age
author bsw
date Tue Sep 04 10:08:19 2018 +0200 (2018-09-04)
parents 09f50a44cb7d
children 6c9729cbff73
files app/main/registration/_action/register.lua
line diff
     1.1 --- a/app/main/registration/_action/register.lua	Thu Aug 30 10:57:39 2018 +0200
     1.2 +++ b/app/main/registration/_action/register.lua	Tue Sep 04 10:08:19 2018 +0200
     1.3 @@ -127,11 +127,12 @@
     1.4          errors = errors + 1
     1.5        end
     1.6        local today = atom.date:get_current()
     1.7 -      local date_16y_ago = atom.date:new{ year = today.year - 16, month = today.month, day = today.day }
     1.8 -      if date_16y_ago.invalid and today.month == 2 and today.day == 29 then
     1.9 -        date_16y_ago = atom.date:new{ year = today.year - 16, month = 2, day = 28 }
    1.10 +      local min_age = config.self_registration.min_age or 16
    1.11 +      local date_nyears_ago = atom.date:new{ year = today.year - min_age, month = today.month, day = today.day }
    1.12 +      if date_nyears_ago.invalid and today.month == 2 and today.day == 29 then
    1.13 +        date_nyears_ago = atom.date:new{ year = today.year - min_age, month = 2, day = 28 }
    1.14        end
    1.15 -      if date > date_16y_ago then
    1.16 +      if date > date_nyears_ago then
    1.17          request.redirect{ external = encode.url { module = "registration", view = "register_rejected_age" } }      
    1.18          return
    1.19        end

Impressum / About Us