summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Douglass2007-05-21 17:02:00 (GMT)
committerRobert Douglass2007-05-21 17:02:00 (GMT)
commit0ab98683e5f49136c8609f6125198dcb1bff53f1 (patch)
tree75c692b107bd06d035575ba1ecdf55e4617aceae
parentd294a98522f9b8e898428cb059893e9189365e9c (diff)
adding hook perm, an 'access memcache statistics' permission, and using that to determine whether to show the stats.
-rw-r--r--memcache.install2
-rw-r--r--memcache.module5
2 files changed, 5 insertions, 2 deletions
diff --git a/memcache.install b/memcache.install
index 57b4411..1da29be 100644
--- a/memcache.install
+++ b/memcache.install
@@ -2,7 +2,7 @@
// $Id$
/**
- * Add serialized field to cache tables
+ * Add serialized field to cache tables.
*/
function memcache_install() {
switch ($GLOBALS['db_type']) {
diff --git a/memcache.module b/memcache.module
index c9c3e12..5253f9b 100644
--- a/memcache.module
+++ b/memcache.module
@@ -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);