Topic: Password.

What if someone forget he's password how can he recover it? In the database it is encrypt.
I use MVDB 6.3 the User Menu to create a new user with he's passowrd

2 (edited by CDB 2020-10-11 19:15:12)

Re: Password.

v_pozidis,


I don't have complete code to show you, but so long as you have filled out the email address for each user, you could add a button or clickable link to the logon form to retrieve and send the password.


To add a button, textbox or clickable link to the form the following code needs to be placed between the default 'begin....end' that is automatically placed in the script.


begin

   btnForgotPass := TButton.Create(frmdbCoreLogin); //Change to label or edit text etc if using a label or text edit
   btnForgotPass.Left := 113;  // change these to position your button etc 
   btnForgotPass.Top := 170;  // These positions are for a label that appears under the picture image on the login form
   btnForgotPass.Width := 300;
   btnForgotPass.Height:= 15;
   btnForgotPass.Margins.Top :=10;
   btnForgotPass.Margins.Bottom := 10;
   btnForgotPass.Parent := frmdbCoreLogin;
   btnForgotPass.Wordwrap := true;
   btnForgotPass.Caption := 'Forgot Password';
   btnForgotPass.Visible := True;

   frmdbCoreLogin.Caption := 'Your form title here if you wish'  
   {code above has been tested}

   {code below HAS NOT been tested}
   btnForgotPass.OnClick := @ForgotPassWord; 

    

   code for button click  - you will need to make your own form ( for example password_retrieve) with either a user name or an email entry text edit.


NOT TESTED

procedure ForGotPassWordOnClick
begin
     SQL code to retrieve and match either user name or email address. Or use a table grid and a search button to save writing SQL statements.
 
    
   frmdbCoreLogin.mniChangePassword.click; // this calls the built in password change form
 //however this form requires the current password to be entered. So code below is better
   frmForGotPassword.Show;
end;

On the ForGotPassword form show users name and have two textbox to enter the new password and a save button that saves to the  _user table and the password field.


I've just realised you might be able to change frmdbCoreLogin.mniChangePassword.click to frmdbCoreUserChangePwd.Show or .click

On a clear disk you can seek forever

Re: Password.

I ask if we can recover the forgotten password . Can we decrypt the password from the database?  It could be our password too

Re: Password.

Why do you need someone's password? If you "forgot", you can create a new one. Right?

Re: Password.

v_pozidis,


I assume that Dmitri uses the EncryptRC6 function to encrypt the password. If he does, you would need to know the 'key' used, otherwise you would not be able to decrypt it.

If you want to be able to retrieve a password  you would have to design your own form so that you can select the encryption key.

On a clear disk you can seek forever