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.

![](https://static.zohocdn.com/zoho-desk-editor/static/images/file.png)

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:

![](https://static.zohocdn.com/zoho-desk-editor/static/images/caution.png)

The prefix and folder may have been changed during module generation.

![](https://help.scriptcase.net/galleryDocuments/edbsn60fd99913e4fa7eecb3fc7595918da4009bd3c2f206b513c90719610de8daa71c33f2a721156d23a08e9cdf1f2e1f1e6?inline=true)

## 2- Access the send\_act method

Access the **Programming block**, in the **PHP Methods** folder select the **send\_act method**.

![](https://help.scriptcase.net/galleryDocuments/edbsncda67cf2bf3c4bb59d177bd2ec754f423654b7663f394b8e6fdd78b486c43bf655842604fd4c320a5f96c82bba09e237?inline=true)

## 3- Add the code

In old modules, the code for this event looks like this:

1. $act\_code = act\_code();

4. $sql = "UPDATE
5. sec\_1users
6. SET
7. activation\_code = '". $act\_code ."'
8. WHERE
9. login = '". [usr\_login] ."'";
11. sc\_exec\_sql($sql);
13. send\_mail\_message({lang\_send\_act\_code}
14. . "  
      [http://".$\_SERVER['HTTP\_HOST'] . $\_SERVER['SCRIPT\_NAME']. "?act\_code=" . $act\_code ."](http://". $_SERVER[) ");

![](https://static.zohocdn.com/zoho-desk-editor/static/images/file.png)![](https://static.zohocdn.com/zoho-desk-editor/static/images/exclamation.png)

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);**
4. $sql = "UPDATE
5. sec\_1users
6. SET
7. activation\_code = '". $act\_code ."'
8. WHERE
9. login = '". [usr\_login] ."'";
11. sc\_exec\_sql($sql);
13. send\_mail\_message({lang\_send\_act\_code}
14. . "  
      [http://".$\_SERVER['HTTP\_HOST'] . $\_SERVER['SCRIPT\_NAME']. "?act\_code=" . $act\_code ."](http://". $_SERVER[) ");