Skip to content

Instantly share code, notes, and snippets.

@mhrubel
Forked from jclarke/no_admin_confirm.php
Created February 8, 2019 13:52
Show Gist options
  • Save mhrubel/b82c56f37efd02d21cf8686eefeb71ff to your computer and use it in GitHub Desktop.
Save mhrubel/b82c56f37efd02d21cf8686eefeb71ff 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