Fix vote/notify link on the package details page

Call pkgbase_user_voted() and pkgbase_user_notify() using the package
base ID instead of using the package ID.

Fixes FS#40165.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2014-05-01 09:27:06 +02:00
parent 05f88b28b8
commit e161c4f94b
3 changed files with 11 additions and 9 deletions

View file

@ -3,6 +3,7 @@ $atype = account_from_sid($SID);
$uid = uid_from_sid($SID);
$pkgid = intval($row['ID']);
$base_id = intval($row['BaseID']);
$catarr = pkgbase_categories();
@ -73,7 +74,7 @@ $sources = pkg_sources($row["ID"]);
</form>
</li>
<?php endif; ?>
<?php if (pkgbase_user_voted($uid, $row['ID'])): ?>
<?php if (pkgbase_user_voted($uid, $base_id)): ?>
<li>
<form action="<?= get_pkgbase_uri($row['BaseName']) . 'unvote/'; ?>" method="post">
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
@ -88,7 +89,7 @@ $sources = pkg_sources($row["ID"]);
</form>
</li>
<?php endif; ?>
<?php if (pkgbase_user_notify($uid, $row['ID'])): ?>
<?php if (pkgbase_user_notify($uid, $base_id)): ?>
<li>
<form action="<?= get_pkgbase_uri($row['BaseName']) . 'unnotify/'; ?>" method="post">
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />