17 lines
581 B
PHP
17 lines
581 B
PHP
<?php
|
|
require_once __DIR__ . '/db/config.php';
|
|
|
|
try {
|
|
$pdo = db();
|
|
$stmt = $pdo->prepare("UPDATE users SET role = 'super_admin' WHERE username = 'admin'");
|
|
$stmt->execute();
|
|
|
|
if ($stmt->rowCount() > 0) {
|
|
echo "User role updated successfully. You can now log in to the admin panel. Please delete this file immediately.";
|
|
} else {
|
|
echo "Could not find the 'admin' user or the role is already 'super_admin'. Please check your database. You can delete this file.";
|
|
}
|
|
} catch (PDOException $e) {
|
|
echo "Database error: " . $e->getMessage();
|
|
}
|