Skip to content

Instantly share code, notes, and snippets.

@yashodhank
Forked from jclarke/no_admin_confirm.php
Created July 26, 2019 11:30
Show Gist options
  • Save yashodhank/09dd227bae1b62975fa08b9bb292a9c1 to your computer and use it in GitHub Desktop.
Save yashodhank/09dd227bae1b62975fa08b9bb292a9c1 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>
';
});
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment