Jump to content

Custom "Suspended" Function


WSIIM

Recommended Posts

Hello everyone,

 

I am going to describe a process we want to see if it can be built into WHMCS, but we lack the in-house programming to make the modification IF it can be done, so here goes, any body who can help or advise method to accomplish this would be great.

 

 

We have clients hosted on:

<shared server>

<client 1>

<client 2>

etc. etc. etc.

 

The shared server has common FTP login. - The subfolders have a standardized directory structure which includes a sub folder called "suspended" and a HTML file in the root called suspended.bak

 

What we are needing: -- When we set a package to "suspended" in WHMCS we want a script to run that logs into the FTP location and subfolder set for that client in WHMCS custom fields, move all content except "suspended.bak" in that sub folder into the "suspended" sub folder, rename index.html to "index.sup" and finally rename "suspended.bak" to "index.html"

 

Of course when we change the clients status back to "Active" we would like the process reversed. ---

 

ANY help or suggestions on accomplishing this would be appreciated.

 

Thanks

Link to comment
Share on other sites

Not sure what your actual end result is here but i'm assuming you have a hosting client that when unpaid you wish to suspend.

 

Wouldn't it be easier to have the module just change the user password to a set password only you and your staff know and change it back when paid.

 

If its a apache based server you can also just hash out the site definition block out of your apache config or even redirect the "A" record for the DNS entry of that host.

Link to comment
Share on other sites

The suspended way sounds quite easy.

Using action hooks and the php ftp commends you would be able to ftp into the server and complete these tasks, as long as there is a standard ftp.

 

To be honest it sounds like the op is trying to run a reseller type service from a shared hosting account. Therefore only has the one ftp/whm account to edit. I don't thing they will have access to the apache files.

 

Either way feel free to contact me.

Link to comment
Share on other sites

Hi -

 

Best bet is to create your own module to do this. How custom is this custom hosting solution? Custom enough to use Plesk, or custom enough that you've written your own scripts to preform these actions?

 

I'd create a module, then add a custom button which preforms this action. A custom button can be implemented by using the vpn_AdminCustomButtonArray() function, and the other examples provided in the module development kit. Its not as difficult as it sounds, really.

 

Unfortunately, changing the Status of a product which is bound to a client account has no effect whatsoever on those Module buttons. I've been trying to find a way around that, but haven't come up with anything yet. I mean, if I change a client's status to Suspended, you'd think that would have an effect on the server or module that said server or service was tied to, right? Wrong :/

 

Thanks

-dant

Link to comment
Share on other sites

I mean, if I change a client's status to Suspended, you'd think that would have an effect on the server or module that said server or service was tied to, right? Wrong :/

 

When you do this on a product you are only editing the value on the record. The best way to do this would be to implement a "suspend" function on your module using your custom button array. One thing that the suspend should do is update the hosting record to be suspended. That said it would be interesting for whmcs to check if the status has changed and automatically run the suspended function.

Link to comment
Share on other sites

Hi -

 

I understand what effect suspend should have, sure. I'm half tempted to run a supplimentary cron looking for a change in the Status of the account, and just running my functions based on that. Ideally I'd love for WHMCS to actually run that custom Module function based on the Status variable. Regardless, at this point it still boils down to doing two things manually - adjusting the Status, and clicking the corresponding button for the Module. I want to do *one* of those, not both.

 

I've not been able to find out which $_REQUEST[] variable that Status drop-down is. Have you found this? I could just throw that in to my module and preform the action based on that.

 

Thanks!

-dant

Link to comment
Share on other sites

  • 3 weeks later...

Shaun (and all others in thread),

 

Thanks for the replies,

 

Let me try to better sum up what were doing and then maybe it will have a better picture of how were trying to accomplish this. We operate a web advertising business (Adwords and such) - we develop optimized web pages for the client, generate a advertising campaign and point the web ad's to that landing page. We also manage local profile pages we develop for some clients such as:

cosmetic-dentist-dallas-tx.com

or

carpet-cleaning-upholstery-care-dallas-tx.com

 

We do not control all of the DNS for the client domains, thus DNS could be registered at anyplace they choose. Also depending on the situation the hosting location for the web sites are sometimes at different hosting locations such as: domain.com or godaddy.com etc. etc. --

 

so.... we are basically trying to add custom fields to each client record the point to:

(hosting location 1) ---- ftp.(domain).com/(subfolder)

(ftp username)

(ftp password)

(hosting location 2) ---- ftp.(domain).com/(subfolder)

(ftp username)

(ftp password)

 

and so on and so on..... thus, when we change a clients status to suspended, a script/module or whatever is run that logs into each FTP account, moves site content into a sub folder called (suspended) and places or renames suspended.xxx into the domain folders root as index.html --- thus when the URL is navigated too the internet user sees the account suspended HTML instead of the site content.--- if/when the client fixes our issues with them we want to change there status to active in WHMCS and the script runs in reverse, change index.html to suspended.xxx and moves all site content from the suspended folder back into the root.

 

I guess this is problematic because we really don't sell hosting or domain registration but both of those are a part of what is necessary for the services we do perform, and we need a more efficient automated way to handle this suspension process across multiple hosting locations without all the manual FTP logins.

 

Sorry if this is long winded

Link to comment
Share on other sites

If your referring to the setting client status to suspend or active: right now were doing that by hand. Since we haven't been able to setup the locations in WHMCS as servers or otherwise the automation process hasn't worked fully for us.

Link to comment
Share on other sites

  • 3 years later...

I know this is an old thread but can whmcs suspend subfolders (not subdomains). I am a real estate photographer that uses my server to host slideshows/movies for realtors. These movies are put in subfolders and are viewable to the public.

Here is a run down of what I have to do as of right now...

-I create a new subfolder on my server.

-I have to put the files into the folder.

-I have to write in my calendar the client, property, and file location (on the server)

-11 months later I have to create an invoice for said client (for that property)

-If payment isnt received I have to manually go in and remove the files (or at least replace a primary file)

 

Any help would be great

Thanks

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