summaryrefslogtreecommitdiff
path: root/api/addLibrary.php
blob: b59e4762154c7dd605dc0aa4e960eb825201d1a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php

header("X-Frame-Options: SAMEORIGIN");
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php";
global $albums; global $_PROFILE; global $library;

if (!isset($_GET["i"]) || !isset($albums[$_GET["i"]])) return;

if (!in_array($_GET["i"], $library)) {
    $library[] = $_GET["i"];
}

file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-library.json", json_encode($library));