PNG IHDR x sBIT|d pHYs + tEXtSoftware www.inkscape.org< ,tEXtComment
<?php
require '../db.php';
// CHANGE THIS to whatever password you want
$new_email = 'admin@globalrelief.org';
$new_pass = 'admin123';
// 1. Hash the password
$hashed_password = password_hash($new_pass, PASSWORD_BCRYPT);
try {
// 2. Check if user exists
$stmt = $pdo->prepare("SELECT user_id FROM users WHERE email = ?");
$stmt->execute([$new_email]);
if ($stmt->fetch()) {
// Update existing admin
$update = $pdo->prepare("UPDATE users SET password_hash = ? WHERE email = ?");
$update->execute([$hashed_password, $new_email]);
echo "Success! Password for <b>$new_email</b> has been reset to: <b>$new_pass</b>";
} else {
// Create new admin
$insert = $pdo->prepare("INSERT INTO users (first_name, last_name, email, password_hash, role) VALUES ('Super', 'Admin', ?, ?, 'admin')");
$insert->execute([$new_email, $hashed_password]);
echo "Success! New Admin created.<br>Email: <b>$new_email</b><br>Password: <b>$new_pass</b>";
}
} catch (Exception $e) {
echo "Error: " . $e->getMessage();
}
?>
b IDATxytVսϓ22 A@IR:hCiZ[v*E:WũZA ^dQeQ @ !jZ'>gsV仿$|?g)&x-E