Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
define('BYPASS_TOKEN_CHECK', true);
require('system/initialize.php');
class Reset extends Frontend {
public function __construct()
{
parent::__construct();
$this->import('Database');
$this->import('Input');
}
public function run() {
$username = "yourUsername";
$newPassword = "8e0107bf1c7fbeef6538dff7173aa458e7dd585e:8c37627a0e2c606189e7765"; // "reset123"
$this->Database->prepare("
UPDATE tl_user
SET password = ?
WHERE username = ?
")->execute(
$newPassword,
$username
);
}
}
$reset = new Reset();
$reset->run();
@aschempp

This comment has been minimized.

Copy link

@aschempp aschempp commented Jan 24, 2014

Cool! Mit folgender Änderung wird das Passwort dynamisch:

$newPassword = sha1("reset123");

Das ganze liesse sich sehr praktisch auch ausbauen, z.B. dass er zuerst prüft ob der Benutzername vorhanden ist und dann ggf. aktualisiert.

@bondt

This comment has been minimized.

Copy link

@bondt bondt commented Feb 13, 2014

Thanks, I forked you at https://gist.github.com/bondt/8972660. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.