I created this script to display the duplicate values and thought it may be useful.
Code: Select all
<?php
/**
*
* @package arcade
* @version $Id: perm_check.php 217 2008-05-01 20:14:38Z jrsweets $
* @copyright (c) 2008 http://www.JeffRusso.net
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
define('IN_PHPBB', 1);
$phpEx = substr(strrchr(__FILE__, '.'), 1);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
include($phpbb_root_path . 'common.'.$phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
if ($user->data['user_type'] != USER_FOUNDER)
{
die('You are not authorized to use this script.');
}
$sql = 'SELECT auth_option_id, auth_option
FROM ' . ACL_OPTIONS_TABLE . '
ORDER BY auth_option_id';
$result = $db->sql_query($sql);
$auth_option_id = array();
while ($row = $db->sql_fetchrow($result))
{
$auth_option_id[$row['auth_option_id']] = $row['auth_option'];
}
$db->sql_freeresult($result);
$duplicate_auth = array_count_values($auth_option_id);
unset($auth_option_id);
$auth_option_id = array();
foreach ($duplicate_auth as $key => $value)
{
if ($value > 1)
{
$auth_option_id[] = $key . ' was found ' . $value . ' times';
}
}
if (!empty($auth_option_id))
{
display_error('Duplicate auth values can cause problems with permissions. The following duplicate auth values were found inside the ' . ACL_OPTIONS_TABLE . ':', $auth_option_id);
}
else
{
echo 'No duplicates found';
}
function display_error($title, $error)
{
echo '<p style="color: red; font-size: 1.05em; font-family: \'Trebuchet MS\', Helvetica, sans-serif;"><strong>'. $title .'</strong><br />' . implode('<br />', $error) . '</p>';
}
?>