+ Reply to Thread
Results 1 to 3 of 3

Thread: Custom WHM Addon

  1. #1
    phpforfun's Avatar
    phpforfun is offline Speaks fluent binary
    Join Date
    Feb 2008
    Posts
    1,232
    Blog Entries
    17
    Rep Power
    24

    Custom WHM Addon

    Here is my example of the Hello World WHM Addon for the admins and resellers.

    Its easy! Simply make a CGI Script, name it addon_Hello_World.cgi

    Upload it here: /usr/local/cpanel/whostmgr/docroot/cgi/

    Here is the code to put in it
    Code:
    #!/usr/bin/perl
    #WHMADDON:helloworld:Hello World, by  <b>Justin</b>
    ###############################################################################
    #    This is an example hello world WHM plugin feel free to modify it as you see fit
    ###############################################################################
    # Load general use case perl modules
    use lib '/usr/local/cpanel';
    use 
    Cpanel::cPanelFunctions ();
    use 
    Cpanel::Form            ();
    use 
    Cpanel::Config          ();
    use 
    Whostmgr::HTMLInterface ();
    use 
    Whostmgr::ACLS          ();
    ###############################################################################

    print "Content-type: text/html\r\n\r\n";

    # Check user has root permissions
    Whostmgr::ACLS::init_acls();
    if ( !
    Whostmgr::ACLS::hasroot() ) {
        
    # User is not root, tell them where to go
        
    print "You need to be root to see execute this script.\n";
        exit();
    }

    # Parse input parameters from GET and POST into $FORM{} for later use
    my %FORM     Cpanel::Form::parseform();

    # Print a WHM Header
    Whostmgr::HTMLInterface::defheader"Custom Addon Hello World",'/path/to/logo.gif''/cgi/addon_Hello_World.cgi' );

    # Print General Output
    print "This is the hello world addon, you can also put a meta refresh tag in here to forward to a php page, make sure its chmod and chowned to the right permissions!";

    # End Example

    1
    I will post one on how to make a cpanel addon when I learn
    Checkout my new forum! http://adminreference.com/

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Grub is offline Learning Programmer
    Join Date
    Dec 2006
    Posts
    57
    Rep Power
    0
    What language is this in?

  4. #3
    Join Date
    Feb 2009
    Posts
    11
    Rep Power
    0
    Quote Originally Posted by Grub View Post
    What language is this in?

    its written in perl

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. problem using javascript in mozilla addon
    By exilonX in forum JavaScript and CSS
    Replies: 0
    Last Post: 08-24-2011, 06:35 AM
  2. Replies: 11
    Last Post: 01-20-2011, 12:52 PM
  3. IETab-like addon for Mac? Firefox 3.
    By ZipOnTrousers in forum HTML Programming
    Replies: 3
    Last Post: 12-15-2008, 07:26 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts