-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin_change_password.html
More file actions
95 lines (89 loc) · 3.3 KB
/
Copy pathadmin_change_password.html
File metadata and controls
95 lines (89 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HardLink - Changer le Mot de Passe de Confirmation</title>
<link rel="stylesheet" href="global.css">
<style>
.container-index {
width: 100%;
max-width: 500px;
}
.form-group {
margin-bottom: 20px;
}
#message {
margin-top: 1rem;
text-align: center;
font-weight: bold;
}
.success {
color: var(--accent-green);
}
.error {
color: #e74c3c;
}
</style>
</head>
<body>
<div class="container-index">
<div class="header-title-group">
<h2>Mot de Passe de Confirmation</h2>
</div>
<form id="change-password-form">
<div class="form-fields-wrapper">
<div class="form-group">
<label for="old-password">Ancien Mot de Passe :</label>
<input type="password" id="old-password" required>
</div>
<div class="form-group">
<label for="new-password">Nouveau Mot de Passe :</label>
<input type="password" id="new-password" required>
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn-ok">Mettre à jour</button>
<button type="button" class="action-button back-btn" onclick="window.location.href='dashboard.html'">
<svg viewBox="0 0 24 24" width="18" height="18" style="margin-right: 5px;" fill="currentColor"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>
Dashboard
</button>
</div>
</form>
<div id="message"></div>
<footer class="main-footer">
<p>© 2026 HardLink - Tous droits réservés</p>
</footer>
</div>
<script>
document.getElementById('change-password-form').addEventListener('submit', function(e) {
e.preventDefault();
const old_password = document.getElementById('old-password').value;
const new_password = document.getElementById('new-password').value;
const messageDiv = document.getElementById('message');
fetch('api/update_confirmation_password.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ old_password, new_password })
})
.then(response => response.json())
.then(data => {
messageDiv.textContent = data.message;
if (data.success) {
messageDiv.className = 'success';
document.getElementById('change-password-form').reset();
} else {
messageDiv.className = 'error';
}
})
.catch(error => {
console.error('Error:', error);
messageDiv.textContent = 'Une erreur réseau est survenue.';
messageDiv.className = 'error';
});
});
</script>
</body>
</html>