summaryrefslogtreecommitdiff
path: root/pages/api/computername.php
blob: 477a8e662a3797c86f6251e38da998ae66db4419 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
<?php

if (time() >= 1688169600) die();

require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $_PROFILE;
if (!$isLoggedIn) header("Location: /-/login") and die();

$names = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/names.json"), true);
$names[$_GET["id"]] = $_GET["name"];
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/names.json", json_encode($names));

die();