Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    May 2004
    Location
    Lansing, MI, USA
    Posts
    53

    Default Auto-inserted footer comment tag in cPanel -- How to remove?

    Here's a fun one for you guys,

    So, I'm working on some cPanel enhancements, and part of one is doing a file download.

    The simplest solution is to be able to pipe the download through the php code... something like:

    Code:
        header('content-transfer-encoding: binary');
        header('content-disposition: inline; filename="file.tar.gz"');
        header('content-type: application/x-tar');
        echo file_get_contents($f);
    However, I am running into a minor issue:

    at the bottom of every cpanel generated page, cPanel automatically adds:

    Code:
    <!-- cPanel [<<VERSION>>] Copyright (c) 1997-2008 cPanel, Inc. Licensed on <<HOST>> -->
    Is there any way to disable/get around this tag being added? I'd prefer to not have to place the download script in /usr/local/apache/htdocs/ just to get around it.

    It seems to be added after the script is finished running, as I don't see any auto_append's set in php's config.
    Jacob - WebOnce Technologies - 30 Day 100% Satisfaction Guarantee - Hosting worth (at least) two cups of coffee!
    PHP4 and PHP5 cPanel Web Hosting, Ruby on Rails, MySQL 5, Reseller Hosting, Development, and Designs
    Quality Hosting at Sustainable Prices

  2. #2
    cPanel Staff cpanelnick's Avatar
    Join Date
    Feb 2003
    Location
    Houston, TX
    Posts
    4,597

    Default

    Quote Originally Posted by WebOnce View Post
    Here's a fun one for you guys,

    So, I'm working on some cPanel enhancements, and part of one is doing a file download.



    The simplest solution is to be able to pipe the download through the php code... something like:

    Also Here: http://httpupdate.cpanel.net/cpanels...php/README.TXT

    Code:
        header('content-transfer-encoding: binary');
        header('content-disposition: inline; filename="file.tar.gz"');
        header('content-type: application/x-tar');
        echo file_get_contents($f);
    However, I am running into a minor issue:

    at the bottom of every cpanel generated page, cPanel automatically adds:

    Code:
    <!-- cPanel [<<VERSION>>] Copyright (c) 1997-2008 cPanel, Inc. Licensed on <<HOST>> -->
    Is there any way to disable/get around this tag being added? I'd prefer to not have to place the download script in /usr/local/apache/htdocs/ just to get around it.

    It seems to be added after the script is finished running, as I don't see any auto_append's set in php's config.
    You can use the livephp cpanel connector. Here are some basic instructions:

    Code:
    Input (must have the .livephp ext and reside in /usr/local/cpanel/base/frontend/*/...):
    <?php
    
    include("/usr/local/cpanel/php/cpanel.php");
    
    
    $cpanel = &new CPANEL();
    print_r  ( $cpanel->exec('<cpanel print="cow">') );
    print_r  ( $cpanel->api1('print','',array('cow')) );
    print_r  ( $cpanel->exec('<cpanel setvar="debug=0">') );
    print_r  ( $cpanel->api('exec',1,'print','',array('cow')) );
    print_r  ( $cpanel->cpanelprint('$homedir') );
    print_r  ( $cpanel->cpanelprint('$hasvalidshell') );
    print_r  ( $cpanel->cpanelprint('$isreseller') );
    print_r  ( $cpanel->cpanelprint('$isresellerlogin') );
    print_r  ( $cpanel->exec('<cpanel Branding="file(local.css)">') );
    print_r  ( $cpanel->exec('<cpanel Branding="image(ftpaccounts)">') );
    print_r  ( $cpanel->api2('Email','listpopswithdisk',array("acct"=>1) ) ) ;
    print_r  ( $cpanel->fetch('$CPDATA{\'DNS\'}') );
    print_r  ( $cpanel->api2('Ftp','listftpwithdisk',array("skip_acct_types"=>'sub') ) ) ;
    
    if ( $cpanel->cpanelif('$haspostgres') ) { print "Postgres is installed\n"; }
    if ( $cpanel->cpanelif('!$haspostgres') ) { print "Postgres is not installed\n"; }
    if ($cpanel->cpanelfeature("fileman")) {
            print "The file manager feature is enabled\n";
    }
    
    $cpanel->end();
    
    ?>
    
    Result:
    
    Array
    (
        [cpanelresult] => Array
            (
                [command] => print
                [type] => internal
                [source] => internal
                [apiversion] => 1
                [data] => Array
                    (
                        [result] => cow
                    )
    
            )
    
    )
    Array
    (
        [cpanelresult] => Array
            (
                [command] => print
                [type] => internal
                [source] => internal
                [apiversion] => 1
                [data] => Array
                    (
                        [result] => cow
                    )
    
            )
    
    )
    Array
    (
        [cpanelresult] => Array
            (
                [command] => setvar
                [type] => internal
                [source] => internal
                [apiversion] => 1
                [data] => Array
                    (
                        [result] =>
                    )
           )
    
    )
    Array
    (
        [cpanelresult] => Array
            (
                [command] => print
                [type] => internal
                [source] => internal
                [apiversion] => 1
                [data] => Array
                    (
                        [result] => cow
                    )
    
            )
    
    )
    /home/nick011Array
    (
        [cpanelresult] => Array
            (
                [module] => Branding
                [func] => file
                [type] => event
                [source] => module
                [apiversion] => 1
                [data] => Array
                    (
                        [result] => /frontend/x3test/branding//local.css
                    )
    
            )
    
    )
    Array
    (
        [cpanelresult] => Array
            (
                [module] => Branding
                [func] => image
                [type] => event
                [source] => module
                [apiversion] => 1
                [data] => Array
                    (
                        [result] => /frontend/x3test/branding//ftpaccounts.jpg
                    )
    
            )
    
    )
    Array
    (
        [cpanelresult] => Array
            (
                [apiversion] => 2
                [data] => Array
                    (
                        [0] => Array
                            (
                                [_diskquota] => 10.00
                                [_diskused] => 0.00
                                [diskquota] => 10.00
                                [diskused] => 0.00
                                [diskusedpercent] => 0
                                [diskusedpercent20] => 0
                                [domain] => pi.nt
                                [email] => bob@pi.nt
                                [login] => bob@pi.nt
                                [txtdiskquota] => 10.00
                                [user] => bob
                            )
    
                        [1] => Array
                            (
                                [_diskquota] => 10.00
                                [_diskused] => 0.00
                                [diskquota] => 10.00
                                [diskused] => 0.00
                                [diskusedpercent] => 0
                                [diskusedpercent20] => 0
                                [domain] => pi.nt
                                [email] => lkl@pi.nt
                                [login] => lkl@pi.nt
                                [txtdiskquota] => 10.00
                                [user] => lkl
                            )
    
                    )
    
                [func] => listpopswithdisk
                [module] => Email
            )
    
    )
    Array
    (
        [cpanelresult] => Array
            (
                [command] => print
                [type] => internal
                [source] => internal
                [apiversion] => 1
                [data] => Array
                    (
                        [result] => pi.nt
                    )
    
            )
    
    )
    Array
    (
        [cpanelresult] => Array
            (
                [apiversion] => 2
                [data] => Array
                    (
                        [0] => Array
                            (
                                [_diskquota] => 4344.00
                                [_diskused] => 0.00
                                [accttype] => anonymous
                                [deleteable] => 0
                                [dir] => /home/nick/public_ftp
                                [diskquota] => 4344.00
                                [diskused] => 0.00
                                [diskusedpercent] => 0
                                [diskusedpercent20] => 0
                                [htmldir] =>
                                [login] => anonymous
                                [reldir] => public_ftp
                                [serverlogin] => anonymous@pi.nt
                            )
    
                        [1] => Array
                            (
                                [_diskquota] => 4344.00
                                [_diskused] => 0.00
                                [accttype] => anonymous
                                [deleteable] => 0
                                [dir] => /home/nick/public_ftp
                                [diskquota] => 4344.00
                                [diskused] => 0.00
                                [diskusedpercent] => 0
                                [diskusedpercent20] => 0
                                [htmldir] =>
                                [login] => ftp
                                [reldir] => public_ftp
                                [serverlogin] => ftp@pi.nt
                            )
    
                        [2] => Array
                            (
                                [_diskquota] => 0.00
                                [_diskused] => 0.00
                                [accttype] => main
                                [deleteable] => 1
                                [dir] => /home/nick
                                [diskquota] => unlimited
                                [diskused] => 0.00
                                [diskusedpercent] => 0
                                [diskusedpercent20] => 0
                                [htmldir] =>
                                [login] => nick
                                [reldir] =>
                                [serverlogin] => nick
                            )
    
                        [3] => Array
                            (
                                [_diskquota] => 0.00
                                [_diskused] => 0.00
                                [accttype] => logaccess
                                [deleteable] => 1
                                [dir] => /usr/local/apache/domlogs
                                [diskquota] => unlimited
                                [diskused] => 0.00
                                [diskusedpercent] => 0
                                [diskusedpercent20] => 0
                                [htmldir] =>
                                [login] => nick_logs
                                [reldir] => usr/local/apache/domlogs
                                [serverlogin] => nick_logs
                            )
    
                    )
    
                [func] => listftpwithdisk
                [module] => Ftp
            )
    
    )
    Postgres is installed
    The file manager feature is enabled

  3. #3
    Member
    Join Date
    May 2004
    Location
    Lansing, MI, USA
    Posts
    53

    Default

    Nick,

    That was absolutely what I needed. Just had to change it from .php to .livephp and it works great! Thanks
    Jacob - WebOnce Technologies - 30 Day 100% Satisfaction Guarantee - Hosting worth (at least) two cups of coffee!
    PHP4 and PHP5 cPanel Web Hosting, Ruby on Rails, MySQL 5, Reseller Hosting, Development, and Designs
    Quality Hosting at Sustainable Prices

Similar Threads & Tags
Similar threads

  1. recursive folders /usr/local/cpanel/perl/auto/auto/auto/auto...
    By bigste in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-14-2009, 11:52 PM
  2. How to remove JAvascript inserted line
    By gallot in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 09-14-2007, 01:44 PM
  3. Replies: 1
    Last Post: 04-15-2007, 05:00 AM
  4. remove auto redirection
    By crllbr in forum New User Questions
    Replies: 1
    Last Post: 02-23-2005, 11:48 AM
  5. how can I use header/footer of my site with cPanel?
    By getyouhosting in forum Themes and Branding
    Replies: 3
    Last Post: 05-31-2004, 02:54 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube