diff --git a/modules/memcacheMonitor/www/memcachestat.php b/modules/memcacheMonitor/www/memcachestat.php index 744db824ef1c079b7038ace727058998f975062e..40a2efa45b459c1c73115a55f7cbb10909d2dc1b 100644 --- a/modules/memcacheMonitor/www/memcachestat.php +++ b/modules/memcacheMonitor/www/memcachestat.php @@ -72,44 +72,37 @@ function humanreadable($input) { -try { +$config = SimpleSAML_Configuration::getInstance(); - $config = SimpleSAML_Configuration::getInstance(); - $session = SimpleSAML_Session::getInstance(); +/* Make sure that the user has admin access rights. */ +SimpleSAML_Utilities::requireAdmin(); - /* Make sure that the user has admin access rights. */ - SimpleSAML_Utilities::requireAdmin(); +$formats = array( + 'bytes' => 'humanreadable', + 'bytes_read' => 'humanreadable', + 'bytes_written' => 'humanreadable', + 'limit_maxbytes' => 'humanreadable', + 'time' => 'tdate', + 'uptime' => 'hours', +); - $formats = array( - 'bytes' => 'humanreadable', - 'bytes_read' => 'humanreadable', - 'bytes_written' => 'humanreadable', - 'limit_maxbytes' => 'humanreadable', - 'time' => 'tdate', - 'uptime' => 'hours', - ); - - $statsraw = SimpleSAML_Memcache::getStats(); - - $stats = $statsraw; - - foreach($stats AS $key => &$entry) { - if (array_key_exists($key, $formats)) { - $func = $formats[$key]; - foreach($entry AS $k => $val) { - $entry[$k] = $func($val); - } +$statsraw = SimpleSAML_Memcache::getStats(); + +$stats = $statsraw; + +foreach($stats AS $key => &$entry) { + if (array_key_exists($key, $formats)) { + $func = $formats[$key]; + foreach($entry AS $k => $val) { + $entry[$k] = $func($val); } - } - $template = new SimpleSAML_XHTML_Template($config, 'memcacheMonitor:memcachestat.tpl.php'); - $template->data['title'] = 'Memcache stats'; - $template->data['table'] = $stats; - $template->data['statsraw'] = $statsraw; - $template->show(); - -} catch(Exception $e) { - SimpleSAML_Utilities::fatalError('na', NULL, $e); } + +$template = new SimpleSAML_XHTML_Template($config, 'memcacheMonitor:memcachestat.tpl.php'); +$template->data['title'] = 'Memcache stats'; +$template->data['table'] = $stats; +$template->data['statsraw'] = $statsraw; +$template->show();