webauthn/src/Application/views/admin/tpl/d3user_webauthn.tpl

161 lines
7.1 KiB
Smarty
Raw Normal View History

2022-10-24 22:24:40 +02:00
[{include file="headitem.tpl" title="GENERAL_ADMIN_TITLE"|oxmultilangassign}]
2022-10-26 14:42:26 +02:00
[{oxstyle include="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"}]
[{oxscript include="https://code.jquery.com/jquery-3.2.1.slim.min.js"}]
[{oxscript include="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"}]
[{oxscript include="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"}]
[{oxstyle include="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/solid.min.css"}]
[{oxstyle}]
2022-10-24 22:24:40 +02:00
[{if $readonly}]
[{assign var="readonly" value="readonly disabled"}]
[{else}]
[{assign var="readonly" value=""}]
[{/if}]
<style>
2022-10-24 22:24:40 +02:00
td.edittext {
white-space: normal;
}
.hidden-delete {
display: none;
}
2022-10-26 14:42:26 +02:00
.container-fluid,
.errorbox {
font-size: 13px;
}
.errorbox p {
margin: 0.5rem;
}
2022-10-24 22:24:40 +02:00
</style>
<form name="transfer" id="transfer" action="[{$oViewConf->getSelfLink()}]" method="post">
[{$oViewConf->getHiddenSid()}]
<input type="hidden" name="oxid" value="[{$oxid}]">
<input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]">
</form>
[{capture name="javascripts"}]
function deleteItem(id) {
2022-10-31 00:11:06 +01:00
if (confirm('[{oxmultilang ident="D3WEBAUTHN_DELETE_CONFIRM"}]') === true) {
2022-10-24 22:24:40 +02:00
document.getElementById('fncname').value = 'deleteKey';
document.getElementById('oxidvalue').value = id;
document.getElementById('myedit').submit();
2022-10-24 22:24:40 +02:00
}
}
[{/capture}]
[{oxscript add=$smarty.capture.javascripts}]
[{if $oxid && $oxid != '-1'}]
[{if $pageType === 'requestnew'}]
2022-10-26 14:42:26 +02:00
<div class="container-fluid">
<div class="row justify-content-center">
<div class="col-6">
[{include file="js_create.tpl"}]
<div class="card">
<div class="card-body">
<p class="card-text">
2022-10-31 00:11:06 +01:00
[{oxmultilang ident="D3WEBAUTHN_CONF_BROWSER_REQUEST"}]
</p>
2022-10-31 00:11:06 +01:00
<button onclick="document.getElementById('webauthn').submit();">[{oxmultilang ident="D3WEBAUTHN_CANCEL"}]</button>
</div>
</div>
</div>
2022-10-26 14:42:26 +02:00
</div>
</div>
[{else}]
<form name="myedit" id="myedit" action="[{$oViewConf->getSelfLink()}]" method="post" style="padding: 0;margin: 0;height:0;">
[{$oViewConf->getHiddenSid()}]
<input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]">
<input type="hidden" id="fncname" name="fnc" value="">
<input type="hidden" id="authnvalue" name="authnvalue" value="">
<input type="hidden" id="errorvalue" name="errorvalue" value="">
<input type="hidden" name="oxid" value="[{$oxid}]">
<input type="hidden" name="deleteoxid" id="oxidvalue" value="">
<button type="submit" style="display: none;"></button>
</form>
[{if $sSaveError}]
<table style="padding:0; border:0; width:98%;">
<tr>
<td></td>
2022-10-31 00:11:06 +01:00
<td class="errorbox">
[{oxmultilang ident=$sSaveError}]
</td>
</tr>
</table>
[{/if}]
2022-10-24 22:24:40 +02:00
2022-10-26 14:42:26 +02:00
<div class="container-fluid">
<div class="row">
<div class="col-6">
<div class="card">
[{block name="user_d3user_totp_registernew"}]
<div class="card-header">
[{oxmultilang ident="D3_WEBAUTHN_REGISTERNEW"}]
</div>
<div class="card-body">
<form name="newcred" id="newcred" action="[{$oViewConf->getSelfLink()}]" method="post">
[{$oViewConf->getHiddenSid()}]
<input type="hidden" name="cl" value="[{$oView->getClassName()}]">
<input type="hidden" name="fnc" value="requestNewCredential">
<input type="hidden" name="oxid" value="[{$oxid}]">
[{block name="user_d3user_totp_registerform"}]
2022-10-31 00:11:06 +01:00
<label for="credentialname">
[{oxmultilang ident="D3_WEBAUTHN_KEYNAME"}]
</label>
2022-10-26 14:42:26 +02:00
<p class="card-text">
<input id="credentialname" type="text" name="credenialname" [{$readonly}]>
</p>
<p class="card-text">
<button type="submit" [{$readonly}] class="btn btn-primary btn-success">
[{oxmultilang ident="D3_WEBAUTHN_ADDKEY"}]
</button>
</p>
[{/block}]
</form>
</div>
[{/block}]
</div>
</div>
<div class="col-6">
<div class="card">
2022-10-24 22:24:40 +02:00
[{block name="user_d3user_totp_form2"}]
2022-10-26 14:42:26 +02:00
<div class="card-header">
[{oxmultilang ident="D3_WEBAUTHN_REGISTEREDKEYS"}]
</div>
<div class="card-body">
[{assign var="list" value=$oView->getCredentialList($oxid)}]
[{if $list|@count}]
2022-10-26 14:42:26 +02:00
<ul class="list-group list-group-flush">
[{foreach from=$list item="credential"}]
2022-10-26 14:42:26 +02:00
<li class="list-group-item">
[{$credential->getName()}]
<a onclick="deleteItem('[{$credential->getId()}]'); return false;" href="#" class="btn btn-danger btn-sm">
<span class="glyphicon glyphicon-pencil"></span>
2022-10-31 00:11:06 +01:00
[{oxmultilang ident="D3WEBAUTHN_DELETE"}]
2022-10-26 14:42:26 +02:00
</a>
</li>
[{/foreach}]
</ul>
[{else}]
<div class="card-text">
2022-10-31 00:11:06 +01:00
[{oxmultilang ident="D3WEBAUTHN_CANCELNOKEYREGISTERED"}]
2022-10-26 14:42:26 +02:00
</div>
[{/if}]
</div>
2022-10-24 22:24:40 +02:00
[{/block}]
2022-10-26 14:42:26 +02:00
</div>
</div>
</div>
</div>
2022-10-24 22:24:40 +02:00
[{/if}]
[{/if}]
2022-10-26 14:42:26 +02:00
[{oxscript}]
2022-10-24 22:24:40 +02:00
[{include file="bottomnaviitem.tpl"}]
[{include file="bottomitem.tpl"}]