-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix-admin.php
More file actions
27 lines (22 loc) · 814 Bytes
/
Copy pathfix-admin.php
File metadata and controls
27 lines (22 loc) · 814 Bytes
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
<?php
require_once 'config/database.php';
$password = 'admin123';
$email = 'admin@fptb.edu.ng';
// Generate the hash
$hash = password_hash($password, PASSWORD_BCRYPT);
// Update the database
$stmt = $pdo->prepare("UPDATE users SET password_hash = ? WHERE email = ? AND role = 'admin'");
$result = $stmt->execute([$hash, $email]);
if ($result && $stmt->rowCount() > 0) {
echo "SUCCESS! Admin password has been reset.\n\n";
echo "Login Credentials:\n";
echo "Email: " . $email . "\n";
echo "Password: " . $password . "\n\n";
echo "Hash: " . $hash . "\n\n";
// Verify it works
$verify = password_verify($password, $hash);
echo "Verification: " . ($verify ? "✓ PASS - Hash is correct" : "✗ FAIL") . "\n";
} else {
echo "ERROR: Failed to update admin password.\n";
}
?>