3 $
include_path=
".:bugs";
4 $
bugs_configuration_path=
"./";
5 require(
"bugs_globals.php");
6 require(
"bugs_locale.php");
7 include(IncludeRelativePath($configuration-
>shared_include_file));
9 if($configuration-
>require_authenticated_access)
11 include(
"bugs_accounts.php");
12 if(!BugsValidateAccess(
""))
14 commonHeader(LocaleText(
"restricted-access-page"));
21 || !file_exists($perl_path))
22 $configuration-
>Debug(
"CVS Web configuration problem",
"It was not defined a valid path for perl!\n");
24 || !@is_dir($cvsroot))
25 $configuration-
>Debug(
"CVS Web configuration problem",
"It was not defined a valid cvs root directory!\n");
28 "PATH_INFO=\"".getenv("PATH_INFO
")."\
" ".
29 "SCRIPT_NAME=\"".getenv("SCRIPT_NAME
")."\
" ".
30 "QUERY_STRING=\"".getenv("QUERY_STRING
")."\
" ".
31 "SERVER_ADMIN=\"".getenv("SERVER_ADMIN
")."\
" ".
32 "SERVER_NAME=\"".getenv("SERVER_NAME
")."\
" ".
33 "HTTP_USER_AGENT=\"".getenv("HTTP_USER_AGENT
")."\
" ".
34 "HTTP_ACCEPT_ENCODING=\"".getenv("HTTP_ACCEPT_ENCODING
")."\
" ".
35 ($cvs_path!=
"" ?
"PATH=\"".$cvs_path.":\$PATH\
" " :
"").
36 "CVSROOT=\"".$cvsroot."\
" ".
37 "CVSWEB_CONFIG=cvsweb.conf ".
38 $perl_path.
" 2>&1 -ws ./cvsweb";
39 Exec($command,$output,$status);
41 $configuration-
>Debug(
"CVS Web execution problem",
"Command: \"$command\
"\nStatus: $status!\nOutput:\n".implode($output,
"\n"));
42 for($in_headers=
1,$headers=array(),$
content_type=
"",$line=
0;$line
<count($output);$line++)
46 switch(strtok(strtolower($output[$line]),
":\n\r"))
50 if(IsSet($PHP_AUTH_USER)
51 && $PHP_AUTH_USER!=
"bgui-dev"
52 && $content_type!=
" text/html")
54 Header(
"WWW-authenticate: basic realm=\"$configuration-
>access_realm\
"");
55 Header(
"HTTP/1.0 401 Unauthorized");
56 Header(
"Content-Type: text/plain");
57 echo
"The access to this resource is restricted to BGUI developers.";
60 for($header=
0;$header
<count($headers);$header++)
61 Header($headers[$header]);
64 $headers[]=
"HTTP/1.0 ".strtok(
"\n\r");
67 $content_type=strtok(
"\n\r");
69 $headers[]=strtok($output[$line],
"\n\r");
74 echo $output[$line],
"\n";