]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1549262 - Lack of password confirmation when deleting your account.
authordklawren <dklawren@users.noreply.github.com>
Tue, 24 Sep 2019 13:50:54 +0000 (09:50 -0400)
committerGitHub <noreply@github.com>
Tue, 24 Sep 2019 13:50:54 +0000 (09:50 -0400)
template/en/default/account/prefs/account.html.tmpl
userprefs.cgi

index db8633751df55ec3bfe1c55f23995e81776c5a49..8f9bf6a0e9c815a34ec02311fad560a81c4da31d 100644 (file)
             however, your email address and name will be removed in most locations.
             We are not able to remove your details that are part of comment text.
           </p>
+          <p>
+            <em>Warning:</em> You will need to enter your current password above to
+            confirm this action.
+          </p>
           <p>
             <input type="checkbox" id="account-disable-confirm">
             I acknowledge that my account will not be functional after it has been
index e2127fe4326eae9a5c7836d8933ead45af45b04b..0462f5eed2ed38d560b5b951ad80dee082634a3f 100755 (executable)
@@ -198,6 +198,15 @@ sub MfaAccount {
 
 sub DisableAccount {
   my $user = Bugzilla->user;
+  my $cgi  = Bugzilla->cgi;
+
+  my $oldpassword   = $cgi->param('old_password');
+  my $oldcryptedpwd = $user->cryptpassword;
+  $oldcryptedpwd || ThrowCodeError("unable_to_retrieve_password");
+
+  if (bz_crypt($oldpassword, $oldcryptedpwd) ne $oldcryptedpwd) {
+    ThrowUserError("old_password_incorrect");
+  }
 
   my $new_login = 'u' . $user->id . '@disabled.tld';