Files
gestion-certificats2/app/src/Views/users/edit_password.php
google-labs-jules[bot] 3ec2eda49d fix: Corriger les chemins d'inclusion dans la vue edit_password
La vue `app/src/Views/users/edit_password.php` utilisait des chemins relatifs incorrects pour inclure `header.php` et `footer.php`, provoquant une erreur fatale.

Cette correction remplace les chemins relatifs par des chemins absolus en utilisant la constante `APP_ROOT_DIR`.

Modifications :
- Mise à jour des `require_once` pour `header.php` et `footer.php` dans `app/src/Views/users/edit_password.php` pour utiliser `APP_ROOT_DIR`.
- Ajout de commentaires en début de fichier pour lister les variables attendues du contrôleur.
- Uniformisation de l'affichage des messages d'erreur via la variable `$errorMessage`.
2025-06-15 19:13:50 +00:00

37 lines
1.6 KiB
PHP

<?php
// Variables attendues du contrôleur: $user, $translations, $currentLang, $darkModeClass, $errorMessage (optionnel)
require_once APP_ROOT_DIR . '/src/Views/shared/header.php';
?>
<div class="container mt-5">
<h2><?= htmlspecialchars($translations['edit_password_title'] ?? 'Edit Password Title') ?></h2>
<?php if (isset($errorMessage)): ?>
<div class="alert alert-danger" role="alert">
<?= htmlspecialchars($errorMessage) ?>
</div>
<?php endif; ?>
<p><?= htmlspecialchars($translations['editing_password_for_user'] ?? 'Editing password for user: %username%') ?>: <strong><?= htmlspecialchars($user['username'] ?? '') ?></strong></p>
<form action="/users/update-password" method="POST">
<input type="hidden" name="user_id" value="<?= htmlspecialchars($user['id'] ?? '') ?>">
<div class="mb-3">
<label for="new_password" class="form-label"><?= htmlspecialchars($translations['new_password'] ?? 'New Password') ?></label>
<input type="password" class="form-control" id="new_password" name="new_password" required>
</div>
<div class="mb-3">
<label for="confirm_password" class="form-label"><?= htmlspecialchars($translations['confirm_new_password'] ?? 'Confirm New Password') ?></label>
<input type="password" class="form-control" id="confirm_password" name="confirm_password" required>
</div>
<button type="submit" class="btn btn-primary"><?= htmlspecialchars($translations['update_password_button'] ?? 'Update Password') ?></button>
</form>
</div>
<?php
require_once APP_ROOT_DIR . '/src/Views/shared/footer.php';
?>