<?php session_start(); date_default_timezone_set(file_get_contents("http://rhiaro.co.uk/tz")); if (isset($_GET['logout'])) { session_unset(); session_destroy(); header("Location: /replicator"); } if (isset($_GET['reset']) && $_GET['reset'] == "images") { $_SESSION['images'] = set_default_images(); header("Location: /replicator"); } if (isset($_GET['reset']) && $_GET['reset'] == "feed") { unset($_SESSION['feed']); unset($_SESSION['feed_source']); header("Location: /replicator"); } include "link-rel-parser.php"; $base = "https://apps.rhiaro.co.uk/replicator"; if (isset($_GET['code'])) { $auth = auth($_GET['code'], $_GET['state']); if ($auth !== true) { $errors = $auth; } else { $response = get_access_token($_GET['code'], $_GET['state']); if ($response !== true) { $errors = $auth; } else { header("Location: " . $_GET['state']); }
if (isset($_GET['code'])) { $auth = auth($_GET['code'], $_GET['state']); if ($auth !== true) { $errors = $auth; } else { $response = get_access_token($_GET['code'], $_GET['state']); if ($response !== true) { $errors = $auth; } else { header("Location: " . $_GET['state']); } } } // VIP cache $vips = array("http://rhiaro.co.uk", "http://rhiaro.co.uk/", "http://tigo.rhiaro.co.uk/"); $images = set_default_images(); if (isset($_SESSION['images'])) { $images = $_SESSION['images']; } if (isset($_POST['images_source'])) { $fetch = get_images($_POST['images_source']); if (!$fetch) { $errors["Problem fetching images"] = "The images url needs to return a single page AS2 Collection as JSON[-LD]. {$_POST['images_source']} did not return this."; } else { $images = $fetch; } } if (isset($_POST['feed_source'])) { $feed = get_feed($_POST['feed_source']); if (!$feed) { $errors["Problem fetching feed"] = "Something went wrong";