1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +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:
Paul S. Owen
2003-03-29 18:25:41 +00:00
parent 88fbdb6e1e
commit 9e38434b4a
2 changed files with 61 additions and 69 deletions

View File

@@ -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'])
{