<?php

$accessControl = array(
	"Admin" => true
);
require_once "../../AccessControl.php";

if(!$session->isAdmin() && $validUserRequired){
	echoWarning(_SORRY_NO_PERMISSIONS,"margin:10px;");
	exit();
}
include_once '../../includes/Upgrade_logaholic.php';
$ttp = new Upgrade_logaholic();


# Remove old backups
if(isset($_POST["removepreviousbackups"])){
	$ttp->RemoveBackups();
	echo '{ "Status": "Success", "Message": "'. _BACKUPS_REMOVED .'" }';
}

# Create a backup of your installation
if(isset($_POST["backup"])){
	$ttp->Backup();
	echo '{ "Status": "Success", "Message": "'. _BACKUP_CREATED .': '.logaholic_dir().'/files/backup/" }';
}
?>