diff --git a/www/admin/memcachestat.php b/www/admin/memcachestat.php new file mode 100644 index 0000000000000000000000000000000000000000..c13653857f816950dcbf90fe3d3ff02eb45b5b81 --- /dev/null +++ b/www/admin/memcachestat.php @@ -0,0 +1,35 @@ +<?php + +require_once('../_include.php'); + +require_once('SimpleSAML/Configuration.php'); +require_once('SimpleSAML/MemcacheStore.php'); +require_once('SimpleSAML/Session.php'); +require_once('SimpleSAML/Utilities.php'); +require_once('SimpleSAML/XHTML/Template.php'); + +try { + + $config = SimpleSAML_Configuration::getInstance(); + $session = SimpleSAML_Session::getInstance(true); + + /* Make sure that the user has admin access rights. */ + if (!isset($session) || !$session->isValid('login-admin') ) { + SimpleSAML_Utilities::redirect('/' . $config->getValue('baseurlpath') . 'auth/login-admin.php', + array('RelayState' => SimpleSAML_Utilities::selfURL()) + ); + } + + + $stats = SimpleSAML_MemcacheStore::getStats(); + + $template = new SimpleSAML_XHTML_Template($config, 'status-table.php'); + $template->data['title'] = 'Memcache stats'; + $template->data['table'] = $stats; + $template->show(); + +} catch(Exception $e) { + SimpleSAML_Utilities::fatalError('na', NULL, $e); +} + +?> \ No newline at end of file