Commit 1de19778 authored by Christophe Maudoux's avatar Christophe Maudoux

Display delete button only if allowed (#1622)

parent 36dd0019
......@@ -333,6 +333,7 @@ sub _displayRegister {
}
# Parse second factors to display delete button if allowed
my $action = '';
foreach (@$_2fDevices) {
if ( $_->{type} eq 'U2F' ) {
$_->{delAllowed}
......@@ -352,6 +353,7 @@ sub _displayRegister {
&& $self->conf->{yubikey2fUserCanRemoveKey}
&& $self->conf->{yubikey2fSelfRegistration};
}
$action ||= $_->{delAllowed};
}
# Display template
......@@ -363,6 +365,7 @@ sub _displayRegister {
SKIN => $self->conf->{portalSkin},
MODULES => \@am,
SFDEVICES => $_2fDevices,
ACTION => $action,
REG_REQUIRED => $req->data->{sfRegRequired},
}
);
......
......@@ -17,7 +17,10 @@
<th><span trspan="type">Type</span></th>
<th><span trspan="name">Name</span></th>
<th><span trspan="date">Date</span></th>
<th><span trspan="action">Action</span></th>
<th>
<TMPL_IF NAME="ACTION">
<span trspan="action">Action</span></th>
</TMPL_IF>
</tr>
</thead>
<tbody>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment