Skip to content

Instantly share code, notes, and snippets.

@robetus
Forked from jclarke/no_admin_confirm.php
Created September 22, 2017 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robetus/bd082a4641073f036d6b81f223d8e341 to your computer and use it in GitHub Desktop.
Save robetus/bd082a4641073f036d6b81f223d8e341 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