twofactor_enforced: Make template work with nil values

This commit is contained in:
Magnus Andersson 2024-10-01 11:19:43 +02:00
parent b7e94c2259
commit 24c2fcbdfc
Signed by untrusted user: mandersson
GPG key ID: 1F7C896B34B28164

View file

@ -214,18 +214,22 @@ $CONFIG = array (
array ( array (
0 => 'admin', 0 => 'admin',
1 => 'forcemfa', 1 => 'forcemfa',
<%- index = 2 -%> <%- if @twofactor_enforced_groups -%>
<%- @twofactor_enforced_groups.each do |item| -%> <%- index = 2 -%>
<%- @twofactor_enforced_groups.each do |item| -%>
<%= index %> => '<%= item %>', <%= index %> => '<%= item %>',
<%- index += 1 -%> <%- index += 1 -%>
<%- end -%>
<%- end -%> <%- end -%>
), ),
'twofactor_enforced_excluded_groups' => 'twofactor_enforced_excluded_groups' =>
array ( array (
<%- index = 0 -%> <%- if @twofactor_enforced_excluded_groups -%>
<%- @twofactor_enforced_excluded_groups.each do |item| -%> <%- index = 0 -%>
<%- @twofactor_enforced_excluded_groups.each do |item| -%>
<%= index %> => '<%= item %>', <%= index %> => '<%= item %>',
<%- index += 1 -%> <%- index += 1 -%>
<%- end -%>
<%- end -%> <%- end -%>
), ),
'updatechecker' => false, 'updatechecker' => false,