2 set_include_path(get_include_path() . PATH_SEPARATOR
. '../lib');
4 include_once("aur.inc.php");
5 include_once("pkgfuncs.inc.php");
7 $path = $_SERVER['PATH_INFO'];
8 $tokens = explode('/', $path);
10 if (isset($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) {
11 if (isset($tokens[2])) {
12 /* TODO: Create a proper data structure to pass variables from
13 * the routing framework to the individual pages instead of
14 * initializing arbitrary variables here. */
15 $pkgname = $tokens[2];
16 $pkgid = pkgid_from_name($pkgname);
18 if (isset($tokens[3])) {
19 if ($tokens[3] == 'voters') {
20 $_GET['ID'] = pkgid_from_name($tokens[2]);
21 include('voters.php');
25 /* TODO: Remove support for legacy URIs and move these
26 * actions to separate modules. */
29 $_POST['do_Vote'] = __('Vote');
32 $_POST['do_UnVote'] = __('UnVote');
35 $_POST['do_Notify'] = __('Notify');
38 $_POST['do_UnNotify'] = __('UnNotify');
41 $_POST['do_Flag'] = __('Flag');
44 $_POST['do_UnFlag'] = __('UnFlag');
47 include('pkgdel.php');
50 include('pkgmerge.php');
54 if (isset($_COOKIE['AURSID'])) {
55 $_POST['token'] = $_COOKIE['AURSID'];
58 $_POST['IDs'] = array(pkgid_from_name($tokens[2]) => '1');
62 include get_route('/' . $tokens[1]);
63 } elseif (isset($tokens[1]) && '/' . $tokens[1] == get_user_route()) {
64 if (isset($tokens[2])) {
65 $_REQUEST['U'] = $tokens[2];
67 if (isset($tokens[3])) {
68 if ($tokens[3] == 'edit') {
69 $_REQUEST['Action'] = "DisplayAccount";
70 } elseif ($tokens[3] == 'update') {
71 $_REQUEST['Action'] = "UpdateAccount";
73 $_REQUEST['Action'] = "AccountInfo";
76 $_REQUEST['Action'] = "AccountInfo";
79 include get_route('/' . $tokens[1]);
80 } elseif (get_route($path) !== NULL) {
81 include get_route($path);
84 case "/css/archweb.css":
86 case "/css/archnavbar/archnavbar.css":
87 header("Content-Type: text/css");
90 case "/css/archnavbar/archlogo.gif":
91 case "/images/new.png":
92 header("Content-Type: image/png");
95 case "/css/archnavbar/archlogo.png":
96 case "/images/AUR-logo-80.png":
97 case "/images/AUR-logo.png":
98 case "/images/favicon.ico":
99 case "/images/feed-icon-14x14.png":
100 case "/images/titlelogo.png":
101 case "/images/x.png":
102 header("Content-Type: image/png");
106 header("HTTP/1.0 404 Not Found");