* @license see /license.txt
*/
$language_file = array('admin');
$cidReset = true;
require_once '../inc/global.inc.php';
require_once __DIR__ . '/admin_page.class.php';
class SystemManagementPage extends AdminPage
{
const PARAM_ACTION = 'action';
const PARAM_SECURITY_TOKEN = 'sec_token';
const ACTION_DEFAULT = 'list';
const ACTION_SECURITY_FAILED = 'security_failed';
function get_action()
{
$result = Request::get(self::PARAM_ACTION, self::ACTION_DEFAULT);
if ($result != self::ACTION_DEFAULT) {
$passed = Security::check_token('get');
Security::clear_token();
$result = $passed ? $result : self::ACTION_SECURITY_FAILED;
}
return $result;
}
function url($params)
{
$token = Security::get_token();
$params[self::PARAM_SECURITY_TOKEN] = $token;
return Uri::here($params);
}
function display_default()
{
$message = get_lang('RemoveOldDatabaseMessage');
$message_table = get_lang('RemoveOldTables');
$message_table .= "
".implode(' , ', self::get_tables_to_delete());
$url = $this->url(array(self::PARAM_ACTION => 'drop_old_databases'));
$url_table = $this->url(array(self::PARAM_ACTION => 'drop_old_tables'));
$go = get_lang('Go');
$access_url_id = api_get_current_access_url_id();
$message2 = '';
if ($access_url_id === 1) {
if (api_is_windows_os()) {
$message2 .= get_lang('SpaceUsedOnSystemCannotBeMeasuredOnWindows');
} else {
$dir = api_get_path(SYS_PATH);
$du = exec('du -sh ' . $dir, $err);
list($size, $none) = explode("\t", $du);
$limit = $_configuration[$url]['hosting_limit_disk_space'];
$message2 .= sprintf(get_lang('TotalSpaceUsedByPortalXLimitIsYMB'), $size, $limit);
}
}
if (!empty($message2)) {
$message2 = '