2019-02-08 13:44:52 -05:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Purge our session cache details
|
|
|
|
*
|
|
|
|
* @package phpLDAPadmin
|
|
|
|
* @subpackage Page
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
*/
|
|
|
|
|
|
|
|
require './common.php';
|
|
|
|
|
|
|
|
$purge_session_keys = array('app_initialized','backtrace','cache',APPCONFIG);
|
|
|
|
|
|
|
|
$size = 0;
|
|
|
|
foreach ($purge_session_keys as $key)
|
2019-02-12 14:57:50 -05:00
|
|
|
{
|
|
|
|
if (isset($_SESSION[$key]))
|
|
|
|
{
|
2019-02-08 13:44:52 -05:00
|
|
|
$size += strlen(serialize($_SESSION[$key]));
|
|
|
|
unset($_SESSION[$key]);
|
|
|
|
}
|
2019-02-12 14:57:50 -05:00
|
|
|
}
|
2019-02-08 13:44:52 -05:00
|
|
|
|
|
|
|
if (! $size)
|
2019-02-12 14:57:50 -05:00
|
|
|
{
|
2019-02-08 13:44:52 -05:00
|
|
|
$body = _('No cache to purge.');
|
2019-02-12 14:57:50 -05:00
|
|
|
}
|
2019-02-08 13:44:52 -05:00
|
|
|
else
|
2019-02-12 14:57:50 -05:00
|
|
|
{
|
|
|
|
$body = sprintf(_('Purged %s bytes of cache.'), number_format($size));
|
|
|
|
}
|
2019-02-08 13:44:52 -05:00
|
|
|
|
|
|
|
system_message(array(
|
|
|
|
'title'=>_('Purge cache'),
|
|
|
|
'body'=>$body,
|
|
|
|
'type'=>'info'),
|
|
|
|
get_request('meth','REQUEST') == 'ajax' ? null : 'index.php');
|
2019-02-12 14:52:01 -05:00
|
|
|
|