<?php


# export profile settings to json file
include "../../common.inc.php";
include "../../includes/profile_import_export.php";

if(!empty($profile)){
	$ep = new ProfileImportExport();
	$ep->exportLocation = logaholic_dir() . "files/";
	$ep->profile = $profile->profilename;
	$ep->exportProfileSettings();
	$file = file_get_contents($ep->exportedfile);
	$filename = $profile->profilename . '_settings.json';
	header('Content-type: text/plain');	
	header('Content-disposition: attachment; filename="'.$filename.'"');
	echo $file;
	unlink($ep->exportedfile);
	exit;
}
?>