Mengubah password semua actor

This commit is contained in:
2026-06-09 20:22:09 +07:00
parent ba4bd1f280
commit 311e5579f4
7 changed files with 59 additions and 54 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
// ============================================================
// update_pass.php Set semua password user menjadi "password"
// Akses: http://localhost/WebGIS/WebGIS_PovertyMap/update_pass.php
// ============================================================
require_once 'config.php';
// Nonaktifkan header JSON dari config.php untuk output HTML
header('Content-Type: text/html; charset=utf-8');
$db = getDB();
$hash = password_hash('password', PASSWORD_DEFAULT);
$stmt = $db->prepare('UPDATE users SET password_hash = ?');
$stmt->bind_param('s', $hash);
if ($stmt->execute()) {
$count = $stmt->affected_rows;
echo "Berhasil: {$count} akun diupdate. Password semua user = \"password\"\n";
echo "Hash: {$hash}\n";
} else {
echo 'Error: ' . $stmt->error . "\n";
}
$stmt->close();
$db->close();