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.

create addon to whm with php now

Discussion in 'General Discussion' started by aoc, Jan 6, 2007.

  1. aoc

    aoc Member

    Joined:
    Nov 9, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    hi there,

    this post is for php, perl or C programers, that they can create new script and add command link in WHM menu and work as root.

    i'll give you an example now, i don't like to talk alot with security matters, there is no security problems because your scripts will work as root and you can't work with it until you log into WHM http://yourserver:2086/ or the ssl link.

    let's begin:

    first step use SSH to login as root

    type this commands

    # cd /usr/local/cpanel/whostmgr/docroot/cgi
    # mkdir example
    # chmod 0755 example

    i'll use pico text editor
    we will create a file under /usr/local/cpanel/whostmgr/docroot/cgi
    called addon_example.cgi

    this file will called from WHM menu and will redirect to our example directory

    # pico addon_example.cgi

    pico will open

    copy and paste this code in it

    Code:
    #!/usr/local/bin/perl
    
    #WHMADDON:example:Example WHM Admin
    
    print "Content-Type: text/html\n\n";
    print '<meta http-equiv="refresh" content="0;url=/cgi/example/example.php"/>' ;
    and click <Ctrl+O> and <Ctrl+X>

    now do this commands

    # chmod 0755 addon_example.cgi
    # cd example
    # pico example.php

    now type any php code inside or just text

    use this for example

    Code:
    My Script Is Working
    now save the file and exit click <Ctrl+O> and <Ctrl+X>

    go to your site whm panel
    http//yourserver:2086 or https://yourserver:2087

    after login as root to whm scroll the left menu to the last one :)
    yes it's the script Example

    click it

    i hope this start will make programmers do amazing addons for whm

    regards
     
    #1 aoc, Jan 6, 2007
    Last edited: Jan 6, 2007
  2. aoc

    aoc Member

    Joined:
    Nov 9, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    for Advance use

    you can create support script uses can use www script like http://yourdomain/support/

    and you can use a database for that you can create complete script that they can post support tickets from the site and stored in a database

    and as a root you can connect to it using your own script to manage this tickets inside WHM.


    about Accounting.php.inc

    here you can include it to your script without any problem for permissions

    it's easy to be working inside WHM..

    your script not conflect with athor whm you can use your own script connecting to database you can add google inside it :>

    its work like iframe

    waiting for your addons
     
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
  4. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    There's a related extensive tutorial covering adding internal WHM functions, not the same as this (which is about making WHM addons which can be used directly from the WHM user interface) available here:

    http://forums.cpanel.net/showthread.php?t=46362 (it's a sticky)
     
  5. aoc

    aoc Member

    Joined:
    Nov 9, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    many ways to do it.. take what you see that it's the easy one.

    thanks
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    I'd like to sort my addons list. How tough is that? :)
     
  7. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Infopro - that is one funny signature ;)
     
  8. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Yup, LMFAO :D
     
  9. wzd

    wzd Well-Known Member

    Joined:
    Dec 16, 2005
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    South Africa
    cPanel Access Level:
    Root Administrator
    #9 wzd, Jan 16, 2007
    Last edited: Jan 16, 2007
Loading...

Share This Page