Skip to content

Instantly share code, notes, and snippets.

@cs278
Created October 26, 2009 18:06
Show Gist options
  • Save cs278/218880 to your computer and use it in GitHub Desktop.
Save cs278/218880 to your computer and use it in GitHub Desktop.
phpBB Hook - Disables admin reauthentication.
<?php
/**
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
* To Public License, Version 2, as published by Sam Hocevar. See
* http://sam.zoy.org/wtfpl/COPYING for more details.
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* This hook disables the ACPs re-authentication
* The intended use for this hook is development environments,
* use in a live scenario is reckless.
*/
function hook_disable_admin_reauth(&$hook)
{
global $user, $auth;
if (empty($user->data['session_admin']) && $auth->acl_get('a_'))
{
$user->data['session_admin'] = 1;
}
}
$phpbb_hook->register('phpbb_user_session_handler', 'hook_disable_admin_reauth');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment