Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This is potentially dangerous module - it can execute any script from scripts directory you pass to it, so its important to run your HostBill php/php-fpm processes under a isolated system user (not root). Its also advised to use/enable HostBill queue module

System requirements & security precautions

...

  • As with any HostBill module, activate Script_Provisioning module in Settings→Modules section of adminarea. 
  • You will be redirected to Settings→Apps section to create connection, this module requires just adding name for its connection details
  • When configuring product in Settings→Products  & Services, select newly activated module & app. 
  • Proceed to "Settings" Tab, to configure your scripts:

    • Check which events should execute a script (ie. terminate/create etc.)
    • From dropdown list select which script to execute (you should create scripts first)
    • Provide arguments that script should be executed with, here you can use variables available in Available Variables tab
       
    • Note about arguments: 
      All arguments will be escaped before execution for additional security. 
  • Under Custom client-triggered actions you can define which script to execute when client will trigger custom action from Client Functions::Client UI
    Same rules/limitations/variables as in Settings tab apply
  • Under Available Variables you can check what variables can be used in your script arguments  (up-to-date list is available in product configuration)
    Image Added

Client functions

...

Next to standard client functions that HostBill offers, module comes with "Client UI" function (name can be changed) of which you can enable multiple instances.
Image Added


Once function is enabled, in its "Settings" tab you can define:

  • names of Allowed actions customer is allowed to trigger
  • HTML template rendered in client portal. In this code you can use variables.
    Once customer clicks on link with {$actlink}youraction URL, and youraction is within Allowed actions module will call script defined in Custom client-triggered actions tab (see above)
     .
    Action customer clicks will be available as {$actname} variable in your custom script arguments

Image Added


Non-Enterise install

...

By default scripts should be located in /home/hostbill/scripts directory, to use custom dir on other installations, edit includes/config.php file and add lines:

...