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";
|
include "./404.php";
|
||||||
return;
|
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])) {
|
if (!empty($tokens[3])) {
|
||||||
/* TODO: Remove support for legacy URIs and move these
|
/* TODO: Remove support for legacy URIs and move these
|
||||||
|
@ -65,23 +81,7 @@ if (!empty($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$_POST['IDs'] = array(pkgid_from_name($tokens[2]) => '1');
|
$_POST['IDs'] = array(pkgbase_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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,77 +42,6 @@ if (isset($_COOKIE["AURSID"])) {
|
||||||
$atype = "";
|
$atype = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Grab the list of Package IDs to be operated on
|
|
||||||
$ids = array();
|
|
||||||
if (isset($_POST['IDs'])) {
|
|
||||||
foreach ($_POST['IDs'] as $id => $i) {
|
|
||||||
$id = intval($id);
|
|
||||||
if ($id > 0) {
|
|
||||||
$ids[] = $id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Determine what action to do
|
|
||||||
$ret = false;
|
|
||||||
$output = "";
|
|
||||||
if (check_token()) {
|
|
||||||
if (current_action("do_Flag")) {
|
|
||||||
list($ret, $output) = pkg_flag($atype, $ids);
|
|
||||||
} elseif (current_action("do_UnFlag")) {
|
|
||||||
list($ret, $output) = pkg_unflag($atype, $ids);
|
|
||||||
} elseif (current_action("do_Adopt")) {
|
|
||||||
list($ret, $output) = pkg_adopt($atype, $ids, true);
|
|
||||||
} elseif (current_action("do_Disown")) {
|
|
||||||
list($ret, $output) = pkg_adopt($atype, $ids, false);
|
|
||||||
} elseif (current_action("do_Vote")) {
|
|
||||||
list($ret, $output) = pkg_vote($atype, $ids, true);
|
|
||||||
} elseif (current_action("do_UnVote")) {
|
|
||||||
list($ret, $output) = pkg_vote($atype, $ids, false);
|
|
||||||
} elseif (current_action("do_Delete")) {
|
|
||||||
if (isset($_POST['confirm_Delete'])) {
|
|
||||||
if (!isset($_POST['merge_Into']) || empty($_POST['merge_Into'])) {
|
|
||||||
list($ret, $output) = pkg_delete($atype, pkgbase_from_pkgid($ids), NULL);
|
|
||||||
unset($_GET['ID']);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$merge_base_id = pkgbase_from_name($_POST['merge_Into']);
|
|
||||||
if ($merge_base_id) {
|
|
||||||
list($ret, $output) = pkg_delete($atype, pkgbase_from_pkgid($ids), $merge_base_id);
|
|
||||||
unset($_GET['ID']);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$output = __("Cannot find package to merge votes and comments into.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$output = __("The selected packages have not been deleted, check the confirmation checkbox.");
|
|
||||||
}
|
|
||||||
} elseif (current_action("do_Notify")) {
|
|
||||||
list($ret, $output) = pkg_notify($atype, $ids);
|
|
||||||
} elseif (current_action("do_UnNotify")) {
|
|
||||||
list($ret, $output) = pkg_notify($atype, $ids, false);
|
|
||||||
} elseif (current_action("do_DeleteComment")) {
|
|
||||||
list($ret, $output) = pkg_delete_comment($atype);
|
|
||||||
} elseif (current_action("do_ChangeCategory")) {
|
|
||||||
list($ret, $output) = pkg_change_category($pkgid, $atype);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_REQUEST['comment'])) {
|
|
||||||
$uid = uid_from_sid($_COOKIE["AURSID"]);
|
|
||||||
add_package_comment($pkgid, $uid, $_REQUEST['comment']);
|
|
||||||
$ret = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($ret) {
|
|
||||||
/* Redirect back to package page on success. */
|
|
||||||
header('Location: ' . get_pkg_uri($pkgname));
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Get package details after package actions have been attempted, FS#34508
|
|
||||||
$details = array();
|
$details = array();
|
||||||
if (isset($pkgname)) {
|
if (isset($pkgname)) {
|
||||||
$details = get_package_details($pkgid);
|
$details = get_package_details($pkgid);
|
||||||
|
@ -121,10 +50,6 @@ if (isset($pkgname)) {
|
||||||
html_header($title, $details);
|
html_header($title, $details);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if ($output): ?>
|
|
||||||
<p class="pkgoutput"><?= $output ?></p>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (isset($pkgid)) {
|
if (isset($pkgid)) {
|
||||||
include('pkg_search_form.php');
|
include('pkg_search_form.php');
|
||||||
|
|
|
@ -22,7 +22,7 @@ if (!isset($base_id) || !isset($pkgbase_name)) {
|
||||||
unset($base_id, $pkgbase_name);
|
unset($base_id, $pkgbase_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($base_id == 0 || $base_id == NULL || $pkgbase_name == NULL) {
|
if (isset($base_id) && ($base_id == 0 || $base_id == NULL || $pkgbase_name == NULL)) {
|
||||||
header("HTTP/1.0 404 Not Found");
|
header("HTTP/1.0 404 Not Found");
|
||||||
include "./404.php";
|
include "./404.php";
|
||||||
return;
|
return;
|
||||||
|
@ -39,10 +39,90 @@ if (isset($_COOKIE["AURSID"])) {
|
||||||
$atype = "";
|
$atype = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Grab the list of package base IDs to be operated on. */
|
||||||
|
$ids = array();
|
||||||
|
if (isset($_POST['IDs'])) {
|
||||||
|
foreach ($_POST['IDs'] as $id => $i) {
|
||||||
|
$id = intval($id);
|
||||||
|
if ($id > 0) {
|
||||||
|
$ids[] = $id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Perform package base actions. */
|
||||||
|
$ret = false;
|
||||||
|
$output = "";
|
||||||
|
if (check_token()) {
|
||||||
|
if (current_action("do_Flag")) {
|
||||||
|
list($ret, $output) = pkg_flag($atype, $ids);
|
||||||
|
} elseif (current_action("do_UnFlag")) {
|
||||||
|
list($ret, $output) = pkg_unflag($atype, $ids);
|
||||||
|
} elseif (current_action("do_Adopt")) {
|
||||||
|
list($ret, $output) = pkg_adopt($atype, $ids, true);
|
||||||
|
} elseif (current_action("do_Disown")) {
|
||||||
|
list($ret, $output) = pkg_adopt($atype, $ids, false);
|
||||||
|
} elseif (current_action("do_Vote")) {
|
||||||
|
list($ret, $output) = pkg_vote($atype, $ids, true);
|
||||||
|
} elseif (current_action("do_UnVote")) {
|
||||||
|
list($ret, $output) = pkg_vote($atype, $ids, false);
|
||||||
|
} elseif (current_action("do_Delete")) {
|
||||||
|
if (isset($_POST['confirm_Delete'])) {
|
||||||
|
if (!isset($_POST['merge_Into']) || empty($_POST['merge_Into'])) {
|
||||||
|
list($ret, $output) = pkg_delete($atype, $ids, NULL);
|
||||||
|
unset($_GET['ID']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$merge_base_id = pkgbase_from_name($_POST['merge_Into']);
|
||||||
|
if ($merge_base_id) {
|
||||||
|
list($ret, $output) = pkg_delete($atype, $ids, $merge_base_id);
|
||||||
|
unset($_GET['ID']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$output = __("Cannot find package to merge votes and comments into.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$output = __("The selected packages have not been deleted, check the confirmation checkbox.");
|
||||||
|
}
|
||||||
|
} elseif (current_action("do_Notify")) {
|
||||||
|
list($ret, $output) = pkg_notify($atype, $ids);
|
||||||
|
} elseif (current_action("do_UnNotify")) {
|
||||||
|
list($ret, $output) = pkg_notify($atype, $ids, false);
|
||||||
|
} elseif (current_action("do_DeleteComment")) {
|
||||||
|
list($ret, $output) = pkg_delete_comment($atype);
|
||||||
|
} elseif (current_action("do_ChangeCategory")) {
|
||||||
|
list($ret, $output) = pkg_change_category($base_id, $atype);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_REQUEST['comment'])) {
|
||||||
|
$uid = uid_from_sid($_COOKIE["AURSID"]);
|
||||||
|
add_package_comment($base_id, $uid, $_REQUEST['comment']);
|
||||||
|
$ret = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($ret) {
|
||||||
|
if (isset($base_id)) {
|
||||||
|
/* Redirect back to package base page on success. */
|
||||||
|
header('Location: ' . get_pkgbase_uri($pkgbase_name));
|
||||||
|
exit();
|
||||||
|
} else {
|
||||||
|
/* Redirect back to package search page. */
|
||||||
|
header('Location: ' . get_pkg_route());
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$details = get_pkgbase_details($base_id);
|
$details = get_pkgbase_details($base_id);
|
||||||
html_header($title, $details);
|
html_header($title, $details);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<?php if ($output): ?>
|
||||||
|
<p class="pkgoutput"><?= $output ?></p>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
include('pkg_search_form.php');
|
include('pkg_search_form.php');
|
||||||
if (isset($_COOKIE["AURSID"])) {
|
if (isset($_COOKIE["AURSID"])) {
|
||||||
|
|
|
@ -18,17 +18,17 @@ if (isset($_COOKIE["AURSID"])) {
|
||||||
|
|
||||||
if ($atype == "Trusted User" || $atype == "Developer"): ?>
|
if ($atype == "Trusted User" || $atype == "Developer"): ?>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<h2><?= __('Delete Package: %s', htmlspecialchars($pkgname)) ?></h2>
|
<h2><?= __('Delete Package: %s', htmlspecialchars($pkgbase_name)) ?></h2>
|
||||||
<p>
|
<p>
|
||||||
<?= __('Use this form to delete the package (%s%s%s) from the AUR. ',
|
<?= __('Use this form to delete the package (%s%s%s) from the AUR. ',
|
||||||
'<strong>', htmlspecialchars($pkgname), '</strong>'); ?>
|
'<strong>', htmlspecialchars($pkgbase_name), '</strong>'); ?>
|
||||||
<?= __('Deletion of a package is permanent. '); ?>
|
<?= __('Deletion of a package is permanent. '); ?>
|
||||||
<?= __('Select the checkbox to confirm action.') ?>
|
<?= __('Select the checkbox to confirm action.') ?>
|
||||||
</p>
|
</p>
|
||||||
<form action="<?= get_uri('/packages/'); ?>" method="post">
|
<form action="<?= get_uri('/pkgbase/'); ?>" method="post">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<input type="hidden" name="IDs[<?= $pkgid ?>]" value="1" />
|
<input type="hidden" name="IDs[<?= $base_id ?>]" value="1" />
|
||||||
<input type="hidden" name="ID" value="<?= $pkgid ?>" />
|
<input type="hidden" name="ID" value="<?= $base_id ?>" />
|
||||||
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
||||||
<p><input type="checkbox" name="confirm_Delete" value="1" />
|
<p><input type="checkbox" name="confirm_Delete" value="1" />
|
||||||
<?= __("Confirm package deletion") ?></p>
|
<?= __("Confirm package deletion") ?></p>
|
||||||
|
|
|
@ -18,18 +18,18 @@ if (isset($_COOKIE["AURSID"])) {
|
||||||
|
|
||||||
if ($atype == "Trusted User" || $atype == "Developer"): ?>
|
if ($atype == "Trusted User" || $atype == "Developer"): ?>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<h2><?= __('Merge Package: %s', htmlspecialchars($pkgname)) ?></h2>
|
<h2><?= __('Merge Package: %s', htmlspecialchars($pkgbase_name)) ?></h2>
|
||||||
<p>
|
<p>
|
||||||
<?= __('Use this form to merge the package (%s%s%s) into another package. ',
|
<?= __('Use this form to merge the package (%s%s%s) into another package. ',
|
||||||
'<strong>', htmlspecialchars($pkgname), '</strong>'); ?>
|
'<strong>', htmlspecialchars($pkgbase_name), '</strong>'); ?>
|
||||||
<?= __('Once the package has been merged it cannot be reversed. '); ?>
|
<?= __('Once the package has been merged it cannot be reversed. '); ?>
|
||||||
<?= __('Enter the package name you wish to merge the package into. '); ?>
|
<?= __('Enter the package name you wish to merge the package into. '); ?>
|
||||||
<?= __('Select the checkbox to confirm action.') ?>
|
<?= __('Select the checkbox to confirm action.') ?>
|
||||||
</p>
|
</p>
|
||||||
<form action="<?= get_uri('/packages/'); ?>" method="post">
|
<form action="<?= get_uri('/pkgbase/'); ?>" method="post">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<input type="hidden" name="IDs[<?= $pkgid ?>]" value="1" />
|
<input type="hidden" name="IDs[<?= $base_id ?>]" value="1" />
|
||||||
<input type="hidden" name="ID" value="<?= $pkgid ?>" />
|
<input type="hidden" name="ID" value="<?= $base_id ?>" />
|
||||||
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
||||||
<p><label for="merge_Into" ><?= __("Merge into:") ?></label>
|
<p><label for="merge_Into" ><?= __("Merge into:") ?></label>
|
||||||
<input type="text" id="merge_Into" name="merge_Into" /></p>
|
<input type="text" id="merge_Into" name="merge_Into" /></p>
|
||||||
|
|
|
@ -500,6 +500,9 @@ function display_package_details($id=0, $row, $SID="") {
|
||||||
print "<p>" . $row['error'] . "</p>\n";
|
print "<p>" . $row['error'] . "</p>\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
$base_id = pkgbase_from_pkgid($id);
|
||||||
|
$pkgbase_name = pkgbase_name_from_id($base_id);
|
||||||
|
|
||||||
include('pkg_details.php');
|
include('pkg_details.php');
|
||||||
|
|
||||||
if ($SID) {
|
if ($SID) {
|
||||||
|
@ -507,7 +510,6 @@ function display_package_details($id=0, $row, $SID="") {
|
||||||
include('pkg_comment_form.php');
|
include('pkg_comment_form.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
$base_id = pkgbase_from_pkgid($id);
|
|
||||||
$comments = package_comments($base_id);
|
$comments = package_comments($base_id);
|
||||||
if (!empty($comments)) {
|
if (!empty($comments)) {
|
||||||
include('pkg_comments.php');
|
include('pkg_comments.php');
|
||||||
|
@ -536,6 +538,8 @@ function display_pkgbase_details($base_id, $row, $SID="") {
|
||||||
print "<p>" . $row['error'] . "</p>\n";
|
print "<p>" . $row['error'] . "</p>\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
$pkgbase_name = pkgbase_name_from_id($base_id);
|
||||||
|
|
||||||
include('pkgbase_details.php');
|
include('pkgbase_details.php');
|
||||||
|
|
||||||
if ($SID) {
|
if ($SID) {
|
||||||
|
@ -641,7 +645,8 @@ function pkg_search_page($SID="") {
|
||||||
$q_select .= "Users.Username AS Maintainer,
|
$q_select .= "Users.Username AS Maintainer,
|
||||||
PackageCategories.Category,
|
PackageCategories.Category,
|
||||||
Packages.Name, Packages.Version, Packages.Description,
|
Packages.Name, Packages.Version, Packages.Description,
|
||||||
PackageBases.NumVotes, Packages.ID, PackageBases.OutOfDateTS ";
|
PackageBases.NumVotes, Packages.ID, Packages.PackageBaseID,
|
||||||
|
PackageBases.OutOfDateTS ";
|
||||||
|
|
||||||
$q_from = "FROM Packages
|
$q_from = "FROM Packages
|
||||||
LEFT JOIN PackageBases ON (PackageBases.ID = Packages.PackageBaseID)
|
LEFT JOIN PackageBases ON (PackageBases.ID = Packages.PackageBaseID)
|
||||||
|
@ -941,20 +946,19 @@ function pkgbase_maintainer_uid($base_id) {
|
||||||
*
|
*
|
||||||
* @global string $AUR_LOCATION The AUR's URL used for notification e-mails
|
* @global string $AUR_LOCATION The AUR's URL used for notification e-mails
|
||||||
* @param string $atype Account type, output of account_from_sid
|
* @param string $atype Account type, output of account_from_sid
|
||||||
* @param array $ids Array of package IDs to flag/unflag
|
* @param array $base_ids Array of package base IDs to flag/unflag
|
||||||
*
|
*
|
||||||
* @return array Tuple of success/failure indicator and error message
|
* @return array Tuple of success/failure indicator and error message
|
||||||
*/
|
*/
|
||||||
function pkg_flag($atype, $ids) {
|
function pkg_flag($atype, $base_ids) {
|
||||||
global $AUR_LOCATION;
|
global $AUR_LOCATION;
|
||||||
|
|
||||||
if (!$atype) {
|
if (!$atype) {
|
||||||
return array(false, __("You must be logged in before you can flag packages."));
|
return array(false, __("You must be logged in before you can flag packages."));
|
||||||
}
|
}
|
||||||
|
|
||||||
$ids = sanitize_ids($ids);
|
$base_ids = pkgbase_from_pkgid($base_ids);
|
||||||
$base_ids = pkgbase_from_pkgid($ids);
|
if (empty($base_ids)) {
|
||||||
if (empty($ids)) {
|
|
||||||
return array(false, __("You did not select any packages to flag."));
|
return array(false, __("You did not select any packages to flag."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -972,10 +976,10 @@ function pkg_flag($atype, $ids) {
|
||||||
$f_name = username_from_sid($_COOKIE['AURSID']);
|
$f_name = username_from_sid($_COOKIE['AURSID']);
|
||||||
$f_email = email_from_sid($_COOKIE['AURSID']);
|
$f_email = email_from_sid($_COOKIE['AURSID']);
|
||||||
$f_uid = uid_from_sid($_COOKIE['AURSID']);
|
$f_uid = uid_from_sid($_COOKIE['AURSID']);
|
||||||
$q = "SELECT Packages.Name, Users.Email, Packages.ID ";
|
$q = "SELECT PackageBases.Name, Users.Email ";
|
||||||
$q.= "FROM Packages, Users ";
|
$q.= "FROM PackageBases, Users ";
|
||||||
$q.= "WHERE Packages.ID IN (" . implode(",", $ids) .") ";
|
$q.= "WHERE PackageBases.ID IN (" . implode(",", $base_ids) .") ";
|
||||||
$q.= "AND Users.ID = Packages.MaintainerUID ";
|
$q.= "AND Users.ID = PackageBases.MaintainerUID ";
|
||||||
$q.= "AND Users.ID != " . $f_uid;
|
$q.= "AND Users.ID != " . $f_uid;
|
||||||
$result = $dbh->query($q);
|
$result = $dbh->query($q);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
|
@ -1000,18 +1004,17 @@ function pkg_flag($atype, $ids) {
|
||||||
* Unflag package(s) as out-of-date
|
* Unflag package(s) as out-of-date
|
||||||
*
|
*
|
||||||
* @param string $atype Account type, output of account_from_sid
|
* @param string $atype Account type, output of account_from_sid
|
||||||
* @param array $ids Array of package IDs to flag/unflag
|
* @param array $base_ids Array of package base IDs to flag/unflag
|
||||||
*
|
*
|
||||||
* @return array Tuple of success/failure indicator and error message
|
* @return array Tuple of success/failure indicator and error message
|
||||||
*/
|
*/
|
||||||
function pkg_unflag($atype, $ids) {
|
function pkg_unflag($atype, $base_ids) {
|
||||||
if (!$atype) {
|
if (!$atype) {
|
||||||
return array(false, __("You must be logged in before you can unflag packages."));
|
return array(false, __("You must be logged in before you can unflag packages."));
|
||||||
}
|
}
|
||||||
|
|
||||||
$ids = sanitize_ids($ids);
|
$base_ids = pkgbase_from_pkgid($base_ids);
|
||||||
$base_ids = pkgbase_from_pkgid($ids);
|
if (empty($base_ids)) {
|
||||||
if (empty($ids)) {
|
|
||||||
return array(false, __("You did not select any packages to unflag."));
|
return array(false, __("You did not select any packages to unflag."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1144,12 +1147,12 @@ function pkg_delete ($atype, $base_ids, $merge_base_id) {
|
||||||
* Adopt or disown packages
|
* Adopt or disown packages
|
||||||
*
|
*
|
||||||
* @param string $atype Account type, output of account_from_sid
|
* @param string $atype Account type, output of account_from_sid
|
||||||
* @param array $ids Array of package IDs to adopt/disown
|
* @param array $base_ids Array of package base IDs to adopt/disown
|
||||||
* @param bool $action Adopts if true, disowns if false. Adopts by default
|
* @param bool $action Adopts if true, disowns if false. Adopts by default
|
||||||
*
|
*
|
||||||
* @return array Tuple of success/failure indicator and error message
|
* @return array Tuple of success/failure indicator and error message
|
||||||
*/
|
*/
|
||||||
function pkg_adopt ($atype, $ids, $action=true) {
|
function pkg_adopt ($atype, $base_ids, $action=true) {
|
||||||
if (!$atype) {
|
if (!$atype) {
|
||||||
if ($action) {
|
if ($action) {
|
||||||
return array(false, __("You must be logged in before you can adopt packages."));
|
return array(false, __("You must be logged in before you can adopt packages."));
|
||||||
|
@ -1158,9 +1161,8 @@ function pkg_adopt ($atype, $ids, $action=true) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$pkg_ids = sanitize_ids($ids);
|
$base_ids = sanitize_ids($base_ids);
|
||||||
$ids = pkgbase_from_pkgid($pkg_ids);
|
if (empty($base_ids)) {
|
||||||
if (empty($ids)) {
|
|
||||||
if ($action) {
|
if ($action) {
|
||||||
return array(false, __("You did not select any packages to adopt."));
|
return array(false, __("You did not select any packages to adopt."));
|
||||||
} else {
|
} else {
|
||||||
|
@ -1180,7 +1182,7 @@ function pkg_adopt ($atype, $ids, $action=true) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$q.= "SET $field = $user ";
|
$q.= "SET $field = $user ";
|
||||||
$q.= "WHERE ID IN (" . implode(",", $ids) . ") ";
|
$q.= "WHERE ID IN (" . implode(",", $base_ids) . ") ";
|
||||||
|
|
||||||
if ($action && $atype == "User") {
|
if ($action && $atype == "User") {
|
||||||
/* Regular users may only adopt orphan packages. */
|
/* Regular users may only adopt orphan packages. */
|
||||||
|
@ -1203,12 +1205,12 @@ function pkg_adopt ($atype, $ids, $action=true) {
|
||||||
* Vote and un-vote for packages
|
* Vote and un-vote for packages
|
||||||
*
|
*
|
||||||
* @param string $atype Account type, output of account_from_sid
|
* @param string $atype Account type, output of account_from_sid
|
||||||
* @param array $ids Array of package IDs to vote/un-vote
|
* @param array $base_ids Array of package base IDs to vote/un-vote
|
||||||
* @param bool $action Votes if true, un-votes if false. Votes by default
|
* @param bool $action Votes if true, un-votes if false. Votes by default
|
||||||
*
|
*
|
||||||
* @return array Tuple of success/failure indicator and error message
|
* @return array Tuple of success/failure indicator and error message
|
||||||
*/
|
*/
|
||||||
function pkg_vote ($atype, $ids, $action=true) {
|
function pkg_vote ($atype, $base_ids, $action=true) {
|
||||||
if (!$atype) {
|
if (!$atype) {
|
||||||
if ($action) {
|
if ($action) {
|
||||||
return array(false, __("You must be logged in before you can vote for packages."));
|
return array(false, __("You must be logged in before you can vote for packages."));
|
||||||
|
@ -1217,9 +1219,8 @@ function pkg_vote ($atype, $ids, $action=true) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$ids = sanitize_ids($ids);
|
$base_ids = sanitize_ids($base_ids);
|
||||||
$base_ids = pkgbase_from_pkgid($ids);
|
if (empty($base_ids)) {
|
||||||
if (empty($ids)) {
|
|
||||||
if ($action) {
|
if ($action) {
|
||||||
return array(false, __("You did not select any packages to vote for."));
|
return array(false, __("You did not select any packages to vote for."));
|
||||||
} else {
|
} else {
|
||||||
|
@ -1360,18 +1361,17 @@ function user_notify($uid, $base_id) {
|
||||||
* Toggle notification of packages
|
* Toggle notification of packages
|
||||||
*
|
*
|
||||||
* @param string $atype Account type, output of account_from_sid
|
* @param string $atype Account type, output of account_from_sid
|
||||||
* @param array $ids Array of package IDs to toggle, formatted as $package_id
|
* @param array $base_ids Array of package base IDs to toggle
|
||||||
*
|
*
|
||||||
* @return array Tuple of success/failure indicator and error message
|
* @return array Tuple of success/failure indicator and error message
|
||||||
*/
|
*/
|
||||||
function pkg_notify ($atype, $ids, $action=true) {
|
function pkg_notify ($atype, $base_ids, $action=true) {
|
||||||
if (!$atype) {
|
if (!$atype) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$ids = sanitize_ids($ids);
|
$base_ids = sanitize_ids($base_ids);
|
||||||
$base_ids = pkgbase_from_pkgid($ids);
|
if (empty($base_ids)) {
|
||||||
if (empty($ids)) {
|
|
||||||
return array(false, __("Couldn't add to notification list."));
|
return array(false, __("Couldn't add to notification list."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<div id="generic-form" class="box">
|
<div id="generic-form" class="box">
|
||||||
<h2><?= __("Add Comment"); ?></h2>
|
<h2><?= __("Add Comment"); ?></h2>
|
||||||
<form action="<?= get_pkg_uri($row['Name']) ?>" method="post">
|
<form action="<?= get_pkgbase_uri($pkgbase_name) ?>" method="post">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<?php
|
<?php
|
||||||
if (isset($_REQUEST['comment']) && check_token()) {
|
if (isset($_REQUEST['comment']) && check_token()) {
|
||||||
|
@ -8,7 +8,7 @@ if (isset($_REQUEST['comment']) && check_token()) {
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div>
|
<div>
|
||||||
<input type="hidden" name="ID" value="<?= intval($row['ID']) ?>" />
|
<input type="hidden" name="ID" value="<?= intval($base_id) ?>" />
|
||||||
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
||||||
</div>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -2,11 +2,10 @@
|
||||||
$uid = uid_from_sid($SID);
|
$uid = uid_from_sid($SID);
|
||||||
$base_id = pkgbase_from_pkgid($row['ID']);
|
$base_id = pkgbase_from_pkgid($row['ID']);
|
||||||
$count = package_comments_count($base_id);
|
$count = package_comments_count($base_id);
|
||||||
$pkgname = $row['Name'];
|
|
||||||
?>
|
?>
|
||||||
<div id="news">
|
<div id="news">
|
||||||
<h3>
|
<h3>
|
||||||
<a href="<?= htmlentities(get_pkg_uri($pkgname), ENT_QUOTES) . '?' . mkurl('comments=all') ?>" title="<?= __('View all %s comments' , $count) ?>"><?= __('Latest Comments') ?></a>
|
<a href="<?= htmlentities(get_pkgbase_uri($pkgbase_name), ENT_QUOTES) . '?' . mkurl('comments=all') ?>" title="<?= __('View all %s comments' , $count) ?>"><?= __('Latest Comments') ?></a>
|
||||||
<span class="arrow"></span>
|
<span class="arrow"></span>
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
|
@ -16,7 +15,7 @@ $pkgname = $row['Name'];
|
||||||
endif; ?>
|
endif; ?>
|
||||||
<h4>
|
<h4>
|
||||||
<?php if (canDeleteCommentArray($row, $atype, $uid)): ?>
|
<?php if (canDeleteCommentArray($row, $atype, $uid)): ?>
|
||||||
<form method="post" action="<?= htmlspecialchars(get_pkg_uri($pkgname), ENT_QUOTES); ?>">
|
<form method="post" action="<?= htmlspecialchars(get_pkgbase_uri($pkgbase_name), ENT_QUOTES); ?>">
|
||||||
<fieldset style="display:inline;">
|
<fieldset style="display:inline;">
|
||||||
<input type="hidden" name="action" value="do_DeleteComment" />
|
<input type="hidden" name="action" value="do_DeleteComment" />
|
||||||
<input type="hidden" name="comment_id" value="<?= $row['ID'] ?>" />
|
<input type="hidden" name="comment_id" value="<?= $row['ID'] ?>" />
|
||||||
|
@ -49,7 +48,7 @@ $pkgname = $row['Name'];
|
||||||
<?php if ($count > 10 && !isset($_GET['comments'])): ?>
|
<?php if ($count > 10 && !isset($_GET['comments'])): ?>
|
||||||
<div id="news">
|
<div id="news">
|
||||||
<h3>
|
<h3>
|
||||||
<a href="<?= htmlentities(get_pkg_uri($pkgname), ENT_QUOTES) . '?' . mkurl('comments=all') ?>" title="<?= __('View all %s comments', $count) ?>"><?= __('All comments', $count) ?></a>
|
<a href="<?= htmlentities(get_pkgbase_uri($pkgbase_name), ENT_QUOTES) . '?' . mkurl('comments=all') ?>" title="<?= __('View all %s comments', $count) ?>"><?= __('All comments', $count) ?></a>
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
|
@ -20,7 +20,7 @@ $updated_time = ($row["ModifiedTS"] == 0) ? $msg : gmdate("Y-m-d H:i", intval($r
|
||||||
$submitted_time = ($row["SubmittedTS"] == 0) ? $msg : gmdate("Y-m-d H:i", intval($row["SubmittedTS"]));
|
$submitted_time = ($row["SubmittedTS"] == 0) ? $msg : gmdate("Y-m-d H:i", intval($row["SubmittedTS"]));
|
||||||
$out_of_date_time = ($row["OutOfDateTS"] == 0) ? $msg : gmdate("Y-m-d", intval($row["OutOfDateTS"]));
|
$out_of_date_time = ($row["OutOfDateTS"] == 0) ? $msg : gmdate("Y-m-d", intval($row["OutOfDateTS"]));
|
||||||
|
|
||||||
$urlpath = URL_DIR . substr($row['Name'], 0, 2) . "/" . $row['Name'];
|
$urlpath = URL_DIR . substr($row['BaseName'], 0, 2) . "/" . $row['BaseName'];
|
||||||
|
|
||||||
$deps = package_dependencies($row["ID"]);
|
$deps = package_dependencies($row["ID"]);
|
||||||
$requiredby = package_required($row["Name"]);
|
$requiredby = package_required($row["Name"]);
|
||||||
|
@ -35,12 +35,12 @@ $sources = package_sources($row["ID"]);
|
||||||
<h4><?= __('Package Actions') ?></h4>
|
<h4><?= __('Package Actions') ?></h4>
|
||||||
<ul class="small">
|
<ul class="small">
|
||||||
<li><a href="<?= $urlpath ?>/PKGBUILD"><?= __('View PKGBUILD') ?></a></li>
|
<li><a href="<?= $urlpath ?>/PKGBUILD"><?= __('View PKGBUILD') ?></a></li>
|
||||||
<li><a href="<?= $urlpath . '/' . $row['Name'] ?>.tar.gz"><?= __('Download tarball') ?></a></li>
|
<li><a href="<?= $urlpath . '/' . $row['BaseName'] ?>.tar.gz"><?= __('Download tarball') ?></a></li>
|
||||||
<li><span class="flagged"><?php if ($row["OutOfDateTS"] !== NULL) { echo __('Flagged out-of-date')." (${out_of_date_time})"; } ?></span></li>
|
<li><span class="flagged"><?php if ($row["OutOfDateTS"] !== NULL) { echo __('Flagged out-of-date')." (${out_of_date_time})"; } ?></span></li>
|
||||||
<?php if ($USE_VIRTUAL_URLS && $uid): ?>
|
<?php if ($USE_VIRTUAL_URLS && $uid): ?>
|
||||||
<?php if ($row["OutOfDateTS"] === NULL): ?>
|
<?php if ($row["OutOfDateTS"] === NULL): ?>
|
||||||
<li>
|
<li>
|
||||||
<form action="<?= get_pkg_uri($row['Name']) . 'flag/'; ?>" method="post">
|
<form action="<?= get_pkgbase_uri($row['BaseName']) . 'flag/'; ?>" method="post">
|
||||||
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
||||||
<input type="submit" class="button text-button" name="do_Flag" value="<?= __('Flag package out-of-date') ?>" />
|
<input type="submit" class="button text-button" name="do_Flag" value="<?= __('Flag package out-of-date') ?>" />
|
||||||
</form>
|
</form>
|
||||||
|
@ -48,7 +48,7 @@ $sources = package_sources($row["ID"]);
|
||||||
<?php elseif (($row["OutOfDateTS"] !== NULL) &&
|
<?php elseif (($row["OutOfDateTS"] !== NULL) &&
|
||||||
($uid == $row["MaintainerUID"] || $atype == "Trusted User" || $atype == "Developer")): ?>
|
($uid == $row["MaintainerUID"] || $atype == "Trusted User" || $atype == "Developer")): ?>
|
||||||
<li>
|
<li>
|
||||||
<form action="<?= get_pkg_uri($row['Name']) . 'unflag/'; ?>" method="post">
|
<form action="<?= get_pkgbase_uri($row['BaseName']) . 'unflag/'; ?>" method="post">
|
||||||
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
||||||
<input type="submit" class="button text-button" name="do_UnFlag" value="<?= __('Unflag package') ?>" />
|
<input type="submit" class="button text-button" name="do_UnFlag" value="<?= __('Unflag package') ?>" />
|
||||||
</form>
|
</form>
|
||||||
|
@ -56,14 +56,14 @@ $sources = package_sources($row["ID"]);
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if (user_voted($uid, $row['ID'])): ?>
|
<?php if (user_voted($uid, $row['ID'])): ?>
|
||||||
<li>
|
<li>
|
||||||
<form action="<?= get_pkg_uri($row['Name']) . 'unvote/'; ?>" method="post">
|
<form action="<?= get_pkgbase_uri($row['BaseName']) . 'unvote/'; ?>" method="post">
|
||||||
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
||||||
<input type="submit" class="button text-button" name="do_UnVote" value="<?= __('Remove vote') ?>" />
|
<input type="submit" class="button text-button" name="do_UnVote" value="<?= __('Remove vote') ?>" />
|
||||||
</form>
|
</form>
|
||||||
</li>
|
</li>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<li>
|
<li>
|
||||||
<form action="<?= get_pkg_uri($row['Name']) . 'vote/'; ?>" method="post">
|
<form action="<?= get_pkgbase_uri($row['BaseName']) . 'vote/'; ?>" method="post">
|
||||||
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
||||||
<input type="submit" class="button text-button" name="do_Vote" value="<?= __('Vote for this package') ?>" />
|
<input type="submit" class="button text-button" name="do_Vote" value="<?= __('Vote for this package') ?>" />
|
||||||
</form>
|
</form>
|
||||||
|
@ -71,28 +71,28 @@ $sources = package_sources($row["ID"]);
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if (user_notify($uid, $row['ID'])): ?>
|
<?php if (user_notify($uid, $row['ID'])): ?>
|
||||||
<li>
|
<li>
|
||||||
<form action="<?= get_pkg_uri($row['Name']) . 'unnotify/'; ?>" method="post">
|
<form action="<?= get_pkgbase_uri($row['BaseName']) . 'unnotify/'; ?>" method="post">
|
||||||
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
||||||
<input type="submit" class="button text-button" name="do_UnNotify" value="<?= __('Disable notifications') ?>" />
|
<input type="submit" class="button text-button" name="do_UnNotify" value="<?= __('Disable notifications') ?>" />
|
||||||
</form>
|
</form>
|
||||||
</li>
|
</li>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<li>
|
<li>
|
||||||
<form action="<?= get_pkg_uri($row['Name']) . 'notify/'; ?>" method="post">
|
<form action="<?= get_pkgbase_uri($row['BaseName']) . 'notify/'; ?>" method="post">
|
||||||
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
||||||
<input type="submit" class="button text-button" name="do_Notify" value="<?= __('Notify of new comments') ?>" />
|
<input type="submit" class="button text-button" name="do_Notify" value="<?= __('Notify of new comments') ?>" />
|
||||||
</form>
|
</form>
|
||||||
</li>
|
</li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ($atype == "Trusted User" || $atype == "Developer"): ?>
|
<?php if ($atype == "Trusted User" || $atype == "Developer"): ?>
|
||||||
<li><a href="<?= get_pkg_uri($row['Name']) . 'delete/'; ?>"><?= __('Delete Package'); ?></a></li>
|
<li><a href="<?= get_pkgbase_uri($row['BaseName']) . 'delete/'; ?>"><?= __('Delete Package'); ?></a></li>
|
||||||
<li><a href="<?= get_pkg_uri($row['Name']) . 'merge/'; ?>"><?= __('Merge Package'); ?></a></li>
|
<li><a href="<?= get_pkgbase_uri($row['BaseName']) . 'merge/'; ?>"><?= __('Merge Package'); ?></a></li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($uid && $row["MaintainerUID"] === NULL): ?>
|
<?php if ($uid && $row["MaintainerUID"] === NULL): ?>
|
||||||
<li>
|
<li>
|
||||||
<form action="<?= get_pkg_uri($row['Name']) . 'adopt/'; ?>" method="post">
|
<form action="<?= get_pkgbase_uri($row['BaseName']) . 'adopt/'; ?>" method="post">
|
||||||
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
||||||
<input type="submit" class="button text-button" name="do_Adopt" value="<?= __('Adopt Package') ?>" />
|
<input type="submit" class="button text-button" name="do_Adopt" value="<?= __('Adopt Package') ?>" />
|
||||||
</form>
|
</form>
|
||||||
|
@ -100,7 +100,7 @@ $sources = package_sources($row["ID"]);
|
||||||
<?php elseif ($uid && $uid == $row["MaintainerUID"] ||
|
<?php elseif ($uid && $uid == $row["MaintainerUID"] ||
|
||||||
$atype == "Trusted User" || $atype == "Developer"): ?>
|
$atype == "Trusted User" || $atype == "Developer"): ?>
|
||||||
<li>
|
<li>
|
||||||
<form action="<?= get_pkg_uri($row['Name']) . 'disown/'; ?>" method="post">
|
<form action="<?= get_pkgbase_uri($row['BaseName']) . 'disown/'; ?>" method="post">
|
||||||
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
||||||
<input type="submit" class="button text-button" name="do_Disown" value="<?= __('Disown Package') ?>" />
|
<input type="submit" class="button text-button" name="do_Disown" value="<?= __('Disown Package') ?>" />
|
||||||
</form>
|
</form>
|
||||||
|
@ -130,7 +130,7 @@ if ($SID && ($uid == $row["MaintainerUID"] ||
|
||||||
($atype == "Developer" || $atype == "Trusted User"))):
|
($atype == "Developer" || $atype == "Trusted User"))):
|
||||||
?>
|
?>
|
||||||
<td>
|
<td>
|
||||||
<form method="post" action="<?= htmlspecialchars(get_pkg_uri($row['Name']), ENT_QUOTES); ?>">
|
<form method="post" action="<?= htmlspecialchars(get_pkgbase_uri($row['BaseName']), ENT_QUOTES); ?>">
|
||||||
<div>
|
<div>
|
||||||
<input type="hidden" name="action" value="do_ChangeCategory" />
|
<input type="hidden" name="action" value="do_ChangeCategory" />
|
||||||
<?php if ($SID): ?>
|
<?php if ($SID): ?>
|
||||||
|
@ -196,9 +196,9 @@ if ($row["MaintainerUID"]):
|
||||||
<th><?= __('Votes') . ': ' ?></th>
|
<th><?= __('Votes') . ': ' ?></th>
|
||||||
<?php if ($atype == "Developer" || $atype == "Trusted User"): ?>
|
<?php if ($atype == "Developer" || $atype == "Trusted User"): ?>
|
||||||
<?php if ($USE_VIRTUAL_URLS): ?>
|
<?php if ($USE_VIRTUAL_URLS): ?>
|
||||||
<td><a href="<?= get_pkg_uri($row['Name']); ?>voters/"><?= $votes ?></a></td>
|
<td><a href="<?= get_pkgbase_uri($row['BaseName']); ?>voters/"><?= $votes ?></a></td>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<td><a href="<?= get_uri('/voters/'); ?>?N=<?= htmlspecialchars($row['Name'], ENT_QUOTES) ?>"><?= $votes ?></a></td>
|
<td><a href="<?= get_uri('/voters/'); ?>?N=<?= htmlspecialchars($row['BaseName'], ENT_QUOTES) ?>"><?= $votes ?></a></td>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<td><?= $votes ?></td>
|
<td><?= $votes ?></td>
|
||||||
|
|
|
@ -28,7 +28,7 @@ if (!$result): ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form id="pkglist-results-form" method="post" action="<?= get_uri('/packages/'); ?>?<?= htmlentities($_SERVER['QUERY_STRING']) ?>">
|
<form id="pkglist-results-form" method="post" action="<?= get_uri('/pkgbase/'); ?>?<?= htmlentities($_SERVER['QUERY_STRING']) ?>">
|
||||||
<table class="results">
|
<table class="results">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -52,7 +52,7 @@ if (!$result): ?>
|
||||||
<?php while (list($indx, $row) = each($searchresults)): ?>
|
<?php while (list($indx, $row) = each($searchresults)): ?>
|
||||||
<tr class="<?= ($indx % 2 == 0) ? 'odd' : 'even' ?>">
|
<tr class="<?= ($indx % 2 == 0) ? 'odd' : 'even' ?>">
|
||||||
<?php if ($SID): ?>
|
<?php if ($SID): ?>
|
||||||
<td><input type="checkbox" name="IDs[<?= $row["ID"] ?>]" value="1" /></td>
|
<td><input type="checkbox" name="IDs[<?= $row["PackageBaseID"] ?>]" value="1" /></td>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<td><?= htmlspecialchars($row["Category"]) ?></td>
|
<td><?= htmlspecialchars($row["Category"]) ?></td>
|
||||||
<td><a href="<?= htmlspecialchars(get_pkg_uri($row["Name"]), ENT_QUOTES); ?>"><?= htmlspecialchars($row["Name"]) ?></a></td>
|
<td><a href="<?= htmlspecialchars(get_pkg_uri($row["Name"]), ENT_QUOTES); ?>"><?= htmlspecialchars($row["Name"]) ?></a></td>
|
||||||
|
|
|
@ -30,12 +30,12 @@ $pkgs = pkgbase_get_pkgnames($base_id);
|
||||||
<h4><?= __('Package Actions') ?></h4>
|
<h4><?= __('Package Actions') ?></h4>
|
||||||
<ul class="small">
|
<ul class="small">
|
||||||
<li><a href="<?= $urlpath ?>/PKGBUILD"><?= __('View PKGBUILD') ?></a></li>
|
<li><a href="<?= $urlpath ?>/PKGBUILD"><?= __('View PKGBUILD') ?></a></li>
|
||||||
<li><a href="<?= $urlpath . '/' . $pkgs[0] ?>.tar.gz"><?= __('Download tarball') ?></a></li>
|
<li><a href="<?= $urlpath . '/' . $row['Name'] ?>.tar.gz"><?= __('Download tarball') ?></a></li>
|
||||||
<li><span class="flagged"><?php if ($row["OutOfDateTS"] !== NULL) { echo __('Flagged out-of-date')." (${out_of_date_time})"; } ?></span></li>
|
<li><span class="flagged"><?php if ($row["OutOfDateTS"] !== NULL) { echo __('Flagged out-of-date')." (${out_of_date_time})"; } ?></span></li>
|
||||||
<?php if ($USE_VIRTUAL_URLS && $uid): ?>
|
<?php if ($USE_VIRTUAL_URLS && $uid): ?>
|
||||||
<?php if ($row["OutOfDateTS"] === NULL): ?>
|
<?php if ($row["OutOfDateTS"] === NULL): ?>
|
||||||
<li>
|
<li>
|
||||||
<form action="<?= get_pkg_uri($pkgs[0]) . 'flag/'; ?>" method="post">
|
<form action="<?= get_pkgbase_uri($row['Name']) . 'flag/'; ?>" method="post">
|
||||||
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
||||||
<input type="submit" class="button text-button" name="do_Flag" value="<?= __('Flag package out-of-date') ?>" />
|
<input type="submit" class="button text-button" name="do_Flag" value="<?= __('Flag package out-of-date') ?>" />
|
||||||
</form>
|
</form>
|
||||||
|
@ -43,7 +43,7 @@ $pkgs = pkgbase_get_pkgnames($base_id);
|
||||||
<?php elseif (($row["OutOfDateTS"] !== NULL) &&
|
<?php elseif (($row["OutOfDateTS"] !== NULL) &&
|
||||||
($uid == $row["MaintainerUID"] || $atype == "Trusted User" || $atype == "Developer")): ?>
|
($uid == $row["MaintainerUID"] || $atype == "Trusted User" || $atype == "Developer")): ?>
|
||||||
<li>
|
<li>
|
||||||
<form action="<?= get_pkg_uri($pkgs[0]) . 'unflag/'; ?>" method="post">
|
<form action="<?= get_pkgbase_uri($row['Name']) . 'unflag/'; ?>" method="post">
|
||||||
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
||||||
<input type="submit" class="button text-button" name="do_UnFlag" value="<?= __('Unflag package') ?>" />
|
<input type="submit" class="button text-button" name="do_UnFlag" value="<?= __('Unflag package') ?>" />
|
||||||
</form>
|
</form>
|
||||||
|
@ -51,14 +51,14 @@ $pkgs = pkgbase_get_pkgnames($base_id);
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if (user_voted($uid, $row['ID'])): ?>
|
<?php if (user_voted($uid, $row['ID'])): ?>
|
||||||
<li>
|
<li>
|
||||||
<form action="<?= get_pkg_uri($pkgs[0]) . 'unvote/'; ?>" method="post">
|
<form action="<?= get_pkgbase_uri($row['Name']) . 'unvote/'; ?>" method="post">
|
||||||
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
||||||
<input type="submit" class="button text-button" name="do_UnVote" value="<?= __('Remove vote') ?>" />
|
<input type="submit" class="button text-button" name="do_UnVote" value="<?= __('Remove vote') ?>" />
|
||||||
</form>
|
</form>
|
||||||
</li>
|
</li>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<li>
|
<li>
|
||||||
<form action="<?= get_pkg_uri($pkgs[0]) . 'vote/'; ?>" method="post">
|
<form action="<?= get_pkgbase_uri($row['Name']) . 'vote/'; ?>" method="post">
|
||||||
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
||||||
<input type="submit" class="button text-button" name="do_Vote" value="<?= __('Vote for this package') ?>" />
|
<input type="submit" class="button text-button" name="do_Vote" value="<?= __('Vote for this package') ?>" />
|
||||||
</form>
|
</form>
|
||||||
|
@ -66,28 +66,28 @@ $pkgs = pkgbase_get_pkgnames($base_id);
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if (user_notify($uid, $row['ID'])): ?>
|
<?php if (user_notify($uid, $row['ID'])): ?>
|
||||||
<li>
|
<li>
|
||||||
<form action="<?= get_pkg_uri($pkgs[0]) . 'unnotify/'; ?>" method="post">
|
<form action="<?= get_pkgbase_uri($row['Name']) . 'unnotify/'; ?>" method="post">
|
||||||
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
||||||
<input type="submit" class="button text-button" name="do_UnNotify" value="<?= __('Disable notifications') ?>" />
|
<input type="submit" class="button text-button" name="do_UnNotify" value="<?= __('Disable notifications') ?>" />
|
||||||
</form>
|
</form>
|
||||||
</li>
|
</li>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<li>
|
<li>
|
||||||
<form action="<?= get_pkg_uri($pkgs[0]) . 'notify/'; ?>" method="post">
|
<form action="<?= get_pkgbase_uri($row['Name']) . 'notify/'; ?>" method="post">
|
||||||
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
||||||
<input type="submit" class="button text-button" name="do_Notify" value="<?= __('Notify of new comments') ?>" />
|
<input type="submit" class="button text-button" name="do_Notify" value="<?= __('Notify of new comments') ?>" />
|
||||||
</form>
|
</form>
|
||||||
</li>
|
</li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ($atype == "Trusted User" || $atype == "Developer"): ?>
|
<?php if ($atype == "Trusted User" || $atype == "Developer"): ?>
|
||||||
<li><a href="<?= get_pkg_uri($pkgs[0]) . 'delete/'; ?>"><?= __('Delete Package'); ?></a></li>
|
<li><a href="<?= get_pkgbase_uri($row['Name']) . 'delete/'; ?>"><?= __('Delete Package'); ?></a></li>
|
||||||
<li><a href="<?= get_pkg_uri($pkgs[0]) . 'merge/'; ?>"><?= __('Merge Package'); ?></a></li>
|
<li><a href="<?= get_pkgbase_uri($row['Name']) . 'merge/'; ?>"><?= __('Merge Package'); ?></a></li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($uid && $row["MaintainerUID"] === NULL): ?>
|
<?php if ($uid && $row["MaintainerUID"] === NULL): ?>
|
||||||
<li>
|
<li>
|
||||||
<form action="<?= get_pkg_uri($pkgs[0]) . 'adopt/'; ?>" method="post">
|
<form action="<?= get_pkgbase_uri($row['Name']) . 'adopt/'; ?>" method="post">
|
||||||
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
||||||
<input type="submit" class="button text-button" name="do_Adopt" value="<?= __('Adopt Package') ?>" />
|
<input type="submit" class="button text-button" name="do_Adopt" value="<?= __('Adopt Package') ?>" />
|
||||||
</form>
|
</form>
|
||||||
|
@ -95,7 +95,7 @@ $pkgs = pkgbase_get_pkgnames($base_id);
|
||||||
<?php elseif ($uid && $uid == $row["MaintainerUID"] ||
|
<?php elseif ($uid && $uid == $row["MaintainerUID"] ||
|
||||||
$atype == "Trusted User" || $atype == "Developer"): ?>
|
$atype == "Trusted User" || $atype == "Developer"): ?>
|
||||||
<li>
|
<li>
|
||||||
<form action="<?= get_pkg_uri($pkgs[0]) . 'disown/'; ?>" method="post">
|
<form action="<?= get_pkgbase_uri($row['Name']) . 'disown/'; ?>" method="post">
|
||||||
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
||||||
<input type="submit" class="button text-button" name="do_Disown" value="<?= __('Disown Package') ?>" />
|
<input type="submit" class="button text-button" name="do_Disown" value="<?= __('Disown Package') ?>" />
|
||||||
</form>
|
</form>
|
||||||
|
@ -113,7 +113,7 @@ if ($SID && ($uid == $row["MaintainerUID"] ||
|
||||||
($atype == "Developer" || $atype == "Trusted User"))):
|
($atype == "Developer" || $atype == "Trusted User"))):
|
||||||
?>
|
?>
|
||||||
<td>
|
<td>
|
||||||
<form method="post" action="<?= htmlspecialchars(get_pkg_uri($row['Name']), ENT_QUOTES); ?>">
|
<form method="post" action="<?= htmlspecialchars(get_pkgbase_uri($row['Name']), ENT_QUOTES); ?>">
|
||||||
<div>
|
<div>
|
||||||
<input type="hidden" name="action" value="do_ChangeCategory" />
|
<input type="hidden" name="action" value="do_ChangeCategory" />
|
||||||
<?php if ($SID): ?>
|
<?php if ($SID): ?>
|
||||||
|
@ -175,7 +175,7 @@ if ($row["MaintainerUID"]):
|
||||||
<th><?= __('Votes') . ': ' ?></th>
|
<th><?= __('Votes') . ': ' ?></th>
|
||||||
<?php if ($atype == "Developer" || $atype == "Trusted User"): ?>
|
<?php if ($atype == "Developer" || $atype == "Trusted User"): ?>
|
||||||
<?php if ($USE_VIRTUAL_URLS): ?>
|
<?php if ($USE_VIRTUAL_URLS): ?>
|
||||||
<td><a href="<?= get_pkg_uri($row['Name']); ?>voters/"><?= $votes ?></a></td>
|
<td><a href="<?= get_pkgbase_uri($row['Name']); ?>voters/"><?= $votes ?></a></td>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<td><a href="<?= get_uri('/voters/'); ?>?N=<?= htmlspecialchars($row['Name'], ENT_QUOTES) ?>"><?= $votes ?></a></td>
|
<td><a href="<?= get_uri('/voters/'); ?>?N=<?= htmlspecialchars($row['Name'], ENT_QUOTES) ?>"><?= $votes ?></a></td>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
Loading…
Add table
Reference in a new issue