diff options
Diffstat (limited to 'admin')
-rw-r--r-- | admin/include/functions.php | 20 | ||||
-rw-r--r-- | admin/maintenance.php | 2 |
2 files changed, 17 insertions, 5 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php index d7369ddf0..764f7b97c 100644 --- a/admin/include/functions.php +++ b/admin/include/functions.php @@ -1762,12 +1762,24 @@ function pwg_URL() /** * Invalidates cahed data (permissions and category counts) for all users. */ -function invalidate_user_cache() +function invalidate_user_cache($full = true) { - $query = ' + if ($full) + { + $query = ' +TRUNCATE TABLE '.USER_CACHE_CATEGORIES_TABLE.';'; + pwg_query($query); + $query = ' +TRUNCATE TABLE '.USER_CACHE_TABLE.';'; + pwg_query($query); + } + else + { + $query = ' UPDATE '.USER_CACHE_TABLE.' - SET need_update = \'true\''; - pwg_query($query); + SET need_update = \'true\';'; + pwg_query($query); + } trigger_action('invalidate_user_cache'); } diff --git a/admin/maintenance.php b/admin/maintenance.php index 946fcf916..56f9b592b 100644 --- a/admin/maintenance.php +++ b/admin/maintenance.php @@ -46,7 +46,7 @@ switch ($action) update_uppercats(); update_category('all'); update_global_rank(); - invalidate_user_cache(); + invalidate_user_cache(true); break; } case 'images' : |