<?php
	$file = file_get_contents('web.manifest');
	$json = json_decode($file,true);

	if (!empty($_GET['color'])) {
		$json['theme_color'] = $_GET['color'];
		$json['background_color'] = $_GET['color'];
	}

	if (-1 === strpos($json['start_url'],'?')) $pad = '?';
	else $pad = '&';

	if (!empty($_GET['user'])) {
		$json['start_url'] .= $pad.'user='.$_GET['user'];
		$pad = '&';
	}

	header('Content-Type: application/manifest+json');
	print json_encode($json);
?>
