Updated 17 files and added 4 files (automated)

mane
Mia Raindrops 1 week ago
parent 0742405f6e
commit 4dd73faa40
Signed by: Mia Raindrops
GPG Key ID: EFBDC68435A574B7

@ -57,7 +57,7 @@ if (!isset($id)):
<div>
<?php if (isset($data["contents"]) && trim($data["contents"] !== "")): ?>
<div>
<?= $data["contents"] ?>
<?= doLinking($data["contents"]) ?>
</div>
<small class="print-ignore text-muted"><?= isset($data["update_user"]) ? str_replace("%2", "<a class='update-user' href='/profile/" . $data["update_user"] . "'>" . resolveUser($data["update_user"]) . "</a>", str_replace("%1", timeAgo($data["update"]), l("lang_time_update_user"))) : str_replace("%1", timeAgo($data["update"]), l("lang_time_update")) ?></small>
<?php else: ?>

@ -141,7 +141,7 @@ if (!isset($_PROFILE["requests"][$id])):
<?= l("lang_edit_alert_contents") ?>
</div>
<?= $request["contents"] ?>
<?= doLinking($request["contents"]) ?>
<br><br>
</div>

@ -58,7 +58,7 @@ if (!isset($id)):
<?php if (isset($data["images"]) && count($data["images"]) > 0): ?>
<?php if (isset($data["contents"]) && trim($data["contents"] !== "")): ?>
<div>
<?= $data["contents"] ?>
<?= doLinking($data["contents"]) ?>
</div>
<small class="print-ignore text-muted"><?= isset($data["update_user"]) ? str_replace("%2", "<a class='update-user' href='/profile/" . $data["update_user"] . "'>" . resolveUser($data["update_user"]) . "</a>", str_replace("%1", timeAgo($data["update"]), l("lang_time_update_user"))) : str_replace("%1", timeAgo($data["update"]), l("lang_time_update")) ?></small>
<?php endif; ?>

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/></g><g><path d="M12,2C6.48,2,2,6.48,2,12s4.48,10,10,10s10-4.48,10-10S17.52,2,12,2z M12.88,17.76V19h-1.75v-1.29 c-0.74-0.18-2.39-0.77-3.02-2.96l1.65-0.67c0.06,0.22,0.58,2.09,2.4,2.09c0.93,0,1.98-0.48,1.98-1.61c0-0.96-0.7-1.46-2.28-2.03 c-1.1-0.39-3.35-1.03-3.35-3.31c0-0.1,0.01-2.4,2.62-2.96V5h1.75v1.24c1.84,0.32,2.51,1.79,2.66,2.23l-1.58,0.67 c-0.11-0.35-0.59-1.34-1.9-1.34c-0.7,0-1.81,0.37-1.81,1.39c0,0.95,0.86,1.31,2.64,1.9c2.4,0.83,3.01,2.05,3.01,3.45 C15.9,17.17,13.4,17.67,12.88,17.76z"/></g></svg>

After

Width:  |  Height:  |  Size: 686 B

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M23.05 37.45h1.8v-2.4q2.35-.1 4.3-1.475Q31.1 32.2 31.1 29.35q0-2.3-1.35-3.725Q28.4 24.2 24.8 22.85q-3.35-1.25-4.325-2.125-.975-.875-.975-2.525 0-1.55 1.275-2.65 1.275-1.1 3.325-1.1 1.55 0 2.6.675t1.8 1.825l1.55-.65q-.85-1.5-2.175-2.4-1.325-.9-2.925-1v-2.35h-1.8v2.35q-2.65.4-4.025 1.9-1.375 1.5-1.375 3.4 0 2.25 1.4 3.575 1.4 1.325 4.7 2.525 3.3 1.3 4.425 2.3 1.125 1 1.125 2.75 0 2.15-1.6 3.125-1.6.975-3.5.975-1.8 0-3.275-1.025Q19.55 31.4 18.7 29.55l-1.6.65q.95 2.05 2.45 3.15 1.5 1.1 3.5 1.55ZM24 42.2q-3.8 0-7.075-1.45-3.275-1.45-5.75-3.925Q8.7 34.35 7.25 31.05 5.8 27.75 5.8 24t1.45-7.075q1.45-3.325 3.925-5.8 2.475-2.475 5.775-3.9Q20.25 5.8 24 5.8t7.075 1.425q3.325 1.425 5.8 3.9 2.475 2.475 3.9 5.8Q42.2 20.25 42.2 24.05q0 3.75-1.425 7.025-1.425 3.275-3.9 5.75-2.475 2.475-5.8 3.925Q27.75 42.2 24 42.2Zm0-1.75q6.85 0 11.65-4.8 4.8-4.8 4.8-11.65 0-6.85-4.8-11.65-4.8-4.8-11.65-4.8-6.85 0-11.65 4.8-4.8 4.8-4.8 11.65 0 6.85 4.8 11.65 4.8 4.8 11.65 4.8ZM24 24Z" fill="#000000"/></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 96 960 960" width="48"><path d="M100 753v-35h321v35H100Zm0-320v-35h321v35H100Zm474 433-24-24 106-106-106-106 24-24 106 106 106-106 24 24-106 106 106 106-24 24-106-106-106 106Zm88-362L550 392l24-24 87 87 172-172 24 25-195 196Z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 96 960 960" width="48"><path d="M100 753v-35h321v35H100Zm0-320v-35h321v35H100Zm474 433-24-24 106-106-106-106 24-24 106 106 106-106 24 24-106 106 106 106-24 24-106-106-106 106Zm88-362L550 392l24-24 87 87 172-172 24 25-195 196Z" fill="#000000"/></svg>

