liquid_feedback_frontend
diff app/main/registration_admin/_action/update_verification.lua @ 1490:63ce1a5c05c1
Small enhancements for self registration process and management
| author | bsw |
|---|---|
| date | Wed Mar 27 12:40:33 2019 +0100 (2019-03-27) |
| parents | 378c20a2e6f0 |
| children | 64f47fd0fa5a |
line diff
1.1 --- a/app/main/registration_admin/_action/update_verification.lua Mon Feb 18 19:46:36 2019 +0100 1.2 +++ b/app/main/registration_admin/_action/update_verification.lua Wed Mar 27 12:40:33 2019 +0100 1.3 @@ -83,7 +83,20 @@ 1.4 member.identification = param.get("identification") 1.5 member.notify_email = param.get("email") 1.6 member:save() 1.7 - member:send_invitation() 1.8 + 1.9 + if config.self_registration.manual_invitation then 1.10 + local function secret_token() 1.11 + local parts = {} 1.12 + for i = 1, 5 do 1.13 + parts[#parts+1] = multirand.string(5, "23456789bcdfghjkmnpqrstvwxyz") 1.14 + end 1.15 + return (table.concat(parts, "-")) 1.16 + end 1.17 + member.invite_code = secret_token() 1.18 + member:save() 1.19 + else 1.20 + member:send_invitation() 1.21 + end 1.22 1.23 for i, unit_id in ipairs(config.self_registration.grant_privileges_for_unit_ids) do 1.24 local privilege = Privilege:new()