100 || $lastName === '' || strlen($lastName) > 100) { $error = 'Bitte geben Sie Vor- und Nachnamen ein.'; } elseif ($streetAddress === '' || strlen($streetAddress) > 180 || $postalCode === '' || strlen($postalCode) > 20 || $city === '' || strlen($city) > 100 || $countryCode !== 'AT') { $error = 'Bitte geben Sie eine vollständige österreichische Adresse ein.'; } elseif ((string)($_POST['consent_terms'] ?? '') !== '1' || (string)($_POST['consent_privacy'] ?? '') !== '1' || (string)($_POST['consent_withdrawal'] ?? '') !== '1') { $error = 'Bitte bestätigen Sie die drei verlinkten Rechtstexte.'; } elseif (strlen($password) < 12) { $error = 'Das Passwort muss mindestens 12 Zeichen lang sein.'; } elseif (!hash_equals($password, $passwordConfirmation)) { $error = 'Die Passwörter stimmen nicht überein.'; } else { try { $db = pnpaas_db(); $db->beginTransaction(); $db->exec('DELETE FROM account_activation_tokens WHERE expires_at < NOW() OR used_at IS NOT NULL'); $insertUser = $db->prepare( 'INSERT INTO users (username, email, first_name, last_name, street_address, postal_code, city, country_code, password_hash, role, status) VALUES (:username, :email, :first_name, :last_name, :street_address, :postal_code, :city, :country_code, :password_hash, "user", "pending")' ); $insertUser->execute([ 'username' => $username, 'email' => $email, 'first_name' => $firstName, 'last_name' => $lastName, 'street_address' => $streetAddress, 'postal_code' => $postalCode, 'city' => $city, 'country_code' => $countryCode, 'password_hash' => password_hash($password, PASSWORD_DEFAULT), ]); $userId = (int)$db->lastInsertId(); $insertConsent = $db->prepare( 'INSERT INTO user_consents (user_id, consent_type, document_url, document_version, consented_at, consent_ip) VALUES (:user_id, :consent_type, :document_url, :document_version, NOW(), :consent_ip)' ); foreach ($documents as $consentType => $document) { $insertConsent->execute([ 'user_id' => $userId, 'consent_type' => $consentType, 'document_url' => $document['url'], 'document_version' => $document['version'] !== '' ? $document['version'] : null, 'consent_ip' => $_SERVER['REMOTE_ADDR'] ?? null, ]); } $token = bin2hex(random_bytes(32)); $insertToken = $db->prepare( 'INSERT INTO account_activation_tokens (user_id, token_hash, expires_at, requested_ip) VALUES (:user_id, :token_hash, DATE_ADD(NOW(), INTERVAL 24 HOUR), :requested_ip)' ); $insertToken->execute([ 'user_id' => $userId, 'token_hash' => hash('sha256', $token), 'requested_ip' => $_SERVER['REMOTE_ADDR'] ?? null, ]); $db->commit(); if (!pnpaas_send_account_activation($email, $token)) { error_log('PnPaaS account activation mail could not be sent.'); $error = 'Das Konto wurde angelegt, aber die Aktivierungs-E-Mail konnte nicht versendet werden. Bitte wenden Sie sich an den Administrator.'; } else { $success = 'Die Registrierung war erfolgreich. Bitte prüfen Sie Ihr E-Mail-Postfach und aktivieren Sie Ihr Konto über den zugesendeten Link.'; } } catch (PDOException $exception) { if (isset($db) && $db->inTransaction()) $db->rollBack(); if ($exception->getCode() === '23000') { $error = 'Benutzername oder E-Mail-Adresse wird bereits verwendet.'; } else { error_log('PnPaaS registration database error: ' . $exception->getMessage()); $error = 'Die Registrierung ist derzeit nicht möglich. Bitte versuchen Sie es später erneut.'; } } catch (Throwable $exception) { if (isset($db) && $db->inTransaction()) $db->rollBack(); error_log('PnPaaS registration error: ' . $exception->getMessage()); $error = 'Die Registrierung ist derzeit nicht möglich. Bitte versuchen Sie es später erneut.'; } } } ?> PnPaaS – Registrieren

PnPaaS

Konto erstellen

Registrieren Sie sich. Anschließend erhalten Sie eine E-Mail zur Aktivierung Ihres Kontos.

Die Registrierung wird freigeschaltet, sobald die drei externen Rechtstexte hinterlegt sind.
style="border:0; padding:0; margin:0; display:grid; gap:.65rem;"> $document): ?>