liquid_feedback_frontend

annotate app/main/registration/_action/_verify.lua @ 1859:02c34183b6df

Fixed wrong filename in INSTALL file
author bsw
date Tue Nov 28 18:54:51 2023 +0100 (17 months ago)
parents e39206c7c4ea
children
rev   line source
bsw@1733 1 local verification = param.get("verification", "table")
bsw@1733 2
bsw@1733 3 local identification = config.self_registration.identification_func(verification.request_data)
bsw@1733 4
bsw@1733 5 local members_with_same_identification = Member:new_selector()
bsw@1733 6 :add_where{ "identification = ?", identification }
bsw@1733 7 :exec()
bsw@1733 8
bsw@1733 9 if #members_with_same_identification > 0 then
bsw@1733 10 verification.comment = (verification.comment or "").. " /// Manual verification needed: user with same name already exists"
bsw@1733 11 verification:save()
bsw@1733 12 request.redirect{ external = encode.url { module = "registration", view = "register_manual_check_needed" } }
bsw@1733 13 return false
bsw@1733 14 end
bsw@1733 15
bsw@1733 16 local member = Member:by_id(verification.requesting_member_id)
bsw@1733 17
bsw@1733 18 member.identification = identification
bsw@1733 19 member.notify_email = verification.request_data.email
bsw@1733 20
bsw@1733 21 member:send_invitation()
bsw@1733 22
bsw@1733 23 for i, unit_id in ipairs(config.self_registration.grant_privileges_for_unit_ids) do
bsw@1733 24 local privilege = Privilege:new()
bsw@1733 25 privilege.member_id = member.id
bsw@1733 26 privilege.unit_id = unit_id
bsw@1733 27 privilege.initiative_right = true
bsw@1733 28 privilege.voting_right = true
bsw@1733 29 privilege:save()
bsw@1733 30 end
bsw@1733 31
bsw@1739 32 verification.verified = "now"
bsw@1739 33 verification.verification_data = verification.request_data
bsw@1733 34 verification.verified_member_id = member.id
bsw@1733 35 verification.comment = (verification.comment or "").. " /// Account created"
bsw@1733 36
bsw@1733 37 verification:save()
bsw@1733 38

Impressum / About Us