Skip to content

Instantly share code, notes, and snippets.

@christian-kolb
Created January 23, 2014 14:15
Show Gist options
  • Save christian-kolb/8579081 to your computer and use it in GitHub Desktop.
Save christian-kolb/8579081 to your computer and use it in GitHub Desktop.
<?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
Copy link

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
Copy link

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