Add registration functionality and update authentication views
- Implemented a new method in AuthController to display the registration form with localized labels and session error handling. - Updated the login view to include a link for account creation. - Enhanced the registration view with a link to the login form. - Removed the obsolete showRegisterPage view to streamline the codebase.
This commit is contained in:
parent
8e1a13ea27
commit
d711bc6152
@ -30,6 +30,21 @@ class AuthController
|
|||||||
unset($_SESSION['auth_errors'], $_SESSION['auth_validData']);
|
unset($_SESSION['auth_errors'], $_SESSION['auth_validData']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function showRegistrationForm()
|
||||||
|
{
|
||||||
|
$this->view->setVars([
|
||||||
|
'labels' => [
|
||||||
|
"email" => "E-Mail-Adresse",
|
||||||
|
"password" => "Passwort",
|
||||||
|
"password_repeat" => "Passwort wiederholen",
|
||||||
|
"old_password" => "Altes Passwort"
|
||||||
|
],
|
||||||
|
'errors' => $_SESSION['auth_errors'] ?? [],
|
||||||
|
'validData' => $_SESSION['auth_validData'] ?? []
|
||||||
|
]);
|
||||||
|
unset($_SESSION['auth_errors'], $_SESSION['auth_validData']);
|
||||||
|
}
|
||||||
|
|
||||||
public function login() {
|
public function login() {
|
||||||
$email = $_POST['email'];
|
$email = $_POST['email'];
|
||||||
$password = $_POST['password'];
|
$password = $_POST['password'];
|
||||||
|
@ -28,6 +28,9 @@ include dirname(__DIR__).'/header.phtml';
|
|||||||
</div>
|
</div>
|
||||||
<button class="login-btn" type="submit">Einloggen</button>
|
<button class="login-btn" type="submit">Einloggen</button>
|
||||||
</form>
|
</form>
|
||||||
|
<div style="text-align:center; margin-top: 1.5em;">
|
||||||
|
<a href="?controller=Auth&do=register" class="login-link">Konto erstellen</a>
|
||||||
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -58,4 +58,8 @@
|
|||||||
<button type="submit">Registrieren</button>
|
<button type="submit">Registrieren</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<div style="text-align:center; margin-top: 1.5em;">
|
||||||
|
<a href="?controller=Auth&do=showAuthForm" class="login-link">Bereits registriert? Hier einloggen</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<?php include dirname(__DIR__).'/footer.phtml'; ?>
|
<?php include dirname(__DIR__).'/footer.phtml'; ?>
|
@ -17,7 +17,7 @@ include dirname(__DIR__) . '/header.phtml';
|
|||||||
</form>
|
</form>
|
||||||
<button class="button-loggin">Login</button>
|
<button class="button-loggin">Login</button>
|
||||||
<a class="link-passwort-vergessen">Passwort vergessen?</a>
|
<a class="link-passwort-vergessen">Passwort vergessen?</a>
|
||||||
<a class="link-konto-erstellen">Konto erstellen</a>
|
<a class="link-konto-erstellen" href="?controller=Auth&do=showRegistrationForm">Konto erstellen</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -60,7 +60,8 @@ include dirname(__DIR__) . '/header.phtml';
|
|||||||
</label>
|
</label>
|
||||||
</form>
|
</form>
|
||||||
<button class="button-register">Registrieren</button>
|
<button class="button-register">Registrieren</button>
|
||||||
<a class="link-konto-erstellen">Login</a>
|
<div style="text-align:center; margin-top: 1.5em;">
|
||||||
|
<a href="?controller=Auth&do=showAuthForm" class="login-link">Bereits registriert? Hier einloggen</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
Loading…
x
Reference in New Issue
Block a user