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.

Can I get info from cpanel environment when trying to build a plugin?

Discussion in 'cPanel Developers' started by webguyz, Aug 12, 2012.

  1. webguyz

    webguyz Member

    Joined:
    Sep 13, 2011
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    Trying to create a link that will take a user to an external mail server mangement tool but need to be able to specify which domain the request is coming form

    http://my.mymailserver.com/index.php?domain=<cPanel Domain name>

    Need to be able to replace <cPanel Domain name> above with the actual domain name for the cpanel user

    http://my.mymailserver.com/index.php?domain=acme.com

    So when the user clicks on it the receiving server knows which domain admin is logging in.

    Thanks!
     
  2. KostonConsulting

    KostonConsulting Well-Known Member

    Joined:
    Jun 17, 2010
    Messages:
    255
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    San Francisco, CA
    cPanel Access Level:
    Root Administrator
    In your plugin file, use this variable for the domain: $CPDATA{'DNS'}

    Here's a list of the variables you can use with plugins: Available cPanel Plugin Variables
     
  3. webguyz

    webguyz Member

    Joined:
    Sep 13, 2011
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    Thanks. Stumbled across this late last night as well and it looks like exactly what I need.
     
  4. geck

    geck Member
    Staff Member

    Joined:
    Aug 9, 2012
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    For other environmental bits, StatsBar::stat is pretty handy

    StatsBar Module Documentation

    basically StatsBar::stat(display => 'foo|bar|baz' ) to call it.
     
Loading...

Share This Page