Commit 0ab98683 authored by robertDouglass's avatar robertDouglass

adding hook perm, an 'access memcache statistics' permission, and using that...

adding hook perm, an 'access memcache statistics' permission, and using that to determine whether to show the stats.
parent d294a985
......@@ -2,7 +2,7 @@
// $Id$
/**
* Add serialized field to cache tables
* Add serialized field to cache tables.
*/
function memcache_install() {
switch ($GLOBALS['db_type']) {
......
......@@ -11,6 +11,9 @@ function memcache_init() {
}
}
function memcache_perm() {
return array('access memcache statistics');
}
/**
* See memcache_init() which registers this function as a shutdown function.
......@@ -29,7 +32,7 @@ function memcache_shutdown() {
}
}
if ($user->uid == 1) {
if (user_access('access memcache statistics')) {
$stats = array();
foreach ($_memcache_statistics as $stat => $val) {
$stats[] = "<strong>$stat:</strong> ". theme('item_list', $val);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment