Jump to content

Free Addons


KissNode

Recommended Posts

Hi, I currently provide game servers via TCAdmin which is linked with my WHMCS billing system. I also have CPanel linked to WHMCS.

 

I would like to make it so that whenever a client orders a game server, they also have an option to put in the name for their website on the sub domain of my website. For example xxx.site.mywebsite.com . I would then like this site to automatically be created. Since I have CPanel linked, this should be possible. Any ideas?

Thanks!

Link to comment
Share on other sites

Hi

 

Yes, it's possible. You need to create a custom field or a configurable option where clients insert subdomains ("awesomeclan.example.com" - field name: "subdomain") then with the action hook AfterModuleCreate you retreive the value from $vars["customfields"]["subdomain"] (or $vars["configoptions"]["subdomains"]), remove everything after the first dot so that you have "awesomeclan", create a new DNS zone on example.com for "awesomeclan" in some way (depends on what Registrar you are using and how you "speak" with nameservers), create an hosting package on cPanel with the standard API of cPanel and set a new Mail Template to send a welcome email with FTP credentials and so on.

 

Notice that you will also need the opposite function. When an user no longer is your customer you will run some actions with AfterModuleTerminate hook point to terminate the hosting account on cPanel and remove the DNS zone from your domain.

 

Possible problems:

  • You should consider to add a sort of blacklist system to prevent your clients from reserving particular subdomains like forum.example.com or blog.example.com... it could be very dangerous :evil:
  • If you don't want to play with DNS zones you could just create a wildcard A record to example.com so that you can freely create subdomains on the fly with a simple .htaccess file.

Edited by Kian
Link to comment
Share on other sites

There is a thing you should check for registering subdomains in WHMCS. Search forum threads...

 

What are you talking about buddy? This thread has little to do with registering sub-domains, and more to do with getting an account automatically created on a sub-domain and cPanel account off my main domain.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated