Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hide otp #7926

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/www/system_usermanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,19 @@ function get_user_privdesc(& $user)
$('#otp_qrcode').show();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cluster the sections together as in bundle the "unhide" action into this method??

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, so you don't have to manipulate the existing input / add the textarea

});

// Show OTP
var otp_hidden = true;
$('#show_otp').on("click", function () {
if (otp_hidden) {
var hidden = document.getElementById("otp_seed").value;
document.getElementById("otp_seed_text").textContent = hidden;
otp_hidden = false;
} else {
document.getElementById("otp_seed_text").textContent = '****************';
otp_hidden = true;
}
});

// remove user
$(".act-del-user").click(function(event){
var userid = $(this).data('userid');
Expand Down Expand Up @@ -913,9 +926,13 @@ class="btn btn-default btn-xs" data-toggle="tooltip" title="<?=gettext("export c
<tr>
<td><a id="help_for_otp_seed" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?= gettext('OTP seed') ?></td>
<td>
<input name="otp_seed" type="text" value="<?=$pconfig['otp_seed'];?>"/>
<?php // on initial install, there is no OTP seed. Check if it is set ?>
<textarea id="otp_seed_text" cols="65" rows="1"><?= isset($pconfig['otp_seed']) ? gettext('****************') : "";?></textarea>
<input id="otp_seed" name="otp_seed" type="hidden" value="<?=$pconfig['otp_seed'];?>"/>
<input type="checkbox" name="gen_otp_seed"/>
<small><?= gettext('Generate new secret (160 bit)') ?></small>
<input id="show_otp" type="checkbox"/>
<small><?= gettext('Show OTP seed') ?></small>
<div class="hidden" data-for="help_for_otp_seed">
<?=gettext("OTP (base32) seed to use when a one time password authenticator is used");?><br/>
</div>
Expand Down