aboutsummaryrefslogtreecommitdiff
path: root/welcome/confirm/index.php
blob: e5916e6f231254b9eb36dcabc22301aeec29048d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . "/private/session-noconf.php";

/** @var string $_FULLNAME
 *  @var string $_USER
 *  @var array $_PROFILE
 *  @var boolean $_ADMIN
 *  @var array $_CONFIG
 */

global $_WELCOMED;
if (!file_exists("/mnt/familine/private/welcomed.json")) {
    file_put_contents("/mnt/familine/private/welcomed.json", "[]");
}
$_WELCOMED = json_decode(file_get_contents("/mnt/familine/private/welcomed.json"), true);

$_WELCOMED[] = $_USER;
file_put_contents("/mnt/familine/private/welcomed.json", json_encode($_WELCOMED));

if (!isset($_GET['r'])) { $_GET['r'] = "/"; }
header("Location: " . $_GET['r']);
die();