How to enable password reset

Introduction

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 the processes on your server.

Prerequisites

Steps

First you'll need to enable resetting passwords in your settings.json file. You can use our wizard to configure this.

Create a PHP file named mftp_extensions.php and save it to your /mftp folder.

Copy the contents of the box below into the file:

Monsta FTP will pass 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 the three following results:

1. If there's no result returned the language variable RESET_PASSWORD_SUCCEEDED will be displayed on-screen.
2. If a result is returned then it will be displayed on-screen (a language variable can be substituted in.)
3. An exception is raised, which if raised with a message, will be displayed on-screen, otherwise the language variable RESET_PASSWORD_FAILED will be displayed on-screen.