mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
Moved acl_options caching code into acl
git-svn-id: file:///svn/phpbb/trunk@3746 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -109,6 +109,7 @@ define('PRIVMSGS_UNREAD_MAIL', 5);
|
||||
// Table names
|
||||
define('ACL_GROUPS_TABLE', $table_prefix.'auth_groups');
|
||||
define('ACL_OPTIONS_TABLE', $table_prefix.'auth_options');
|
||||
define('ACL_DEPS_TABLE', $table_prefix.'auth_dependencies');
|
||||
define('ACL_PRESETS_TABLE', $table_prefix.'auth_presets');
|
||||
define('ACL_USERS_TABLE', $table_prefix.'auth_users');
|
||||
define('ATTACHMENTS_TABLE', $table_prefix.'attachments');
|
||||
@@ -197,33 +198,6 @@ else
|
||||
$cache->put('config', $config);
|
||||
}
|
||||
|
||||
if (!($acl_options = $cache->get('acl_options')))
|
||||
{
|
||||
$acl_options = array();
|
||||
|
||||
$sql = "SELECT auth_value, is_global, is_local
|
||||
FROM " . ACL_OPTIONS_TABLE . "
|
||||
ORDER BY auth_option_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$global = $local = 0;
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if (!empty($row['is_global']))
|
||||
{
|
||||
$acl_options['global'][$row['auth_value']] = $global++;
|
||||
}
|
||||
if (!empty($row['is_local']))
|
||||
{
|
||||
$acl_options['local'][$row['auth_value']] = $local++;
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$cache->put('acl_options', $acl_options);
|
||||
$auth->acl_clear_prefetch();
|
||||
}
|
||||
|
||||
/*
|
||||
if (time() - $config['cache_interval'] >= $config['cache_last_gc'])
|
||||
{
|
||||
|
Reference in New Issue
Block a user