aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--admin.php8
-rw-r--r--admin/include/functions.php12
2 files changed, 14 insertions, 6 deletions
diff --git a/admin.php b/admin.php
index b66378e73..dc848ab49 100644
--- a/admin.php
+++ b/admin.php
@@ -154,7 +154,6 @@ if (count($page['infos']) != 0)
}
$template->parse('admin');
-include(PHPWG_ROOT_PATH.'include/page_tail.php');
// +-----------------------------------------------------------------------+
// | order permission refreshment |
@@ -179,11 +178,8 @@ if (
)
)
{
- $query = '
-UPDATE '.USER_CACHE_TABLE.'
- SET need_update = \'true\'
-;';
- pwg_query($query);
+ invalidate_user_cache();
}
+include(PHPWG_ROOT_PATH.'include/page_tail.php');
?>
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 6e97e3908..66deb5777 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -2013,4 +2013,16 @@ function pwg_URL()
return $urls;
}
+/**
+ * Invalidates cahed data (permissions and category counts) for all users.
+ */
+function invalidate_user_cache()
+{
+ $query = '
+UPDATE '.USER_CACHE_TABLE.'
+ SET need_update = \'true\'
+;';
+ pwg_query($query);
+ trigger_action('invalidate_user_cache');
+}
?>