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 scripts to complete basic CPanel tasks.

Discussion in 'General Discussion' started by shytalk264, Aug 11, 2008.

  1. shytalk264

    shytalk264 Registered

    Joined:
    Aug 11, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hi guys: Since this is the Olympian season once again, I thought I'd go for gold on the most stupid newbie question on these forums ;)

    Bang: There's the gun and we're off!

    I feel there must have been written a simple bunch of PHP scripts to complete basic CPanel tasks like adding a new email account, forwarder or autoresponder. Something that could be called from the website's regular public_html folder by a normal [but well secured] PHP file - viz: setup_my_new_autoresponder.php

    After quite a bunch of searching miles I am without any real success. I've found references which are beyond my simple understanding [here] and old stuff that is now apparently not working on CPanel 11 [http://www.zubrag.com/scripts/ Clearly good stuff in its time but now apparently out of date].

    Before I try to reinvent what must surely be an already very well developed 'wheel' can somebody point me in the right direction, please?

    Many thanks - all contributions *very* gratefully received. PdeP.:eek:

    BTW: If that doesn't get the gold ... I shall be very surprised!
     
  2. djbob2

    djbob2 Well-Known Member

    Joined:
    May 14, 2005
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    Shytalk - try cPanel's new XMLAPI. An example of how it would be used to access cPanel see here. There is a class somewhere on the forums that will interface the XMLAPI with PHP.

    Alternately, try modifying the PHP cPanel Accounting API source code. With a tiny amount of modification you could make it call cPanel pages and get you the result.
     
    #2 djbob2, Aug 12, 2008
    Last edited: Aug 12, 2008
  3. shytalk264

    shytalk264 Registered

    Joined:
    Aug 11, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for that - but how about these?

    Thanks for that djbob2. I rather think adaptation of those are beyond my abilities.

    However since my original post I have found the attached. They are dated 3rd December 2006 and I think, for this reason, they don't work with CPanel v11 which I have.

    Anbody any idea please how I can get these brought up to date or adapted?

    Or maybe it's because I'm not calling them properly. Maybe somebody with CPanel 11 might like to check them out and let me know, please. TIA :)
     

    Attached Files:

  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator

    The fault with this script is that it does not use APIs (which, admittedly, were not available in 2006). Instead it relies on the old X theme of cPanel. New scripts should instead use our XML API so they are not affected by events such as interface enhancements.

    I know the APIs can be a bit daunting at first, but feel welcome to contact the sales team with any of your API questions. API1 and API2 via the XML-API can perform nearly any task that can be performed via the cPanel interface.
     
  5. djbob2

    djbob2 Well-Known Member

    Joined:
    May 14, 2005
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    As I mentioned, somebody already wrote a PHP wrapper class around the XMLAPI. Search the forums and you should be able to find it. If you know PHP my guess is that you'll be OK working with the wrapper class :)
     
  6. shytalk264

    shytalk264 Registered

    Joined:
    Aug 11, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Eureka! - You dont-ta smell-la so good yerself, gringo!

    Okay - I've got it now! Simple really when you catch on - like a lot of other things, I guess. All responses much appreciated.
     
Loading...

Share This Page