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.

Skinning Question

Discussion in 'General Discussion' started by jmunzing, Sep 2, 2005.

  1. jmunzing

    jmunzing Registered

    Joined:
    Jun 21, 2005
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    New Jersey
    I made a small script for a skin that I'm making to get the resellers domain name so that it links to the resellers site.

    This is pretty much all done with a small config file inside their /home/username/cpanelbranding/skinname/variable.php which has 3 variables that the reseller can set. (domain, link text, and the title of the link)

    My question is this, is it possible to have this script run on .html pages? Currently it is displaying the source code when the pages are .html

    PHP:
    <?PHP
    $owner 
    = <cpanel print="$CPDATA{'OWNER'}">;

    if(
    file_exists("/home/$owner/cpanelbranding/skinname/variable.php")) {
    include (
    "/home/$owner/cpanelbranding/skinname/variable.php");
    echo 
    "&copy; 2004-2005 <a href=\"$domain\" title=\"$alt\">$name</a>. All Rights Reserved.";
    } else {
    echo 
    "<font color=\"red\"><b>Error opening configuration file, please contact the server administrator.</b></font>";
    }
    ?>
    I am including this file by using <cpanel include="/home/username/rconf.php"> inside the stdfooter.html page. (works)

    I'm quite new to how cPanel has it's variables setup. :eek:

    Thanks alot to anyone who helps ;)
    Justin M.
     
  2. richy

    richy Well-Known Member

    Joined:
    Jun 30, 2003
    Messages:
    276
    Likes Received:
    1
    Trophy Points:
    16
    Be warned though - cPanel and WHM run "as root" so if you include PHP code on the WHM/cPanel pages this will be run as root. If your resellers put a simple "system ('passwd'..." style command in the variable.php they can change the root password.
     
  3. jmunzing

    jmunzing Registered

    Joined:
    Jun 21, 2005
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    New Jersey
    I did not know that. :eek: Thanks, I guess I will be doing it manually then.
     
Loading...

Share This Page