-
-
Save bondt/8972660 to your computer and use it in GitHub Desktop.
Place this file in your (Contao based) website's root folder and update your username in line 16. Then run it from the browser and log in to the backend using the password "random".
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('BYPASS_TOKEN_CHECK', true); | |
require('system/initialize.php'); | |
class Reset extends Frontend { | |
public function __construct() { | |
parent::__construct(); | |
$this->import('Database'); | |
} | |
// 1. resets user's password to temporary to "random" | |
// 2. forces to change on login | |
// 3. if account was locked before, it's free now | |
public function run() { | |
$username = "YOUR_USERNAME"; // << set this to your username, obviously | |
$newPassword = sha1("random"); // thanks @aschempp for this addition | |
$this->Database->prepare(" | |
UPDATE tl_user | |
SET password = ? | |
, pwChange = 1 | |
, locked = 0 | |
WHERE username = ? | |
")->execute( | |
$newPassword, | |
$username | |
); | |
} | |
} | |
$reset = new Reset(); | |
$reset->run(); | |
echo "Go ahead and re-set a new password!"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment