����JFIF��`�`�����Viewing File: /home/u820193700/domains/spiti2026im.in/public_html/api/set_admin.php
<?php
// api/set_admin.php
// This is a one-time utility to fix your password issues on Hostinger.
// After you upload this project, visit: https://spiti2026im.in/api/set_admin.php

error_reporting(E_ALL);
ini_set('display_errors', 1);

require_once 'db_connect.php';

echo "<h1>Avahan Motors - Nuclear Password Reset</h1>";

try {
    // 1. Set the password using the Server's own encryption (guarantees match)
    $password = 'Avahan2026';
    $hash = password_hash($password, PASSWORD_BCRYPT);
    
    $stmt = $pdo->prepare("REPLACE INTO admins (id, username, password_hash) VALUES (1, 'admin', ?)");
    $stmt->execute([$hash]);
    
    echo "<p style='color:green; font-weight:bold;'>SUCCESS: Admin password has been set to <b>Avahan2026</b>.</p>";

    // 2. Clear any Brute-Force Lockouts
    $tmp = sys_get_temp_dir();
    $files = glob($tmp . '/spiti_login_lock_*.json');
    $cleared = 0;
    foreach ($files as $f) {
        if (@unlink($f)) $cleared++;
    }
    
    if ($cleared > 0) {
        echo "<p style='color:blue;'>Cleared " . $cleared . " IP lockout file(s). You can now log in immediately.</p>";
    } else {
        echo "<p>No active session lockouts found.</p>";
    }

    echo "<hr><p><b>Next Step:</b> <a href='../index.html'>Go to Home Page</a> and try logging into the Admin Dashboard now!</p>";
    echo "<p style='color:red;'><i>Security Tip: For your safety, delete this file (api/set_admin.php) from your server once you have logged in.</i></p>";

} catch (Exception $e) {
    echo "<p style='color:red; font-weight:bold;'>FAILURE: Could not reset password.</p>";
    echo "<pre>" . $e->getMessage() . "</pre>";
    echo "<p>Check your <b>api/db_connect.php</b> file and verify your Hostinger DB credentials.</p>";
}
Back to Directory �������}�!1AQa"q2���#B��R��$3br� %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz�������������������������������������������������������������������������������� ������w�!1AQaq"2�B���� #3R�br� $4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz������������������������������������������������������������������������ ��?��_��+��?��(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(�����