disable the unrecognized nls and x flags
[AROS-Contrib.git] / bgui / website / cvsweb.html
blob8566faf33f6eeb8413e0e4be09dee14e3fd3c072
1 <?
2 $configuring=0;
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"));
15 commonFooter();
16 exit;
20 if(!IsSet($perl_path)
21 || !file_exists($perl_path))
22 $configuration->Debug("CVS Web configuration problem","It was not defined a valid path for perl!\n");
23 if(!IsSet($cvsroot)
24 || !@is_dir($cvsroot))
25 $configuration->Debug("CVS Web configuration problem","It was not defined a valid cvs root directory!\n");
26 Unset($output);
27 $command=
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);
40 if($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++)
44 if($in_headers)
46 switch(strtok(strtolower($output[$line]),":\n\r"))
48 case "":
49 $in_headers=0;
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.";
58 exit;
60 for($header=0;$header<count($headers);$header++)
61 Header($headers[$header]);
62 break;
63 case "status":
64 $headers[]="HTTP/1.0 ".strtok("\n\r");
65 break;
66 case "content-type":
67 $content_type=strtok("\n\r");
68 default:
69 $headers[]=strtok($output[$line],"\n\r");
70 break;
73 else
74 echo $output[$line],"\n";