ycyxc
This commit is contained in:
@@ -17,6 +17,7 @@ $messages = [];
|
||||
$errors = [];
|
||||
$form = ['username' => '', 'password' => '', 'new_password' => ''];
|
||||
$attempt = null;
|
||||
$currentUserDn = null;
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$action = (string) ($_POST['action'] ?? '');
|
||||
@@ -37,10 +38,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
}
|
||||
|
||||
if ($errors === []) {
|
||||
$currentUserDn = $ldap->userDnForUsername($form['username']);
|
||||
|
||||
if ($action === 'test-login') {
|
||||
$attempt = [
|
||||
'action' => 'Login-Test',
|
||||
'username' => $form['username'],
|
||||
'user_dn' => $currentUserDn,
|
||||
];
|
||||
$result = $ldap->testUserCredentials($form['username'], $form['password']);
|
||||
|
||||
@@ -53,6 +57,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$attempt = [
|
||||
'action' => 'Passwortänderung',
|
||||
'username' => $form['username'],
|
||||
'user_dn' => $currentUserDn,
|
||||
'new_password_length' => (string) strlen($form['new_password']),
|
||||
];
|
||||
$loginCheck = $ldap->testUserCredentials($form['username'], $form['password']);
|
||||
@@ -137,6 +142,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
<ul class="login-list">
|
||||
<li>Aktion: <?= htmlspecialchars((string) ($attempt['action'] ?? ''), ENT_QUOTES) ?></li>
|
||||
<li>Benutzername: <?= htmlspecialchars((string) ($attempt['username'] ?? ''), ENT_QUOTES) ?></li>
|
||||
<li>User-DN: <?= htmlspecialchars((string) ($attempt['user_dn'] ?? ''), ENT_QUOTES) ?></li>
|
||||
<?php if (isset($attempt['new_password_length'])): ?>
|
||||
<li>Länge neues Passwort: <?= htmlspecialchars((string) ($attempt['new_password_length'] ?? ''), ENT_QUOTES) ?></li>
|
||||
<?php endif; ?>
|
||||
|
||||
Reference in New Issue
Block a user