#!/usr/bin/perl
# cpanel - addon_munin.cgi                        Copyright(c) 2011 cPanel, Inc.
#                                                           All rights Reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited
#WHMADDON:munin:Munin Service Monitor
#ACLS:all

BEGIN { unshift @INC, '/usr/local/cpanel'; }

use Whostmgr::ACLS ();
Whostmgr::ACLS::init_acls();

if ( !Whostmgr::ACLS::hasroot() ) {
    print "Content-type: text/html\r\n\r\n";
    print "Access Denied: You do not have permission to view Munin stats.\n";
    exit;
}

my $security_token = $ENV{'cp_security_token'} || '';

print "Location: $security_token/munin/index.html\r\n\r\n";
