92 lines
3.3 KiB
PHP
92 lines
3.3 KiB
PHP
<?php
|
|
$scope = trim((string) ($scope ?? old('scope')));
|
|
|
|
if ($scope === '') {
|
|
$scope = trim((string) ($_GET['scope'] ?? ''));
|
|
}
|
|
|
|
$scope = $scope === 'tenant' ? 'tenant' : 'platform';
|
|
|
|
$tenantSlug = trim((string) ($tenantSlug ?? old('tenant_slug')));
|
|
|
|
if ($tenantSlug === '') {
|
|
$tenantSlug = trim((string) ($_GET['tenantSlug'] ?? $_GET['tenant'] ?? ''));
|
|
}
|
|
|
|
$tenantName = trim((string) ($tenantName ?? old('tenant_name')));
|
|
|
|
if ($tenantName === '') {
|
|
$tenantName = trim((string) ($_GET['tenantName'] ?? ''));
|
|
}
|
|
|
|
if ($tenantName === '' && $tenantSlug !== '') {
|
|
$tenantName = 'Kaffeeliste ' . $tenantSlug;
|
|
}
|
|
|
|
if ($tenantName === '') {
|
|
$tenantName = 'Kaffeelisten-Zugang';
|
|
}
|
|
|
|
$loginUrl = $scope === 'tenant'
|
|
? ($tenantSlug !== '' ? tenant_url($tenantSlug, 'login') : url('/'))
|
|
: url('/admin/login');
|
|
$emailLabel = $scope === 'tenant' ? 'E-Mail-Adresse' : 'Admin-E-Mail';
|
|
require __DIR__ . '/../partials/layout-top.php';
|
|
?>
|
|
|
|
<section class="page-head">
|
|
<span class="eyebrow">Passwort vergessen</span>
|
|
<h1>Neues Passwort anfordern</h1>
|
|
<p>
|
|
<?= e($scope === 'platform'
|
|
? 'Fordern Sie einen Link für den Zugang zur Plattformverwaltung an.'
|
|
: 'Fordern Sie einen Link für den Zugang von ' . $tenantName . ' an.') ?>
|
|
</p>
|
|
</section>
|
|
|
|
<div class="two-column">
|
|
<form class="card form-card" method="post" action="<?= e(url(current_path())) ?>">
|
|
<?= csrf_field($csrf) ?>
|
|
<input type="hidden" name="scope" value="<?= e($scope) ?>">
|
|
<?php if ($tenantSlug !== ''): ?>
|
|
<input type="hidden" name="tenant_slug" value="<?= e($tenantSlug) ?>">
|
|
<?php endif; ?>
|
|
<?php if ($scope === 'tenant' && $tenantName !== ''): ?>
|
|
<input type="hidden" name="tenant_name" value="<?= e($tenantName) ?>">
|
|
<?php endif; ?>
|
|
<label>
|
|
<span><?= e($emailLabel) ?></span>
|
|
<input type="email" name="email" value="<?= e((string) old('email')) ?>" required>
|
|
</label>
|
|
<?php if ($scope !== 'platform' && $tenantSlug === ''): ?>
|
|
<label>
|
|
<span>Kurzname der Kaffeeliste</span>
|
|
<input type="text" name="tenant_slug" value="<?= e((string) old('tenant_slug')) ?>" placeholder="kaffeeliste-nord" required>
|
|
</label>
|
|
<?php endif; ?>
|
|
<button class="button button-primary" type="submit">Link per E-Mail senden</button>
|
|
<p class="muted">Nach dem Klick auf den Link können Sie ein neues Passwort festlegen.</p>
|
|
<p><a class="text-link" href="<?= e($loginUrl) ?>">Zurück zum Login</a></p>
|
|
</form>
|
|
|
|
<aside class="card">
|
|
<span class="eyebrow">So geht es weiter</span>
|
|
<ul class="stack-list">
|
|
<li>
|
|
<strong>1. E-Mail-Adresse eingeben</strong>
|
|
<small>Nutzen Sie die Adresse, mit der der Zugang angelegt wurde.</small>
|
|
</li>
|
|
<li>
|
|
<strong>2. Link öffnen</strong>
|
|
<small>Der Link ist zeitlich begrenzt und nur einmal nutzbar.</small>
|
|
</li>
|
|
<li>
|
|
<strong>3. Neues Passwort setzen</strong>
|
|
<small>Danach melden Sie sich mit dem neuen Passwort an.</small>
|
|
</li>
|
|
</ul>
|
|
</aside>
|
|
</div>
|
|
|
|
<?php require __DIR__ . '/../partials/layout-bottom.php'; ?>
|