mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Move package actions to package bases
Package actions now operate on package bases instead of packages. Move all actions to the correct locations. This also fixes some issues with comment notifications. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
c1c77836a8
commit
f461344211
11 changed files with 175 additions and 171 deletions
|
@ -20,6 +20,22 @@ if (!empty($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) {
|
|||
include "./404.php";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
include get_route('/' . $tokens[1]);
|
||||
} elseif (!empty($tokens[1]) && '/' . $tokens[1] == get_pkgbase_route()) {
|
||||
if (!empty($tokens[2])) {
|
||||
/* TODO: Create a proper data structure to pass variables from
|
||||
* the routing framework to the individual pages instead of
|
||||
* initializing arbitrary variables here. */
|
||||
$pkgbase_name = $tokens[2];
|
||||
$base_id = pkgbase_from_name($pkgbase_name);
|
||||
|
||||
if (!$base_id) {
|
||||
header("HTTP/1.0 404 Not Found");
|
||||
include "./404.php";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!empty($tokens[3])) {
|
||||
/* TODO: Remove support for legacy URIs and move these
|
||||
|
@ -65,23 +81,7 @@ if (!empty($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) {
|
|||
return;
|
||||
}
|
||||
|
||||
$_POST['IDs'] = array(pkgid_from_name($tokens[2]) => '1');
|
||||
}
|
||||
}
|
||||
|
||||
include get_route('/' . $tokens[1]);
|
||||
} elseif (!empty($tokens[1]) && '/' . $tokens[1] == get_pkgbase_route()) {
|
||||
if (!empty($tokens[2])) {
|
||||
/* TODO: Create a proper data structure to pass variables from
|
||||
* the routing framework to the individual pages instead of
|
||||
* initializing arbitrary variables here. */
|
||||
$pkgbase_name = $tokens[2];
|
||||
$base_id = pkgbase_from_name($pkgbase_name);
|
||||
|
||||
if (!$base_id) {
|
||||
header("HTTP/1.0 404 Not Found");
|
||||
include "./404.php";
|
||||
return;
|
||||
$_POST['IDs'] = array(pkgbase_from_name($tokens[2]) => '1');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue