Compare commits

..

2 Commits

Author SHA1 Message Date
osaajani 7fc7a8f245 Add button to show api key and add qrcode 2022-01-20 02:52:31 +01:00
osaajani 85fb487d84 Hide api key by default and add qrcode 2022-01-20 02:51:41 +01:00
4 changed files with 36 additions and 3 deletions

View File

@ -1 +1 @@
v3.2.6 v3.2.7

1
assets/js/qrcode.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -42,7 +42,18 @@
<div class="panel-body"> <div class="panel-body">
<strong>Adresse e-mail :</strong> <?php $this->s($_SESSION['user']['email']); ?><br/> <strong>Adresse e-mail :</strong> <?php $this->s($_SESSION['user']['email']); ?><br/>
<strong>Niveau administrateur :</strong> <?php echo $_SESSION['user']['admin'] ? 'Oui' : 'Non'; ?><br/> <strong>Niveau administrateur :</strong> <?php echo $_SESSION['user']['admin'] ? 'Oui' : 'Non'; ?><br/>
<strong>Clef API :</strong> <?php echo $_SESSION['user']['api_key']; ?><br/> <br/>
<div id="api-key-container" class="">
<strong>Clef API :</strong>
<span id="show-api-key-link" class="visible">
<a href="#">Cliquez pour afficher la clef API.</a><br/>
</span>
<span id="api-key" class="hidden">
<?php echo $_SESSION['user']['api_key']; ?><br/>
<div style="margin-top: 15px" id="api-key-qrcode"></div>
</span>
</div>
</div> </div>
</div> </div>
<div class="panel panel-default"> <div class="panel panel-default">
@ -146,6 +157,25 @@
}); });
window.location = url; window.location = url;
}); });
jQuery('#show-api-key-link').on('click', function (e)
{
e.preventDefault();
jQuery(this).toggleClass('visible').toggleClass('hidden');
jQuery('#api-key').toggleClass('visible').toggleClass('hidden');
});
var qrcode = new QRCode("api-key-qrcode", {
text: <?= json_encode($_SESSION['user']['api_key']); ?>,
width: 128,
height: 128,
colorDark : "#000000",
colorLight : "#ffffff",
correctLevel : QRCode.CorrectLevel.H
});
jQuery('')
}); });
</script> </script>
<?php <?php

View File

@ -40,6 +40,8 @@
<!-- DataTables --> <!-- DataTables -->
<link href="<?php echo HTTP_PWD_CSS; ?>/datatables/datatables.min.css" rel="stylesheet" type="text/css"> <link href="<?php echo HTTP_PWD_CSS; ?>/datatables/datatables.min.css" rel="stylesheet" type="text/css">
<script src="<?php echo HTTP_PWD_JS; ?>/datatables/datatables.min.js"></script> <script src="<?php echo HTTP_PWD_JS; ?>/datatables/datatables.min.js"></script>
<!-- Qrcode lib -->
<script src="<?php echo HTTP_PWD_JS; ?>/qrcode.min.js"></script>
<!-- Custom JS --> <!-- Custom JS -->
<script src="<?php echo HTTP_PWD_JS; ?>/custom.js"></script> <script src="<?php echo HTTP_PWD_JS; ?>/custom.js"></script>