Before

Width:  |  Height:  |  Size: 297 B

After

Width:  |  Height:  |  Size: 312 B

@ -57,7 +57,7 @@ if (!isset($id)):
<div>
<?php if (isset($data["contents"]) && trim($data["contents"] !== "")): ?>
<div>
<?= $data["contents"] ?>
<?= doLinking($data["contents"]) ?>
</div>
<small class="print-ignore text-muted"><?= isset($data["update_user"]) ? str_replace("%2", "<a class='update-user' href='/profile/" . $data["update_user"] . "'>" . resolveUser($data["update_user"]) . "</a>", str_replace("%1", timeAgo($data["update"]), l("lang_time_update_user"))) : str_replace("%1", timeAgo($data["update"]), l("lang_time_update")) ?></small>
<?php else: ?>

@ -72,5 +72,5 @@ if (($request["type"] === "gallerymeta" || $request["type"] === "article" || $re
rename($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/" . $id . ".json", $_SERVER['DOCUMENT_ROOT'] . "/includes/data/archive/" . $id . ".json");
header("Location: /admin");
header("Location: /admin/requests");
die();

@ -47,5 +47,5 @@ if ($request["type"] === "galleryupload" && file_exists($_SERVER['DOCUMENT_ROOT'
rename($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/" . $id . ".json", $_SERVER['DOCUMENT_ROOT'] . "/includes/data/archive/" . $id . ".json");
header("Location: /admin");
header("Location: /admin/requests");
die();

@ -1,4 +1,22 @@
[
{
"date": "2023-03-12 11:32",
"title": {
"en": "There's new stuff on Delta!",
"fr": "Il y a du nouveau sur Delta !"
},
"message": {
"en": "Hi there! We just released Delta EAP 4.0, which fixes numerous bugs while adding new ways to login to Delta (using an Equestria.horse account), a button to send an account application, technical support pricing (on the support page) and smart page linking.",
"fr": "Vous revoilà ! Nous venons de sortir Delta EAP 4.0, qui corrige de nombreux bugs tout en ajoutant de nouvelles façons de se connecter à Delta (en utilisant un compte Equestria.horse), un bouton pour envoyer une demande de création de compte, les tarifs du support technique (sur la page d'aide) et une création de liens intelligente."
},
"version": "5.0.0-eap4.0",
"affects": {
"public": true,
"free": true,
"plus": true,
"ultra": true
}
},
{
"date": "2023-02-23 08:19",
"title": {
@ -7,7 +25,7 @@
},
"message": {
"en": "Hey! Previously, uploading images to a Delta page was a very tedious process, and was poorly optimised. We entirely reworked that part and now you can add as many images as you want to a page. The way you import images stays unchanged. Furthermore, images are optimised to take up less disk space and bandwidth, meaning an improved experience. Images that are already on pages will need to be uploaded again.",
"fr": "Bonjour ! Précédemment, importer des images sur une page Delta était un processus complex, et qui était très mal optimisé. Nous avons entièrement repensé cette partie et vous pouvez maintenant ajouter autant d'images que vous voulez sur une page. La façon dont vous importez des images reste inchangée. De plus, les images sont optimisées de façon à utiliser moins d'espace disque et de bande passante, ce qui signifie une expérience améliorée. Les images qui sont déjà sur les pages devront être importées de nouveau."
"fr": "Bonjour ! Précédemment, importer des images sur une page Delta était un processus complexe, et qui était très mal optimisé. Nous avons entièrement repensé cette partie et vous pouvez maintenant ajouter autant d'images que vous voulez sur une page. La façon dont vous importez des images reste inchangée. De plus, les images sont optimisées de façon à utiliser moins d'espace disque et de bande passante, ce qui signifie une expérience améliorée. Les images qui sont déjà sur les pages devront être importées de nouveau."
},
"version": "5.0.0-eap3.0",
"affects": {

@ -3,7 +3,6 @@
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/maintenance")) die();
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/lang.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/linking.php";
function pf_utf8_decode(string $string): string {
return iconv("UTF-8", "ISO-8859-1", $string);
@ -382,6 +381,8 @@ function formatDate($date, $withYear = true) {
}
function getNameFromId($id) {
if (preg_replace("/^[\da-f]{8}(-[\da-f]{4}){3}-[\da-f]{12}$/m", "OK", $id) !== "OK") return $id;
if (file_exists($_SERVER["DOCUMENT_ROOT"] . "/includes/data/people/" . $id . ".json")) {
return json_decode(pf_utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/people/" . $id . ".json")), true)["first_name"] . " " . json_decode(pf_utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/people/" . $id . ".json")), true)["last_name"];
} elseif (file_exists($_SERVER["DOCUMENT_ROOT"] . "/includes/data/gallery/" . $id . ".json")) {
@ -445,4 +446,6 @@ function getTypeFromId($id) {
function isJson($string): bool {
json_decode($string);
return (json_last_error() === JSON_ERROR_NONE);
}
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/linking.php";

@ -1,9 +1,51 @@
<?php
$list = [];
function doLinking($text) {
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php";
initLang();
$list = [
...array_map(function ($i) {
return [
"link" => "/articles/" . substr($i, 0, -5),
"name" => getNameFromId(substr($i, 0, -5))
];
}, array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/articles"), function ($i) {
return !str_starts_with($i, ".");
})),
...array_map(function ($i) {
return [
"link" => "/people/" . substr($i, 0, -5),
"name" => getNameFromId(substr($i, 0, -5))
];
}, array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/people"), function ($i) {
return !str_starts_with($i, ".");
})),
...array_map(function ($i) {
return [
"link" => "/gallery/" . substr($i, 0, -5),
"name" => getNameFromId(substr($i, 0, -5))
];
}, array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gallery"), function ($i) {
return !str_starts_with($i, ".");
}))
];
usort($list, function ($a, $b) {
return strlen($b["name"]) - strlen($a["name"]);
});
/*header("Content-Type: text/plain");
var_dump($list);
die();*/
if (isset(explode("/", $_SERVER['REQUEST_URI'])[2]) && getNameFromId(explode("/", $_SERVER['REQUEST_URI'])[2]) !== null) {
$current = getNameFromId(explode("/", $_SERVER['REQUEST_URI'])[2]);
} else {
$current = null;
}
foreach ($list as $item) {
if ($item["name"] !== $current) {
$text = str_ireplace($item["name"], '<a href="' . $item["link"] . '">' . $item["name"] . "</a>", $text);
}
}
return $text;
}

@ -21,7 +21,7 @@ if (isset($_COOKIE["DeltaSession"])) {
if ($_PROFILE["blocked"] >= 3 && $_SERVER['REQUEST_URI'] !== "/login/blocked/") {
if (!isset($api)) {
header("Location: /login/blocked");
header("Location: /login/blocked/?return=" . rawurlencode($_SERVER['REQUEST_URI']));
} else {
$data["blocked"] = true;
}
@ -31,19 +31,19 @@ if (isset($_COOKIE["DeltaSession"])) {
if (!isset($api)) die();
}
} else {
if (!isset($api)) header("Location: /login");
if (!isset($api)) header("Location: /login/?return=" . rawurlencode($_SERVER['REQUEST_URI']));
if (!isset($api)) die();
}
} else {
if (!isset($api)) header("Location: /login");
if (!isset($api)) header("Location: /login/?return=" . rawurlencode($_SERVER['REQUEST_URI']));
if (!isset($api)) die();
}
} else {
if (!isset($api)) header("Location: /login");
if (!isset($api)) header("Location: /login/?return=" . rawurlencode($_SERVER['REQUEST_URI']));
if (!isset($api)) die();
}
} else {
if (!isset($api)) header("Location: /login");
if (!isset($api)) header("Location: /login/?return=" . rawurlencode($_SERVER['REQUEST_URI']));
if (!isset($api)) die();
}

@ -37,6 +37,10 @@ function showPage($item) { ?>
</div>
<?php endif; ?>
<div class="alert alert-secondary">
<b>Vous utilisez une version expérimentale de Delta.</b> Attendez-vous à rencontrer des bugs et autres problèmes importants. Dans tous les cas, vous pouvez <a href="/support">contacter le support technique</a> pour les signaler.
</div>
<?php
$birthdays = array_values(array_filter(array_map(function ($i) {

@ -16,7 +16,15 @@
"start": "Get started",
"email2": "Just one detail.",
"code3": "Confirm it's really you.",
"finish": "Complete"
"finish": "Complete",
"auth": {
"email": "Continue with your email address",
"hub": "Continue with an Equestria.horse account",
"apply": "Send an account creation application"
},
"oauth2": {
"notfound": "The email address from your Equestria.horse account (%1) is not registered on Delta"
}
},
"home": {
"title": "Dashboard",
@ -904,5 +912,81 @@
"In the event of a technical failure, the developers will try to keep user data safe. However, there is no guarantee this will always be the case."
]
]
},
"pricing": {
"title": "Technical support pricing",
"delta": {
"title": "Notice:",
"message": "Technical support for Delta is always free regardless of your current subscription plan. Simply select options %1on the support page%2 to get help with Delta from an administrator."
},
"ultra": "You are a Delta Ultra user, meaning you don't have to pay for technical support as long as all the support requests from the current month do not exceed the cost of your subscription (€%1).",
"base": "Base offers",
"descriptions": {
"base": "This is the price you are required to pay to get technical support. It depends on how the issue is dealt with and how much time the technician spends on your issue. Price per minute does not include time the technician doesn't work on your issue.",
"additional": "These are complementary items you can add to your support request, that require special intervention from a technician, and therefore, are not included in base offers. Price can vary depending on the complexity of the issue."
},
"offers": [
{
"title": "On-site hardware support",
"description": "Helping you with a device's hardware, such as replacing it or fixing it.",
"pricing": "5 min free, then €0.15/min"
},
{
"title": "On-site software support",
"description": "Helping you physically with your issue, useful when a device is unable to be remotely controlled.",
"pricing": "10 min free, then €0.10/min"
},
{
"title": "Off-site support with remote control",
"description": "Helping you by remotely controlling your device, when a problem can easily be fixed that way.",
"pricing": "10 min free, then €0.05/min"
},
{
"title": "Off-site support over telephone",
"description": "Helping you by giving instructions over the phone, when the issue is very easy to fix.",
"pricing": "10 min free, then €0.02/min"
},
{
"title": "Industry-standard check",
"description": "Checking your device using recognised long checks, useful before selling your device.",
"pricing": "€0.25/check"
},
{
"title": "Basic routine check",
"description": "Checking your device using short routine checks, useful to make sure your device is working.",
"pricing": "€0.10/check"
},
{
"title": "Deep hardware cleaning",
"description": "Cleaning your device's internals to remove dust and other dirt that can affect performance.",
"pricing": "€0.20/cleaning"
},
{
"title": "Operating system reinstall",
"description": "Completely reinstalling an operating system on your device, in the list of supported operating systems.",
"pricing": "€0.30/reinstall"
},
{
"title": "Operating system upgrade",
"description": "Upgrade the operating system of your device to a new version, in the list of supported operating systems, assuming it is supported by your device.",
"pricing": "€0.25/upgrade"
},
{
"title": "Malicious software removal",
"description": "Removing malicious software (“virus“) is often tricky, so a technician can remove it and make sure it has no chance of coming back.",
"pricing": "€0.15/software"
},
{
"title": "Tech support for older hardware",
"description": "Old hardware (over 15 years old) can be tricky to deal with, and therefore costs more. This is also to encourage users into using newer hardware.",
"pricing": "€0.50"
},
{
"title": "Voluntarily faulty hardware penalty",
"description": "If you ask the technicians to fix hardware you broke on purpose, you will be charged an extra amount of money for the wasted time.",
"pricing": "€1.00"
}
],
"additional": "Complementary offers"
}
}

@ -16,7 +16,15 @@
"start": "Commencer",
"email2": "Juste un détail.",
"code3": "Confirmez que c'est bien vous.",
"finish": "Terminer"
"finish": "Terminer",
"auth": {
"email": "Continuer avec votre adresse courriel",
"hub": "Continuer avec un compte Equestria.horse",
"apply": "Envoyer une demande de compte"
},
"oauth2": {
"notfound": "L'adresse courriel de votre compte Equestria.horse (%1) n'est pas valide sur Delta"
}
},
"home": {
"title": "Tableau de bord",
@ -904,5 +912,81 @@
"Dans l'éventualité d'un dommage technique, les développeurs tenteront d'assurer la sécurité des données utilisateur. Cependant, il n'y a aucune garantie sur le fait que cela soit toujours le cas."
]
]
},
"pricing": {
"title": "Tarifs du support technique",
"delta": {
"title": "Note :",
"message": "Le support technique pour Delta est toujours gratuit indépendamment de votre abonnement actuel. Sélectionnez simplement les options sur %1la page de support%2 pour obtenir de l'aide avec Delta d'un·e administrateur·ice."
},
"ultra": "Vous êtes un·e abonné·e Delta Ultra, ce qui signifie que vous n'avez pas à payer de support technique tant que toutes les demandes de support du mois courant ne dépassent pas le coût de votre abonnement (%1€).",
"base": "Offres de base",
"descriptions": {
"base": "Il s'agit du prix que vous devez payer pour obtenir du support technique. Il dépend de la façon dont votre problème est traité et du temps que le/la technicien·ne passe sur votre problème. Le prix à la minute n'inclut pas le temps durant lequel le/la technicien·ne ne travaille pas sur votre problème.",
"additional": "Ces éléments supplémentaires, qui peuvent s'ajouter à votre demande de support, sont des éléments qui demandent une intervention particulière d'un·e technicien·ne et, de ce fait, ne sont pas inclus dans les offres de base. Le prix peut varier selon la complexité du problème."
},
"offers": [
{
"title": "Support technique matériel sur site",
"description": "Pour vous aider avec le matériel d'un appareil, tel que le remplacer ou le réparer.",
"pricing": "5 min gratuites, puis 0.15€/min"
},
{
"title": "Support technique logiciel sur site",
"description": "Pour vous aider physiquement avec votre problème, utile lorsqu'un appareil ne peut pas être contrôlé à distance.",
"pricing": "10 min gratuites, puis 0.10€/min"
},
{
"title": "Support technique hors-site avec contrôle à distance",
"description": "Pour vous aider en contrôlant à distance votre appareil, lorsqu'un problème peut facilement être résolu de cette façon.",
"pricing": "10 min gratuites, puis 0.05€/min"
},
{
"title": "Support technique hors-site par téléphone",
"description": "Pour vous aider en vous donnant des instructions par téléphone, lorsque votre problème est très facile à résoudre.",
"pricing": "10 min gratuites, puis 0.02€/min"
},
{
"title": "Vérification aux standards industriels",
"description": "Vérification de votre appareil avec des test longs reconnus, utile avant de vendre votre appareil.",
"pricing": "0.25€/vérif."
},
{
"title": "Vérification de routine basique",
"description": "Vérification de votre appareil avec des tests de routine courts, utile pour s'assurer du bon fonctionnement de l'appareil.",
"pricing": "0.10€/vérif."
},
{
"title": "Nettoyage profond du matériel",
"description": "Nettoyage de l'intérieur de votre appareil pour retirer la poussière et les autres impuretés qui peuvent affecter les performances.",
"pricing": "0.20€/nettoyage"
},
{
"title": "Réinstallation du système d'exploitation",
"description": "Réinstaller complètement un système d'exploitation sur votre appareil, dans la liste des systèmes supportés.",
"pricing": "0.30€/réinstall."
},
{
"title": "Mise à jour du système d'exploitation",
"description": "Mettre à jour le système d'exploitation de votre appareil vers une nouvelle version, dans la liste des systèmes supportés, uniquement si supporté par votre appareil.",
"pricing": "0.25€/MàJ"
},
{
"title": "Retrait de programme malveillant",
"description": "Retirer les programmes malveillants (« virus ») est souvent difficile, alors un technicien pour les retirer et s'assurer qu'ils ne peuvent pas revenir.",
"pricing": "0.15€/programme"
},
{
"title": "Support technique pour matériel ancien",
"description": "Le matériel ancien (plus de 15 ans) peut-être difficile à traité, et donc coûte plus. Ceci est aussi pour encourager les utilisateurs à utiliser du matériel plus récent.",
"pricing": "0.50€"
},
{
"title": "Pénalité de matériel volontairement défectueux",
"description": "Si vous demandez aux technicien·ne·s de réparer du matériel que vous avez cassé volontairement, vous serez facturés un montant supplémentaire pour le temps perdu.",
"pricing": "1.00€"
}
],
"additional": "Offres supplémentaires"
}
}

@ -4,10 +4,10 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/email.php";
$error = "";
$step = -1;
$step = 0;
if (isset($_POST["oobe"])) {
$step = 0;
if (isset($_GET["failed_oauth2_notfound"])) {
$error = "lang_login_oauth2_notfound";
}
function encode($string) {
@ -15,6 +15,7 @@ function encode($string) {
}
$users = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/users.json")), true);
$app = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/email.json")), true);
if (isset($_POST["p"]) && $_POST["p"] === "1") {
if (!in_array($_POST["email"], array_keys($users))) {
@ -66,6 +67,19 @@ if (isset($_POST["p"]) && $_POST["p"] === "1") {
}
}
if (!isset($_GET["return"])) {
$_GET["return"] = "/";
}
if ($step === 0 && $_GET["method"] === "hub") {
setcookie("DeltaReturnPage", $_GET["return"], 0, "/");
header("Location: https://auth.equestria.horse/hub/api/rest/oauth2/auth?client_id=" . $app["oauth2_id"] . "&response_type=code&redirect_uri=https://" . ($_SERVER["HTTP_HOST"] === "192.168.1.121:81" ? "delta-staging" : "delta") . ".equestria.dev/login/oauth&scope=Hub&request_credentials=default&access_type=offline");
die();
} else if ($step === 0 && $_GET["method"] === "apply") {
header("Location: https://docs.google.com/forms/d/e/1FAIpQLScCrxLNSfoutlRw8-F5DFMMgWDleoJCEM0QU4rNZt0uy5HOcw/viewform");
die();
}
$title = "lang_login_title"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/header.php";
?>
@ -79,20 +93,20 @@ $title = "lang_login_title"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes
<div style="background-color: var(--bs-white); padding: 20px; border-radius: 20px; text-align: center; width: 70vw; max-height: 80vh; overflow: auto;">
<?php endif; ?>
<?php if ($step < 2): ?>
<?php if ($step === -1): ?>
<?php if (!isset($_GET["method"])): ?>
<img src="/logo.svg" style="width: 48px; margin-bottom: 10px;">
<p><b><?= l("lang_login_oobe") ?></b></p>
<p><?= l("lang_login_oobe2") ?></p>
<?php if (trim($error) !== ""): ?>
<div class="alert alert-danger"><?= l($error) ?></div>
<div class="alert alert-danger"><?= str_replace("%1", strip_tags($_GET["v"] ?? "-"), l($error)) ?></div>
<?php endif; ?>
<form method="post">
<input type="hidden" name="oobe" value="1">
<input type="submit" class="btn btn-primary" value="<?= l("lang_login_start") ?>">
</form>
<div class="list-group" style="max-width: 400px; margin-left: auto; margin-right: auto;">
<a class="list-group-item list-group-item-action list-group-item-primary" href="/login/?method=email&return=<?= rawurlencode($_GET["return"]) ?>"><?= l("lang_login_auth_email") ?></a>
<a class="list-group-item list-group-item-action" href="/login/?method=hub&return=<?= rawurlencode($_GET["return"]) ?>"><?= l("lang_login_auth_hub") ?></a>
<a class="list-group-item list-group-item-action" href="/login/?method=apply&return=<?= rawurlencode($_GET["return"]) ?>"><?= l("lang_login_auth_apply") ?></a>
</div>
<?php elseif ($step === 0): ?>
<img src="/icons/email.svg" style="width: 48px; margin-bottom: 10px;">
<p><b><?= l("lang_login_email2") ?></b></p>
@ -139,7 +153,7 @@ $title = "lang_login_title"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes
<img src="/icons/finish.svg" style="width: 48px; margin-bottom: 10px;">
<p><b><?= str_replace('%1', $user["nick_name"] ?? $user["first_name"] . " " . $user["last_name"], l("lang_login_back")) ?></b></p>
<p><?= l("lang_login_done") ?></p>
<a href="/" class="btn btn-primary"><?= l("lang_login_finish") ?></a>
<a href="<?= str_replace('"', '&quot;', $_GET["return"]) ?>" class="btn btn-primary"><?= l("lang_login_finish") ?></a>
<?php endif; ?>
</div>
</div>

@ -0,0 +1,71 @@
<?php
$server = "auth.equestria.horse";
header("Content-Type: text/plain");
if (!isset($_GET['code'])) {
die();
}
function encode($string) {
return preg_replace("/[^a-zA-Z0-9.]/m", "", base64_encode($string));
}
$appdata = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/email.json"), true);
$users = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/users.json"), true);
$crl = curl_init('https://' . $server . '/hub/api/rest/oauth2/token');
curl_setopt($crl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($crl, CURLINFO_HEADER_OUT, true);
curl_setopt($crl, CURLOPT_POST, true);
curl_setopt($crl, CURLOPT_HTTPHEADER, [
"Authorization: Basic " . base64_encode($appdata["oauth2_id"] . ":" . $appdata["oauth2_secret"]),
"Content-Type: application/x-www-form-urlencoded",
"Accept: application/json"
]);
curl_setopt($crl, CURLOPT_POSTFIELDS, "grant_type=authorization_code&redirect_uri=" . urlencode("https://" . ($_SERVER["HTTP_HOST"] === "192.168.1.121:81" ? "delta-staging" : "delta") . ".equestria.dev/login/oauth") . "&code=" . $_GET['code']);
$result = curl_exec($crl);
$result = json_decode($result, true);
curl_close($crl);
if (isset($result["access_token"])) {
$crl = curl_init('https://' . $server . '/hub/api/rest/users/me');
curl_setopt($crl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($crl, CURLINFO_HEADER_OUT, true);
curl_setopt($crl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer " . $result["access_token"],
"Accept: application/json"
]);
$result = curl_exec($crl);
$result = json_decode($result, true);
$result["email"] = isset($result["profile"]["email"]) && $result["profile"]["email"]["verified"] ? $result["profile"]["email"]["email"] : "-";
if (!in_array($result["email"], array_keys($users))) {
header("Location: /login/?return=" . rawurlencode($_COOKIE["DeltaReturnPage"] ?? "/") . "&failed_oauth2_notfound&v=" . rawurlencode($result["email"]));
die();
}
if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens")) mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens");
$token = encode(openssl_random_pseudo_bytes(128));
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token, json_encode([
"user" => $users[$result["email"]],
"date" => date('c')
]));
setcookie("DeltaSession", $token, time() + (86400 * 90), "/", "", false, true);
if (isset($_COOKIE["DeltaReturnPage"])) {
header("Location: " . str_replace("\n", "", str_replace("\r", "", $_COOKIE["DeltaReturnPage"])));
} else {
header("Location: /");
}
setcookie("DeltaReturnPage", "");
die();
}

@ -125,6 +125,9 @@ $emailSupport = file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/email") && tr
<a href="/support/rules" class="list-group-item list-group-item-action">
<img class="icon" src="/icons/rules.svg"><span style="vertical-align: middle; margin-left: 5px;"><?= l("lang_support_rules") ?></span>
</a>
<a href="/support/pricing" class="list-group-item list-group-item-action">
<img class="icon" src="/icons/pricing.svg"><span style="vertical-align: middle; margin-left: 5px;"><?= l("lang_pricing_title") ?></span>
</a>
</div>
<?php endif; ?>

@ -0,0 +1,102 @@
<?php
$price = (float)trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/plusprice"));
$title = "lang_pricing_title";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/header.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/navigation.php";
global $_PROFILE; global $_USER;
?>
<div class="container">
<br><br>
<h1><?= l("lang_pricing_title") ?></h1>
<div class="alert alert-secondary">
<b><?= l("lang_pricing_delta_title") ?></b> <?= str_replace("%2", "</a>", str_replace("%1", "<a href='/support'>", l("lang_pricing_delta_message"))) ?>
</div>
<?php if ($_PROFILE["ultra"]): ?>
<div class="alert alert-secondary">
<?= str_replace("%1", coinsToEur($price * 2), l("lang_pricing_ultra")) ?>
</div>
<?php endif; ?>
<h2><?= l("lang_pricing_base") ?></h2>
<p><?= l("lang_pricing_descriptions_base") ?></p>
<div style="display: grid; grid-template-columns: 1fr max-content; grid-column-gap: 20px; grid-row-gap: 5px;">
<div>
<span title="<?= l("lang_pricing_offers_0_description") ?>" data-bs-toggle="tooltip" style="cursor: help;"><?= l("lang_pricing_offers_0_title") ?></span>
</div>
<div style="font-weight: bold; text-align: right;"><?= l("lang_pricing_offers_0_pricing") ?></div>
<div>
<span title="<?= l("lang_pricing_offers_1_description") ?>" data-bs-toggle="tooltip" style="cursor: help;"><?= l("lang_pricing_offers_1_title") ?></span>
</div>
<div style="font-weight: bold; text-align: right;"><?= l("lang_pricing_offers_1_pricing") ?></div>
<div>
<span title="<?= l("lang_pricing_offers_2_description") ?>" data-bs-toggle="tooltip" style="cursor: help;"><?= l("lang_pricing_offers_2_title") ?></span>
</div>
<div style="font-weight: bold; text-align: right;"><?= l("lang_pricing_offers_2_pricing") ?></div>
<div>
<span title="<?= l("lang_pricing_offers_3_description") ?>" data-bs-toggle="tooltip" style="cursor: help;"><?= l("lang_pricing_offers_3_title") ?></span>
</div>
<div style="font-weight: bold; text-align: right;"><?= l("lang_pricing_offers_3_pricing") ?></div>
</div>
<h2 style="margin-top: 15px;"><?= l("lang_pricing_additional") ?></h2>
<p><?= l("lang_pricing_descriptions_additional") ?></p>
<div style="display: grid; grid-template-columns: 1fr max-content; grid-column-gap: 20px; grid-row-gap: 5px;">
<div>
<span title="<?= l("lang_pricing_offers_4_description") ?>" data-bs-toggle="tooltip" style="cursor: help;"><?= l("lang_pricing_offers_4_title") ?></span>
</div>
<div style="font-weight: bold; text-align: right;"><?= l("lang_pricing_offers_4_pricing") ?></div>
<div>
<span title="<?= l("lang_pricing_offers_5_description") ?>" data-bs-toggle="tooltip" style="cursor: help;"><?= l("lang_pricing_offers_5_title") ?></span>
</div>
<div style="font-weight: bold; text-align: right;"><?= l("lang_pricing_offers_5_pricing") ?></div>
<div>
<span title="<?= l("lang_pricing_offers_6_description") ?>" data-bs-toggle="tooltip" style="cursor: help;"><?= l("lang_pricing_offers_6_title") ?></span>
</div>
<div style="font-weight: bold; text-align: right;"><?= l("lang_pricing_offers_6_pricing") ?></div>
<div>
<span title="<?= l("lang_pricing_offers_7_description") ?>" data-bs-toggle="tooltip" style="cursor: help;"><?= l("lang_pricing_offers_7_title") ?></span>
</div>
<div style="font-weight: bold; text-align: right;"><?= l("lang_pricing_offers_7_pricing") ?></div>
<div>
<span title="<?= l("lang_pricing_offers_8_description") ?>" data-bs-toggle="tooltip" style="cursor: help;"><?= l("lang_pricing_offers_8_title") ?></span>
</div>
<div style="font-weight: bold; text-align: right;"><?= l("lang_pricing_offers_8_pricing") ?></div>
<div>
<span title="<?= l("lang_pricing_offers_9_description") ?>" data-bs-toggle="tooltip" style="cursor: help;"><?= l("lang_pricing_offers_9_title") ?></span>
</div>
<div style="font-weight: bold; text-align: right;"><?= l("lang_pricing_offers_9_pricing") ?></div>
<div>
<span title="<?= l("lang_pricing_offers_10_description") ?>" data-bs-toggle="tooltip" style="cursor: help;"><?= l("lang_pricing_offers_10_title") ?></span>
</div>
<div style="font-weight: bold; text-align: right;"><?= l("lang_pricing_offers_10_pricing") ?></div>
<div>
<span title="<?= l("lang_pricing_offers_11_description") ?>" data-bs-toggle="tooltip" style="cursor: help;"><?= l("lang_pricing_offers_11_title") ?></span>
</div>
<div style="font-weight: bold; text-align: right;"><?= l("lang_pricing_offers_11_pricing") ?></div>
</div>
<br><br>
</div>
<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/footer.php"; ?>

@ -1 +1 @@
5.0.0-eap3.7
5.0.0-eap4.0
Loading…
Cancel
Save