summaryrefslogtreecommitdiff
path: root/Application/SetDefaultIdentity/index.php
blob: d35eb6a6bc08c88e96d2b57fd102eda09414c367 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . "/Private/SessionManager.php"; global $_PROFILE;
header("Content-Type: application/json");

$identities = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Data/Identities.json"), true);

$identities[$_PROFILE["id"]]["name"] = $_PROFILE["name"];
$identities[$_PROFILE["id"]]["picture"] = "https://privateauth.equestria.dev/hub/api/rest/avatar/" . $_PROFILE['id'] . "?dpr=2&size=64";

file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Data/Identities.json", json_encode($identities, JSON_PRETTY_PRINT));

die();