2009-06-30 09:22:30 +00:00
|
|
|
<?php
|
2009-06-30 09:29:51 +00:00
|
|
|
/**
|
2009-07-01 06:09:17 +00:00
|
|
|
* Purge our session cache details
|
|
|
|
*
|
2009-06-30 09:29:51 +00:00
|
|
|
* @package phpLDAPadmin
|
2009-07-01 06:09:17 +00:00
|
|
|
* @subpackage Page
|
2009-06-30 09:29:51 +00:00
|
|
|
*/
|
2009-07-01 06:09:17 +00:00
|
|
|
|
2009-06-30 09:29:51 +00:00
|
|
|
/**
|
|
|
|
*/
|
2009-06-30 09:22:30 +00:00
|
|
|
|
|
|
|
require './common.php';
|
|
|
|
|
2009-07-01 06:09:17 +00:00
|
|
|
$purge_session_keys = array('app_initialized','backtrace','cache',APPCONFIG);
|
2009-06-30 09:22:30 +00:00
|
|
|
|
|
|
|
$size = 0;
|
2009-07-01 06:09:17 +00:00
|
|
|
foreach ($purge_session_keys as $key)
|
2009-06-30 10:26:08 +00:00
|
|
|
if (isset($_SESSION[$key])) {
|
|
|
|
$size += strlen(serialize($_SESSION[$key]));
|
|
|
|
unset($_SESSION[$key]);
|
|
|
|
}
|
2009-06-30 09:22:30 +00:00
|
|
|
|
2009-06-30 09:29:51 +00:00
|
|
|
if (! $size)
|
2009-07-01 06:09:17 +00:00
|
|
|
$body = _('No cache to purge.');
|
2009-06-30 09:22:30 +00:00
|
|
|
else
|
2009-06-30 10:46:00 +00:00
|
|
|
$body = sprintf(_('Purged %s bytes of cache.'),number_format($size));
|
2009-06-30 09:22:30 +00:00
|
|
|
|
2009-06-30 10:46:00 +00:00
|
|
|
system_message(array(
|
|
|
|
'title'=>_('Purge cache'),
|
|
|
|
'body'=>$body,
|
|
|
|
'type'=>'info'),
|
2009-07-01 06:09:17 +00:00
|
|
|
get_request('meth','REQUEST') == 'ajax' ? null : 'index.php');
|
2009-06-30 10:26:08 +00:00
|
|
|
?>
|