1
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2025-07-29 22:41:11 +03:00

reindent / reformat; add type hints for some of the app password stuff; try and make sure someone can only remove their own app password (see revokeAppPassword() )

This commit is contained in:
David Goodwin
2023-12-23 21:43:31 +00:00
parent 1dc6ebe834
commit 015d4ec9cd
10 changed files with 183 additions and 125 deletions

View File

@ -20,14 +20,14 @@ $stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows == 1) {
echo "Updating TOTP secret for $USERNAME\n";
$row = $result->fetch_assoc();
$preferences = unserialize($row['preferences']);
$preferences['twofactor_gauthenticator']['secret'] = $SHARED_SECRET;
$stmt_update = $mysqli->prepare("UPDATE users SET preferences=?");
$stmt_update->bind_param("s", serialize($preferences));
$stmt_update->execute();
echo "Updating TOTP secret for $USERNAME\n";
$row = $result->fetch_assoc();
$preferences = unserialize($row['preferences']);
$preferences['twofactor_gauthenticator']['secret'] = $SHARED_SECRET;
$stmt_update = $mysqli->prepare("UPDATE users SET preferences=?");
$stmt_update->bind_param("s", serialize($preferences));
$stmt_update->execute();
} else {
echo "Could not find user $USERNAME in Roundcubemail.\n";
echo "Could not find user $USERNAME in Roundcubemail.\n";
}
$mysqli->close();