Files
cwsvJudo/homepage/participo/api.user.add.php
2025-12-07 20:40:33 +01:00

25 lines
870 B
PHP

<?php
/** @var array $CONFIG basic configurations (defined via bootstraping) */
/** @var array $SECRETS passwords and other stuff worth of protection (defined via bootstraping) */
require_once "bootstrap.php";
require_once "participoLib/dbConnector.php";
require_once "participoLib/participo.php";
require_once "participoLib/user.php";
participo::init(config: $CONFIG["cwsvJudo"], secrets: $SECRETS["cwsvJudo"]);
$loginName = $_POST["loginName"] ?? null;
$name = $_POST["name"] ?? null;
$firstName = $_POST["firstName"] ?? null;
$dateOfBirth = $_POST["dateOfBirth"] ?? null;
$eMail = $_POST["eMail"] ?? "";
$returnToUrl = $_POST["returnToUrl"] ?? "participo/";
$newUser = new User(null, $loginName, $name, $firstName, $dateOfBirth, $eMail);
$newUserId = $newUser->addToDb();
header("Location: " . urldecode($returnToUrl), true, 301);
exit(-1); // shouldn't matter