comparison plugins/mod_invites.lua @ 13851:ecafafec7806 13.0

mod_invites: Consider password reset a distinct type wrt invite page This should prevent returning an invite web page unless it supports password resets.
author Kim Alvefur <zash@zash.se>
date Tue, 15 Apr 2025 21:47:13 +0200
parents e9edf9b50f32
children c83fdee8efda
comparison
equal deleted inserted replaced
13849:068e77bf91b9 13851:ecafafec7806
219 if not invite_url_template or invite.landing_page then return; end 219 if not invite_url_template or invite.landing_page then return; end
220 220
221 -- Determine whether this type of invitation is supported by the landing page 221 -- Determine whether this type of invitation is supported by the landing page
222 local invite_type; 222 local invite_type;
223 if invite.type == "register" then 223 if invite.type == "register" then
224 invite_type = "account"; 224 if invite.additional_data and invite.additional_data.allow_reset then
225 invite_type = "password-reset";
226 else
227 invite_type = "account";
228 end
225 elseif invite.type == "roster" then 229 elseif invite.type == "roster" then
226 if invite.allow_registration then 230 if invite.allow_registration then
227 invite_type = "account-and-contact"; 231 invite_type = "account-and-contact";
228 else 232 else
229 invite_type = "contact-only"; 233 invite_type = "contact-only";