liquid_feedback_frontend

diff app/main/member/_action/update.lua @ 286:c587d8762e62

Registration process updated for Core 2.0, lockable member fields, notification settings
author bsw
date Sat Feb 25 11:51:37 2012 +0100 (2012-02-25)
parents 733f65c0c0a0
children 6cfdb2e5d3d4
line diff
     1.1 --- a/app/main/member/_action/update.lua	Fri Feb 17 15:16:02 2012 +0100
     1.2 +++ b/app/main/member/_action/update.lua	Sat Feb 25 11:51:37 2012 +0100
     1.3 @@ -1,4 +1,4 @@
     1.4 -param.update(app.session.member,
     1.5 +local fields = {
     1.6    "organizational_unit",
     1.7    "internal_posts",
     1.8    "realname",
     1.9 @@ -13,12 +13,22 @@
    1.10    "external_memberships",
    1.11    "external_posts",
    1.12    "statement"
    1.13 -)
    1.14 +}
    1.15 +
    1.16 +local update_args = { app.session.member }
    1.17  
    1.18 -if tostring(app.session.member.birthday) == "invalid_date" then
    1.19 -  app.session.member.birthday = nil
    1.20 -  slot.put_into("error", _"Date format is not valid. Please use following format: YYYY-MM-DD")
    1.21 -  return false
    1.22 +for i, field in ipairs(fields) do
    1.23 +  if not config.locked_profile_fields[field] then
    1.24 +    param.update(app.session.member, field)
    1.25 +  end
    1.26 +end
    1.27 +
    1.28 +if not config.locked_profile_fields.birthday then
    1.29 +  if tostring(app.session.member.birthday) == "invalid_date" then
    1.30 +    app.session.member.birthday = nil
    1.31 +    slot.put_into("error", _"Date format is not valid. Please use following format: YYYY-MM-DD")
    1.32 +    return false
    1.33 +  end
    1.34  end
    1.35  
    1.36  app.session.member:save()

Impressum / About Us