-1 && $_GET['s'] < 6) { $step = (int)$_GET['s']; } else { header("Location: ?s=0"); die(); } switch ($_GET['s']) { case "0": $title = "initial"; break; case "1": $title = "initial.1"; break; case "2": $title = "initial.2"; break; case "3": $title = "initial.3"; break; case "4": $title = "initial.4"; break; default: break; } if ($step >= 3) { if (!isset($_GET['s2-display']) || !is_string($_GET['s2-display']) || trim($_GET['s2-display']) === "") header("Location: ?s=2") and die; if (!isset($_GET['s2-username']) || !is_string($_GET['s2-username']) || trim($_GET['s2-username']) === "") header("Location: ?s=2") and die; if (!isset($_GET['s2-plural']) || trim($_GET['s2-plural']) === "" || !is_numeric($_GET['s2-plural'])) header("Location: ?s=2") and die; $display = substr(str_replace("\"", "''", strip_tags($_GET['s2-display'])), 0, 30); $username = preg_replace("/\.+/mi", ".", preg_replace("/[^a-z\d]+/mi", ".", substr(str_replace("\"", "''", strip_tags($_GET['s2-username'])), 0, 30))); $plural = (int)$_GET['s2-plural']; if ($username === ".") header("Location: ?s=2") and die; if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/" . $username) || $username === "system" || $username === "users.json" || str_contains($username, "multisocial")) header("Location: ?s=2&s2-display=" . urlencode($display) . "&s2-username=" . urlencode($username) . "&s3-taken" . ($plural === 1 ? "&s2-plural=1" : "")) and die; if ($plural === 0 && $step === 3) { header("Location: ?s=4&s2-display=" . urlencode($display) . "&s2-username=" . urlencode($username) . "&s2-plural=0&s3-members[0]=&s3-pluralkit=&s2-plural=0") and die; } if ($step >= 4) { if (!isset($_GET['s3-members']) || !is_array($_GET['s3-members'])) header("Location: ?s=3&s2-display=" . urlencode($display) . "&s2-username=" . urlencode($username) . ($plural === 1 ? "&s2-plural=1" : "")) and die; if (!isset($_GET['s3-pluralkit']) || !is_string($_GET['s3-pluralkit'])) header("Location: ?s=3&s2-display=" . urlencode($display) . "&s2-username=" . urlencode($username) . ($plural === 1 ? "&s2-plural=1" : "")) and die; if ($plural === 1) { if (trim($_GET['s3-members'][0]) === "" && strlen(trim($_GET['s3-pluralkit'])) !== 5 && strlen(trim($_GET['s3-pluralkit'])) !== 18) header("Location: ?s=3&s2-display=" . urlencode($display) . "&s2-username=" . urlencode($username) . "&s2-plural=1") and die; } } if ($step === 5) { if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/" . $username)) mkdir($_SERVER['DOCUMENT_ROOT'] . "/data/" . $username); if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/" . $username . "/posts")) mkdir($_SERVER['DOCUMENT_ROOT'] . "/data/" . $username . "/posts"); if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/" . $username . "/settings")) mkdir($_SERVER['DOCUMENT_ROOT'] . "/data/" . $username . "/settings"); $members = []; foreach ($_GET['s3-members'] as $member) { $members[] = [ 'fronting' => false, 'name' => substr(str_replace("\"", "''", strip_tags($member)), 0, 30), 'picture' => null, 'proxy' => [] ]; } if (trim($_GET['s3-pluralkit']) !== "") { $system = json_decode(file_get_contents("https://api.pluralkit.me/v2/systems/" . $_GET['s3-pluralkit']), true); $sysmembers = json_decode(file_get_contents("https://api.pluralkit.me/v2/systems/" . $_GET['s3-pluralkit'] . "/members"), true); $sysfronters = json_decode(file_get_contents("https://api.pluralkit.me/v2/systems/" . $_GET['s3-pluralkit'] . "/fronters"), true); $fronters = []; foreach ($sysfronters['members'] as $fronter) { $fronters[] = $fronter['id']; } $members = []; foreach ($sysmembers as $member) { $members[] = [ 'fronting' => in_array($member['id'], $fronters), 'name' => substr(str_replace("\"", "''", strip_tags($member["display_name"] ?? $member["name"])), 0, 30), 'picture' => $member["avatar_url"], 'proxy' => $member["proxy_tags"] ]; } } file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/data/" . $username . "/settings/plurality.json", json_encode([ "plural" => $plural === 1, "picture" => trim($_GET['s3-pluralkit']) !== "" ? ($system['avatar_url'] ?? null) : null, "displayname" => trim($_GET['s3-pluralkit']) !== "" ? ($system['name'] ?? $display) : $display, "pluralkit" => trim($_GET['s3-pluralkit']) !== "" ? $_GET['s3-pluralkit'] : null, "members" => count($members) > 0 ? $members : null ])); $users = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/users.json"), true); $users[$_PROFILE['id']] = $username; file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/data/users.json", json_encode($users)); header("Location: /") and die(); } } require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/gui/header.initial.php"; global $lang; global $_PROFILE; global $Parsedown; ?>
= $lang["intro"]["s0"]["step"] ?>
= $lang["intro"]["s0"]["start"] ?>
= $lang["intro"]["s0"]["disclaimer"] ?>
= $lang["intro"]["s1"]["step"] ?>
= $lang["intro"]["s1"]["start"] ?>
= $lang["intro"]["s1"]["disclaimer"] ?>
= $lang["intro"]["s2"]["step"] ?>
= $lang["intro"]["s2"]["plural1"] ?> = $lang["intro"]["s2"]["plural2"] ?>
= $lang["intro"]["s2"]["plural3"] ?>
= str_replace("%1", $_PROFILE['profile']['email']['email'], $lang["intro"]["s2"]["disclaimer"]) ?>
= $lang["intro"]["s3"]["step"] ?>
= str_replace("%1", '' . $lang['intro']['s3']['back-action'] . '', $lang['intro']['s3']['back']) ?>
= $lang["intro"]["s4"]["step"] ?>
$member) { $sys .= "&s3-members[$id]=$member"; } ?> = $lang["intro"]["s4"]["start"] ?>
= $lang["intro"]["s4"]["disclaimer"] ?>