Skip to content

Instantly share code, notes, and snippets.

@jclarke
Last active November 27, 2021 13:03
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save jclarke/92cb1e0d6f312872690f3c2b4be86bf7 to your computer and use it in GitHub Desktop.
Save jclarke/92cb1e0d6f312872690f3c2b4be86bf7 to your computer and use it in GitHub Desktop.
Disables the confirm password feature in the WHMCS admin area. Place in includes/hooks
<?php
add_hook('AdminLogin', 1, function($vars) {
$_SESSION["AuthConfirmationTimestamp"] = \Carbon\Carbon::now()->timestamp;
});
add_hook('AdminAreaHeadOutput', 1, function($vars) {
$_SESSION["AuthConfirmationTimestamp"] = \Carbon\Carbon::now()->timestamp;
return '
<script type="text/javascript">
$(document).ready(function(){
if ($("input[name=\'authconfirm\']").val() == 1) {
location.reload();
}
});
</script>
';
});
?>
@agarzon
Copy link

agarzon commented Oct 16, 2020

Hi.

Just to report this hook does not work anymore, at least in WHMCS 8. Thanks.

UPDATE:
My bad, it works perfectly ok, I just remove the JS part.

@Zaffar
Copy link

Zaffar commented Jan 12, 2021

HI

I tried it on WHMCS 7.7.1, but it doesn't seem to work, the only thing that keeps happening is that the page keeps refreshing....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment