ToxicRevolution / CSGORankMeWeb

Web interface for Rank Me CSGO Stat tracking plugin
https://Toxicrevolution.net
MIT License
30 stars 10 forks source link

Forgot Admin password #44

Closed TandelK closed 6 years ago

TandelK commented 6 years ago

Is there any way we can recover Admin Password of the site ? I used it long time ago and forgot it right now. So was just looking if we can reset the password to something else.

APet74 commented 6 years ago

I will try and find time to work on a password changing function.

APet74 commented 6 years ago

Hello TandelK, we are currently working on rewriting the system so we are not going to release a new update with the ability to change the password. However, I have written you a script you can run to do the job.

1) In your root directory add a new file named "passwordChange.php" 2) Inside the file add the following code:

<?php

    require_once('Bcrypt.php');
    require_once('config.php');

    $hash = Bcrypt::hashPassword("YOUR NEW PASSWORD HERE");

    $query = "UPDATE users SET password = :password WHERE email = :email";
    $stmt = $dbh->prepare($query);
    $stmt->bindValue(":password", $hash);
    $stmt->bindValue(":email", "EMAIL OF ADMIN ACCOUNT");
    $stmt->execute();

?>

3) In the code change the "YOUR NEW PASSWORD HERE" to your desired password. 4) Change the "EMAIL OF ADMIN ACCOUNT" to the email of the admin account in your database. 5) In a web browser navigate to your rankme website and then change the page to passwordChange.php and it should execute which will change the password. Let me know if there are any errors as I did not test the script.

TandelK commented 6 years ago

It worked thanks btw