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 (!empty($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) {
11 if (!empty($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 = pkg_from_name($pkgname);
19 header("HTTP/1.0 404 Not Found");
25 include get_route('/' . $tokens[1]);
26 } elseif (!empty($tokens[1]) && '/' . $tokens[1] == get_pkgbase_route()) {
27 if (!empty($tokens[2])) {
28 /* TODO: Create a proper data structure to pass variables from
29 * the routing framework to the individual pages instead of
30 * initializing arbitrary variables here. */
31 $pkgbase_name = $tokens[2];
32 $base_id = pkgbase_from_name($pkgbase_name);
35 header("HTTP/1.0 404 Not Found");
40 if (!empty($tokens[3])) {
41 /* TODO: Remove support for legacy URIs and move these
42 * actions to separate modules. */
45 $_POST['do_Adopt'] = __('Adopt');
48 include('pkgdisown.php');
51 $_POST['do_Vote'] = __('Vote');
54 $_POST['do_UnVote'] = __('UnVote');
57 $_POST['do_Notify'] = __('Notify');
60 $_POST['do_UnNotify'] = __('UnNotify');
63 $_POST['do_Flag'] = __('Flag');
66 $_POST['do_UnFlag'] = __('UnFlag');
69 include('pkgdel.php');
72 include('pkgmerge.php');
75 $_GET['N'] = $tokens[2];
76 include('voters.php');
79 include('pkgreq.php');
82 include('comaintainers.php');
85 header("HTTP/1.0 404 Not Found");
90 $_POST['IDs'] = array(pkgbase_from_name($tokens[2]) => '1');
94 include get_route('/' . $tokens[1]);
95 } elseif (!empty($tokens[1]) && '/' . $tokens[1] == get_pkgreq_route()) {
96 if (!empty($tokens[2])) {
97 /* TODO: Create a proper data structure to pass variables from
98 * the routing framework to the individual pages instead of
99 * initializing arbitrary variables here. */
100 if (!empty($tokens[3]) && $tokens[3] == 'close') {
101 $pkgreq_id = $tokens[2];
107 header("HTTP/1.0 404 Not Found");
113 include get_route('/' . $tokens[1]);
114 } elseif (!empty($tokens[1]) && '/' . $tokens[1] == get_user_route()) {
115 if (!empty($tokens[2])) {
116 $_REQUEST['ID'] = uid_from_username($tokens[2]);
118 if (!$_REQUEST['ID']) {
119 header("HTTP/1.0 404 Not Found");
124 if (!empty($tokens[3])) {
125 if ($tokens[3] == 'edit') {
126 $_REQUEST['Action'] = "DisplayAccount";
127 } elseif ($tokens[3] == 'update') {
128 $_REQUEST['Action'] = "UpdateAccount";
129 } elseif ($tokens[3] == 'delete') {
130 $_REQUEST['Action'] = "DeleteAccount";
132 header("HTTP/1.0 404 Not Found");
137 $_REQUEST['Action'] = "AccountInfo";
140 include get_route('/' . $tokens[1]);
141 } elseif (get_route($path) !== NULL) {
142 include get_route($path);
145 case "/css/archweb.css":
146 case "/css/aurweb.css":
147 case "/css/cgit.css":
148 case "/css/archnavbar/archnavbar.css":
149 header("Content-Type: text/css");
152 case "/css/archnavbar/archlogo.gif":
153 case "/images/new.png":
154 header("Content-Type: image/png");
157 case "/css/archnavbar/archlogo.png":
158 case "/css/archnavbar/aurlogo.png":
159 case "/images/AUR-logo-80.png":
160 case "/images/AUR-logo.png":
161 case "/images/favicon.ico":
162 case "/images/feed-icon-14x14.png":
163 case "/images/titlelogo.png":
164 case "/images/x.png":
165 header("Content-Type: image/png");
168 case "/js/bootstrap-typeahead.min.js":
169 header("Content-Type: application/javascript");
174 header("Content-Type: text/plain");
175 header("Content-Encoding: gzip");
179 header("HTTP/1.0 404 Not Found");