File: //var/softaculous/apps/git/gitweb/index.php
<?php
error_reporting(0); // Set E_ALL for debuging
// Include our sessions file
include_once('/usr/local/webuzo/sdk/sessions.php');
$webuzo_sess = new Webuzo_Sessions();
$logged_in = $webuzo_sess->isLogin();
// Send to login URL
if(empty($logged_in)){
$webuzo_sess->show_login();
}
if(posix_getuid() == 0){
$u = posix_getpwnam($webuzo_sess->user['user']);
posix_setgid($u['gid']);
posix_setuid($u['uid']);
// Set ENV
foreach ($_ENV as $key => $value) {
putenv($key.'='.$value);
}
}
// Set the uid and gid
if(posix_getuid() == 0 || $u['uid'] !== posix_getuid()){
die('Could not shift to the user level');
}
if(!file_exists('/usr/local/apps/perl/bin/perl')){
die('Perl is not installed , please install it first');
}
putenv('projectroot='.$u['dir']);
passthru('/usr/local/apps/perl/bin/perl '.$webuzo_sess->globals['appspath'].'/git/gitweb.cgi --no_http_header');