New ISPConfig module for WHMCS

Discussion in 'Tips/Tricks/Mods' started by cwispy, Dec 11, 2014.

Thread Status:
Not open for further replies.
  1. BenM

    BenM Member

    Hi, i want to run multiple versions of ispcfg3 but changing it for example to ispcfg4 wont do the job.
    Can you tell me wat to change to make that work?

    Some improvements someone made for me.

    webcreation

    $ispcparams = array(
    'ipv6_address' => 'xxxx:4f8:1c0c:7361::1', //maybe you can automate this getting the adres from the server setup
    'redirect_type' => $tmpl['redirect_type'], // forward option
    'redirect_path' => $tmpl['redirect_path'], //forward option
    'rewrite_to_https' => 'y', // sets the force to https on

    Edit for websites.tpl setting up the forward.

    <div class="form-group">
    <label for="redirect" class="col-sm-4 control-label">Redirect Type</label>
    <div class="col-sm-8">
    <div class="input-group">
    <span class="input-group-addon" id="redirect_type"></span>
    <select class="form-control" name="redirect_type" id="directory">
    <option value=""{if $i.redirect_type == ""} selected{/if}>No Redirect</option>
    <option value="no"{if $i.redirect_type == "no"} selected{/if}>No Flag</option>
    <option value="R"{if $i.redirect_type == "R"} selected{/if}>R</option>
    <option value="L"{if $i.redirect_type == "L"} selected{/if}>L</option>
    <option value="R,L"{if $i.redirect_type == "R,L"} selected{/if}>R,L</option>
    <option value="R=301,L"{if $i.redirect_type == "R=301,L"} selected{/if}>R=301,L</option>
    </select>
    </div>
    </div>
    </div>

    <div class="form-group">
    <label for="directory" class="col-sm-4 control-label">Redirect Path</label>
    <div class="col-sm-6">
    <input type="text" class="form-control" name="redirect_path" id="directory" value="{$i.redirect_path}">
    </div>
    </div>

    in view you need to change websites.php for the redirect. look at website.txt
     

    Attached Files:

  2. cwispy

    cwispy Active Member

    Reference: https://developers.whmcs.com/provisioning-modules/getting-started/

    To run multiple copies, you have to rename the folder, file and all functions.

    The file would be renamed to ispcfg4.php and the all the functions inside would be changed like so.
    function ispcfg3_ConfigOptions() {
    would become
    function ispcfg4_ConfigOptions() {
     
  3. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    should new domains/websites in ispconfig be created in a new account each time?
    i'm trying to 'purchase' new hosting packages within a test client account in whmcs, but every new hosting package is created within a new user account in ispconfig.
    what I expected, and need, is that the user account in ispconfig matches the client account in whmcs and all additional websites/dns/dbs etc are created in ispconfig under the same single user account.

    eg client1 in whmcs has websites in ispconfig site1, site4 , site5 as user client1, not as users site1, site4, site5.
    client2 in whmcs has websites in ispconfig site2, site3 as user client2, not as users site2 and site3

    also it seems that even with a multi-server (multiple webservers) ispconfig setup, we only register the main ispconfig server. how would I make it possible for a client to purchase a dedicated webserver (not a VZ vps, but an actual ispconfig webserver for their use only)
    the server wouldn't actually exist at the time of purchase. would need to be added to the system afterwards. would specific user limit templates allow this?

    also, I can't find the file manager in the client area in whmcs, ( I may need to update the plugin though). but how does it work, does it require that a file manager is added to ispconfig. (I've tried net2ftp, pydio8.2 etc. none of them are working properly) or does it ftp in the background?
    would it still connect to the correct hosting server in a multi-server setup?
     
  4. cwispy

    cwispy Active Member

    Yes that is the correct behaviour and is by design due to the way that WHMCS operates. There is no simple clear way to link multiple accounts to a single user in ISPConfig.

    A multi server instance is just for load balancing everything across multiple servers. WHMCS does not know anything about the servers in ISPConfig, it gets that information from the primary ISPConfig servers. If you created a client template for a dedicated server in ISPConfig and assigned that to a product in WHMCS, then it could be sold. If the service does not exist, then there is no way to auto provision the service.

    The file manager plugin uses ftp and relies on dns to find the correct host. The plugin is a third party app and I do not use it or recommend it personally. It also only seems to work in the SIX template in WHMCS I think it is.
     
  5. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    hmm. maybe we have slightly different ideas on what an account is in whmcs.

    i'm not trying to link multiple whmcs accounts to a single user in ispconfig, i'm trying to link a single account in whmcs with multiple domains and websites, to a single account in ispconfig with multiple domains and websites.

    I can have a single user (profile) in whmcs, which has purchased multiple domains and hosting packages.
    I can have a single user in ispconfig, which has multiple domains/dns zones/databases/hosting packages.

    at the moment with this plugin, the single profile in whmcs would create multiple users (logins) in ispconfig, one for each domain/hosting package. I don't see why it wouldn't be able to add all these domains/hosting packages into ispconfig under a single ispconfig user login.


    ok. that's fine. as long as it can be done with a suitable client template. there should be a way to get it auto-provisioned, using the ispconfig api, AWS-CLI, cloudformation, and ansible. as long as the whmcs and ispconfig accounts are correctly linked.
    so I would basically be: receive order - create new server - install/configure new server - add server to existing multi-server ispconfig system - whmcs creates new user in ispconfig with web/db client limits only for this new server.

    again, should be fine as long as it works. the only major omission from ispconfig is a file-manager, I've tried getting a few working, and succeeded to a certain extent, but there's always been some issue with them that stopped me being willing to apply it to live servers.


    also, I've remembered another issue. with setting the dns records in whmcs. it's fine for most of them, but I have an issue with trying to set SRV records, it doesn't show anything about the different fields. it does work ( although there doesn't seem to be any way to set the priority), if you enter everything in one line in the correct order, but it's very unintuitive. and I have a pretty good idea of what i'm doing, most of our clients, trying to do this themselves, would be completely lost.
    I like the templates ispconfig use for adding dns records, it's very clear and simple. maybe adding dns records in whmcs should use the same layouts/templates for this. I've not looked at the code, so no idea if that's a lot more work combining the fields into one string to send to ispconfig, but it would definitely make things easier for end clients.
     
  6. cwispy

    cwispy Active Member

    By account I am referring to the product/service accounts associated with a client. Maybe its a poor choice of word, but it still relates to my answer the same way. Each time you add a new product to a client in WHMCS, there needs to be a way of associating them with an account in ISPConfig. I chose to use a sinlge product in WHMCS maps to a single user in ISPConfig because I can not see any other way of doing it. I guess if you didnt use limit templates, you may be able to do what your wanting, but even that may not work as you would lose the ability to limit customers from adding as many services as they like.

    I will have a look at the issue of the SRV records.
     
  7. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Could you tie a product in whmcs to an addon template in ispconfig?

    Ie. I'm thinking you create a main template that allows say 1 domain/website/mail/etc., and have an addon template that adds another domain/website/mail/etc., and create a product tied to each. You'd have to make the "main template" product be required, and limited to only one per whmcs client, but then they could buy as many "addon template" products as they want, and it all gets created in a single ispconfig account.
     
  8. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    hmm. that might get overcomplicated quite quickly. what happens if a client no longer wants hosting for the domain on the 'main template' but still wants hosting for a couple of domains on 'addon templates'? I assume removing the main template will auto-remove all the addon templates as well, so either one of the addon templates needs to switch to a main template, or a domain needs to move from an 'addon template' to a 'main template', and i'm not sure if that's possible.

    both whmcs and ispconfig work fine with multiple domains/websites within a single user profile. so there must be some way to link between them. whether that means referencing everything as userid.productid or similar I don't know. i'm not a programmer, and I've not looked in any detail at any of the api stuff. i'll have to get one of our developers to look at it when they have some (very rare) spare time.
     
  9. Ashkael

    Ashkael New Member

    Hello,

    How to manage multiple languages for the menu in hook.php? I have another problem when we click on the example menu "Databases" Information or Change password or request cancellation it remains on the active class. How to solve the problem?

    Thank you for your answers
     
  10. deividmen

    deividmen Member

    Hello,
    I have an Ubuntu 16.04 server with ISPConfig 3.1 and a website where I installed WHMCS.

    I set it up, but I keep getting this error message when I click on "Accept order" from a new pending order:

    Order Accept Encountered Problems
    SOAP Error: domain_error_empty<br /> domain_error_regex<br />

    Thank you for your help
     
    Last edited: Dec 25, 2018
  11. cwispy

    cwispy Active Member

    The error "domain_error_regex" is ISPConfig telling you it does not like the domain name. The domain name does need to be valid or it will fail.
     
  12. deividmen

    deividmen Member

    I understand, but I don't want my clients to register a domain name so I set up a product (hosting plan) with no domain registration. So I left the following option unchecked:

    Require Domain - Tick to show domain registration options

    How can I make it work this way?
     
  13. cwispy

    cwispy Active Member

    The client does not have to register a domain, they can use an existing domain name.
    The module will only create what is set up in limit template in ispconfig. So if you need a domain in the limit template because your have email, dns etc, then you need a valid domain in whmcs to be sent to ispconfig.
     
  14. radim_h

    radim_h Member

    Hello,
    after ISPconfig update my script stopped working. Getting error in WHMCS
    Module Command Error
    SOAP Error: SoapClient::SoapClient(): 'uri' option is required in nonWSDL mode

    do you have idea, what should be wrong?
     
  15. cwispy

    cwispy Active Member

    What version of ispconfig did you update from and to? The uri is passed in the script so I can not think of what would be wrong. What version of PHP are you running?
     
  16. mra

    mra New Member

    Im having an issue with the dns zones. I get no error when clicking create in whmcs. The client, website, email, ftp user is all created but the dns zone never is. I am using the Default template and have specified the dns server in the user limit template as well.
    Edit - fixed. It was the default.template needing the xfer line added as mentioned in the github.
     
    Last edited: Mar 26, 2019
  17. Marcooo

    Marcooo New Member

    Hi module is not working.

    When i upload it i got a 500 error on whmcs inside the addserver function it says the configservers.php is corrupted.
    Whmcs 7.7.1 can you fix this?
     
  18. mra

    mra New Member

    I got this error too you need to comment out the part at the top of ispcfg3.php that is mentioned in the readme on the github. I think it was the ini_set for errors.
     
  19. radim_h

    radim_h Member

    Hello,
    how should i add translation to different language (accroding to whmcs user language setting) ? Arent you planing to use lang files?
    Have a nice day
    RH
     
  20. esq77

    esq77 New Member

    Was wondering if this module will work to create Reseller accounts?
     
Thread Status:
Not open for further replies.

Share This Page