<?php

require_once '../../AccessControl.php';

if(isset($_FILES['importLocation'])) {
	// import profile settings from json file

	if(empty($_FILES['importLocation']["name"])) {
		echo json_encode(array("Status" => "Error", "Message" => _PLEASE_SELECT_SETTING_FILE));
		exit();
	}	
	if(!strpos($_FILES['importLocation']["name"],'.json')){
		echo json_encode(array("Status" => "Error", "Message" => _INVALID_SETTING_FILE));		
		exit();
	}
	include "../../includes/profile_import_export.php";
	$ep = new ProfileImportExport();
	$ep->importLocation = $_FILES['importLocation']["tmp_name"];
	$ep->importProfileSettings();
	exit();

}
?>