Posts: 2,833
Threads: 141
Joined: Jan 2012
Reputation:
86
IMHO that's a pretty rare case: We check whether "2fasecret" exists and if so we rename it:
https://github.com/mybb/mybb/blob/featur...33.php#L31 If there's already a "authsecret" column
and a "2fasecret" something went horribly wrong (or the database was changed manually). Dropping the column shouldn't be done here as there may be boards which renamed it manually (SQLite/PgSQL users) so we'd disable 2FA for those users and they may not notice it. The way it's been done should work for all usual cases, including rerunning the update.
Support PMs will be ignored!
Posts: 2,833
Threads: 141
Joined: Jan 2012
Reputation:
86
But how do you want to know which of those column contains the correct values? If that column is added manually but the user forgot to edit the files it's "2fasecret", if he also changed the files it's "authsecret". IMHO if we fix this the easiest way would be to change
if($db->field_exists('2fasecret', 'adminoptions'))
to
if($db->field_exists('2fasecret', 'adminoptions') && !$db->field_exists('authsecret', 'adminoptions'))
Support PMs will be ignored!