Retrieve password

Retrieve password

An inconsistency was observed when trying to reset the password using the "app_retrieve_pswd" application.
The correction was made for new modules, created from release 9.10.001.

For modules created in previous releases that use this option, we must make a small change to the app_retrieve_pswd application code, check out the tutorial below.
This tutorial covers security modules created before release 9.10.001 and that use the Send email with a link to generate new password option

1- Open the app_retrieve_pswd application

By default, the prefix of security applications is app_ and the "security" folder, so, with scriptcase open, it is possible to locate the application:
The prefix and folder may have been changed during module generation.





2- Access the send_act method

Access the Programming block, in the PHP Methods folder select the send_act method.


3- Add the code

In old modules, the code for this event looks like this:
  1. $act_code = act_code();


  2. $sql = "UPDATE 
  3. sec_1users
  4.     SET
  5.     activation_code = '". $act_code ."'
  6.     WHERE
  7.         login = '". [usr_login] ."'";

  8. sc_exec_sql($sql);

  9. send_mail_message({lang_send_act_code}
  10.                    . "<br/> <a href='http://". $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']. "?act_code=" . $act_code ."'> http://".$_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']. "?act_code=" . $act_code ." </a>");
Below $act_code = act_code(); add the following code: $act_code = substr($act_code, 0, 32);

The code should look like this:
  1. $act_code = act_code();
  2. $act_code = substr($act_code, 0, 32);

  3. $sql = "UPDATE 
  4. sec_1users
  5.     SET
  6.     activation_code = '". $act_code ."'
  7.     WHERE
  8.         login = '". [usr_login] ."'";

  9. sc_exec_sql($sql);

  10. send_mail_message({lang_send_act_code}
  11.                    . "<br/> <a href='http://". $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']. "?act_code=" . $act_code ."'> http://".$_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']. "?act_code=" . $act_code ." </a>");


    • Related Articles

    • Hide/Show "Retrieve Password" field on login screen with HTML template

      In this article, we will learn how to enable the "Hide/Show" feature that is available within the "Security -> Settings" option, for the "Retrieve Password" field that is found on the login screen that was generated with HTML template. Currently, ...
    • Manual Password Reset

      In this article, we'll show how to reset your password in the development environment. 1 - First you'll need to find your Scriptcase database (nm_scriptcase.db): C:\Program Files\NetMake\v9-php73\wwwroot\scriptcase\devel\conf\scriptcase In Windows ...
    • Resetting the Production Environment Password

      Important - By doing this procedure, all your configurations of the production environment will be lost. In this article, we will see how to reconfigure the password of the production environment, because there is not an option for “Forgot my ...
    • Setting password recovery in Scriptcase

      To configure the password recovery, it's necessary to do some steps so that works correctly. To the recovery happens, will be necessary that you have and configure a SMTP server. After login, you'll access the menu Options > Settings >  System ...
    • Security module password recovery error

      To fix the error during the security module password recovery process, you need to follow the steps below: Only available when using the option to email the change new password link. 1- Access the application app_change_pswd By default, when ...