Plesk

Exercise 3. Plesk Entities and Authentication

This exercise will guide you through creating an extension that reports
the number of customer accounts, websites, databases, and mail accounts
on a Plesk server; the output format will be a plain text or the text in
XML or JSON. While writing the extension, you will learn how to do the
following:

We assume that the extension ID is plesk-stats, and that you start
with the code inside the ex3 directory. This code is partly written by
us to help you focus only on certain areas. Additionally, we have
populated the directory with media content necessary for the exercise.
To see the completed exercise, examine the ex3complete directory.

Step 1. Set up custom authentication.

The extension we are going to write will consist of the form which the
administrators will use to set up the data output format, and the
endpoint form where users will request the statistics. As the statistics
is secure data, we should set up access control to deliver the results
only to certain users. The two ways on how to do this are possible:

As we assume that the statistics web service will be used by third-party
applications, we will write a custom authentication method.

Start with defining a secret token authToken in our post-installation
script and saving it to the key-value…

Exit mobile version