new: [privacy] filter added for the authkeys in the admin section to make giving trainings easier

pull/5809/head
iglocska 2020-04-21 08:09:26 +02:00
parent aed771ef4a
commit 45e42ca84f
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
4 changed files with 25 additions and 2 deletions

View File

@ -46,7 +46,7 @@ class AppController extends Controller
public $helpers = array('Utility', 'OrgImg', 'FontAwesome', 'UserName', 'DataPathCollector');
private $__queryVersion = '103';
private $__queryVersion = '104';
public $pyMispVersion = '2.4.123';
public $phpmin = '7.2';
public $phprec = '7.4';

View File

@ -19,6 +19,12 @@
$data = '';
} else {
$data = h($data);
if (!empty($field['privacy'])) {
$data = sprintf(
'<span class="privacy-value" data-hidden-value="%s">****************************************</span> <i class="privacy-toggle fas fa-eye useCursorPointer"></i>',
$data
);
}
}
if (!empty($field['onClick'])) {
$data = sprintf(

View File

@ -84,3 +84,19 @@
echo $this->element('/genericElements/IndexTable/pagination', $paginationData);
}
?>
<script type="text/javascript">
$(document).ready(function() {
$('.privacy-toggle').on('click', function() {
var $privacy_target = $(this).parent().find('.privacy-value');
if ($(this).hasClass('fa-eye')) {
$privacy_target.text($privacy_target.data('hidden-value'));
$(this).removeClass('fa-eye');
$(this).addClass('fa-eye-slash');
} else {
$privacy_target.text('****************************************');
$(this).removeClass('fa-eye-slash');
$(this).addClass('fa-eye');
}
});
});
</script>

View File

@ -69,7 +69,8 @@
'sort' => 'User.authkey',
'class' => 'bold quickSelect',
'data_path' => 'User.authkey',
'onClick' => 'quickSelect(this);'
'onClick' => 'quickSelect(this);',
'privacy' => 1
),
array(
'name' => __('Autoalert'),