liquid_feedback_frontend
changeset 357:64b8b6379527
In single unit mode automatically add members to default unit
author | bsw |
---|---|
date | Wed Feb 29 20:35:12 2012 +0100 (2012-02-29) |
parents | 7ee7ec1b10fc |
children | e87e99e0bd01 |
files | app/main/admin/_action/member_update.lua |
line diff
1.1 --- a/app/main/admin/_action/member_update.lua Wed Feb 29 20:31:21 2012 +0100 1.2 +++ b/app/main/admin/_action/member_update.lua Wed Feb 29 20:35:12 2012 +0100 1.3 @@ -1,4 +1,6 @@ 1.4 -local member = Member:by_id(param.get_id()) or Member:new() 1.5 +local id = param.get_id() 1.6 + 1.7 +local member = Member:by_id(id) or Member:new() 1.8 1.9 param.update(member, "identification", "notify_email", "admin") 1.10 1.11 @@ -11,10 +13,17 @@ 1.12 if err then 1.13 slot.put_into("error", (_("Error while updating member, database reported:<br /><br /> (#{errormessage})"):gsub("#{errormessage}", tostring(err.message)))) 1.14 return false 1.15 +end 1.16 + 1.17 +if not id and config.single_unit_id then 1.18 + local privilege = Privilege:new() 1.19 + privilege.member_id = member.id 1.20 + privilege.unit_id = config.single_unit_id 1.21 + privilege.voting_right = true 1.22 +end 1.23 + 1.24 +if id then 1.25 + slot.put_into("notice", _"Member successfully updated") 1.26 else 1.27 - if id then 1.28 - slot.put_into("notice", _"Member successfully updated") 1.29 - else 1.30 - slot.put_into("notice", _"Member successfully registered") 1.31 - end 1.32 + slot.put_into("notice", _"Member successfully registered") 1.33 end