Enabling password reset allows users to change their FTP password from the log-in console. You'll need to write your own PHP function to handle this on your server.
First, enable password reset in your settings.json file. You can use our wizard to configure this.
The reset password option is available only when both of the following are true:
Create a PHP file named mftp_extensions.php and save it in your /mftp folder (same directory as index.php).
Copy the contents below into the file:
Monsta FTP passes these three values to your function:
$username is the user's FTP login.
$currentPassword is the user's current FTP password.
$newPassword is the user's new password.
Your function can return one of these results:
1. If nothing is returned, RESET_PASSWORD_SUCCEEDED is shown.
2. If a value is returned, that value is shown (you can return a language variable key).
3. If an exception is thrown, its message is shown if present; otherwise RESET_PASSWORD_FAILED is shown.