Requests | Blesta

Requests

Minor enhancments of the Virtualmin module

John Heenan shared this idea 8 months ago
Under Consideration

For context and images please see https://www.blesta.com/forums/index.php?/topic/25775-btcpay-payment-module-forces-btc-payment-method-instead-of-allowing-store-to-use-its-default/&do=findComment&comment=82868

1) Add in an extra text box below the 'Configurable Options' of an order form similar to Domain option below (which is not an option, it is a requirment).

Call the option 'Site Header Text'.  If you take this value and pass it to Virtualmin in the remote API version of the call to 'virtualmin create-domain' as parameter --content then this text will appear in the header text of the created default web site. The reference for the API is at https://www.virtualmin.com/docs/development/remote-api/#the-remote-apiand the reference for individual commands of the API is the same as for those of the CLI. This means call is https://www.virtualmin.com/docs/development/api-programs/create-domain/is the reference for create-domain API call. The reference does not explain what is done with the --content parameter and the reference to a filename does not appear to make any sense in [--content text|filename] with regard to code paths I followed in Virtualmin source code. Well, I have told you now what it does. The text of --content goes at the top of newly created web sites in big bold letters.

2) Also please pass in a --desc parameter with create-domain with automtically constructed text, such as "Created through Blesta, order ID: xxxx". This will appear in an admin screen in Virtualmin for the account holder and the text can be edited by the account holder.

3) The API refenece page above has the following text: "The output from remote.cgi is plain text, including the command-line program’s output and an exit status line indicating success or failure". Please make sure Blesta uses it. For example, during tests Blesta got told to create two different accounts with the same domain name. Virtualmin freaked and refused. Blesta thought everything was great and failed to provide any notification of failure. It might be wortwhile to check beforehand if the domain already exists.

Comments (3)

photo
1

Some examples of how Blesta can request specific domain that has already been created on a server, despite having a domain check system.

First the domain name check system can be bypassed by clicking on skip. Why do this?

1. The domain name is not being purchased and exists already

2. Developers are creating and destroying servers while testing modifcations anf forgot to delete

3. The domain name to purchase is not known yet so an arbitrary name is used that will be changed to a purchased one later

4. The domain name gets edited in the text box by somone who does not know what they are doing

photo
1

With regard to point 3) in proposal. Blesta does check. There is a bug in the API response from Virtualmin,showing sucess instead of error, for the status, for a create domain.

...

O:8:"stdClass":3:{s:6:"output";s:3278:"You are already hosting this domain

...

";s:6:"status";s:7:"success";s:7:"command";s:13:"create-domain";}

As for issues 1) and 2), my own adaptations are coming along.

photo
1

With regard to the bug in Virtualmin, I reported it to them. There is now a one line fix implemented by Virtualmin for the next release of Virtualmin. If anyone nneds the fix now then it is at at https://github.com/virtualmin/virtualmin-gpl/commit/6d04771ab009d9803035c3de39a5e60c849b38f6