1<?php
2/**
3 * @package tikiwiki
4 */
5// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
6//
7// All Rights Reserved. See copyright.txt for details and a complete list of authors.
8// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
9// $Id$
10
11require_once('tiki-setup.php');
12require_once("lib/phpseclib_tiki/tikisecure.php");
13
14global $prefs;
15
16if ($prefs['feature_futurelinkprotocol'] == "y") {
17	$requester = gethostbyaddr($_SERVER['REMOTE_ADDR']);
18
19	if (isset($requester)) {
20		if (isset($_REQUEST['hash'], $_REQUEST["clienttime"])) {
21			$timestamp = TikiSecure::timestamp($_REQUEST["hash"], $_REQUEST["clienttime"], $requester);
22		} elseif ($_REQUEST['timestamp']) {
23			$timestamp = TikiSecure::openTimestamp(json_decode(urldecode($_REQUEST['timestamp'])), $requester);
24		}
25
26		echo json_encode($timestamp);
27		exit();
28	}
29
30	//We list all public keys here
31}
32