summaryrefslogtreecommitdiffstats
path: root/web/html/pkgbase.php
blob: e0c9af69b49966a591046122babd05852dbc84a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php

set_include_path(get_include_path() . PATH_SEPARATOR . '../lib');

include_once("aur.inc.php");
set_lang();
include_once('pkgfuncs.inc.php');
check_sid();

/*
 * Retrieve package base ID and name, unless initialized by the routing
 * framework.
 */
if (!isset($base_id) || !isset($pkgbase_name)) {
	if (isset($_GET['ID'])) {
		$base_id = intval($_GET['ID']);
		$pkgbase_name = pkgbase_name_from_id($_GET['ID']);
	} else if (isset($_GET['N'])) {
		$base_id = pkgbase_from_name($_GET['N']);
		$pkgbase_name = $_GET['N'];
	} else {
		unset($base_id, $pkgbase_name);
	}

	if ($base_id == 0 || $base_id == NULL || $pkgbase_name == NULL) {
		header("HTTP/1.0 404 Not Found");
		include "./404.php";
		return;
	}
}

/* Set the title to package base name. */
$title = $pkgbase_name;

/* Retrieve account type. */
if (isset($_COOKIE["AURSID"])) {
	$atype = account_from_sid($_COOKIE["AURSID"]);
} else {
	$atype = "";
}

$details = get_pkgbase_details($base_id);
html_header($title, $details);
?>

<?php
include('pkg_search_form.php');
if (isset($_COOKIE["AURSID"])) {
	display_pkgbase_details($base_id, $details, $_COOKIE["AURSID"]);
} else {
	display_pkgbase_details($base_id, $details, null);
}

html_footer(AUR_VERSION);