Fix broken table names caused by doubled table_by_key() calls

The high-level db_*() functions (like db_update(), and also
_db_add_field() in upgrade.php) call table_by_key() internally, which
also means the unwrangled table name needs to be handed over to them.
If handing over an already table_by_key()'d table name, it gets modified
again and results in something like prefix_prefix_mailbox.
pull/116/head
Christian Boltz 8 years ago
parent a27f80c01d
commit 8fb67e6fbf
No known key found for this signature in database
GPG Key ID: C6A682EA63C82F1C

@ -788,8 +788,7 @@ abstract class PFAHandler {
function getPasswordRecoveryCode($username) {
if ($this->init($username)) {
$token = generate_password();
$table = table_by_key($this->db_table);
$updatedRows = db_update($table, $this->id_field, $username, array(
$updatedRows = db_update($this->db_table, $this->id_field, $username, array(
'token' => pacrypt($token),
'token_validity' => date("Y-m-d H:i:s", strtotime('+ 1 hour')),
));
@ -820,7 +819,7 @@ abstract class PFAHandler {
$crypt_token = pacrypt($token, $row['token']);
if($row['token'] == $crypt_token) {
db_update($table, $this->id_field, $username, array(
db_update($this->db_table, $this->id_field, $username, array(
'token' => '',
'token_validity' => '2000-01-01 00:00:00',
));

Loading…
Cancel
Save