The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP Interfacing with WHM

Discussion in 'General Discussion' started by Hero Doug, Jul 6, 2004.

  1. Hero Doug

    Hero Doug Registered

    Joined:
    Jul 6, 2004
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I was looking at modern bill and noticed that they have a feature where if a payment is late, they'll suspend the account, when they payment is made they'll unsuspend the account.

    http://www.modernbill.com/features/index.htm?type=newfeatures

    I was wondering how they interfaced with Cpanel to accomplish this?

    I'd like to have a feature like this in my billing software (It's custom) as well.
     
  2. FriedEgg

    FriedEgg Active Member

    Joined:
    Sep 27, 2003
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Washington, DC
    It looks like CPanel recommends the use of the Remote Access Key and Cpanel::Accounting module for Perl.

    http://web.cpanel.net/manual/remoteaccess.html

    There's even a "Suspend" method listed.

    Another way to do it using PHP might be to use curl (in php) to open an https session to the server with authentication as root (or another user with access to suspensions). You could then call the WHM script that handles suspension, ie /scripts2/suspendacct?... etc. It wouldn't even require a POST form submit. The problem of course would be you'd have the user's password stored somewhere, so you'd need to handle that carefully.
     
  3. Hero Doug

    Hero Doug Registered

    Joined:
    Jul 6, 2004
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    That's a good link, but appears to be for Perl, it shouldn't be hard to do it with Curl. The hardest part would be accessing the correct server that's all.

    I just thought they may have had an interface already designed like a payment gateway has.
     
  4. deathy

    deathy Active Member

    Joined:
    Apr 11, 2003
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
Loading...

Share This Page