Add virtual path support for package actions

This allows for using following URLs:

* /package/$pkg_name/flag: Flag a package out-of-date
* /package/$pkg_name/unflag: Unflag a package
* /package/$pkg_name/notify: Enable comment notifications
* /package/$pkg_name/unnotify: Disable comment notifications
* /package/$pkg_name/vote: Vote for the package
* /package/$pkg_name/unvote: Remove vote

Note that this code is very hackish and should be refactored once we
drop support for legacy URLs.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Move package actions to the action box

Note that this currently only works if the virtual path feature is
enabled. If you don't use virtual paths, these will still be displayed
as buttons below the package details listing.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Move adoption button to package actions box

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
actions_form.php: Hide empty form

Do not show the actions form if it doesn't contain any elements. This
comes into effect if the virtual path feature is enabled and the current
user doesn't have TU/developer privileges.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
pkg_details.php: Verbose labels for package actions

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Rearrange package actions

Move the flag/unflag action below the flag date.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
pkg_comments.php: Fix notice

Fix a notice that appeared if comments were available and the package
was requested by name. See 07d3649c2d68bd67ebbcbe10ee9535364903a0f8 for
a similar fix for links to the voters page.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
aur.inc.php: Include routing backend

This needs to be available on every page since it is needed for
get_uri() and get_pkg_uri() and "web/html/index.php" isn't executed if
the virtual path feature is disabled.

Reported-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
routing.inc.php: rtrim() path in get_route()

Return the correct route -- even if a "/" is appended to the URI.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
routing.inc.php: Add missing "/account" route

Minor oversight when adding the routing back end in commit
eb22bcc7548d1b1025a3832aa4555792729d11b0.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
pkgfuncs.inc.php: Fix pkg_change_category()

Make sure that pkg_change_category() works, even if the "N" get
parameter is used and "ID" is unset. Note that this is considered to be
a hack rather than a proper fix; pkg_change_category() needs a lot of
work.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
pkg_comments.php: Fix links to user accounts

Regression introduced in 2425f963f8ad45292c217914b5fee1ed18104c26.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
pkg_comments.php: Fix comment deletion links

* Add a missing quote to the "alt" attribute. Regression introduced in
  d8b2eb4b628e8927b0bed1b254c996520de95b83.

* Retrieve and store the package name before overwriting the "$row"
  variable.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
voters.php: Do not re-include libraries

Use include_once() instead of include(). Otherwise, a fatal error is
shown if the virtual path feature is used since "web/lib/aur.inc.php" is
already included in the routing front end.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
voters.php: Use "<ul></ul>" for the list of voters

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
pkg_details.php: Remove field set in actions box

archweb uses "<div></div>" and "<p></p>" here.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Use virtual paths for voters page

Link to "/packages/$pkgname/voters/" instead of using "/voters/" and a
get parameter to request a specific package by ID.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
pkgsubmit.php: Make page friendlier for logged out users

Logged out users who navigate to /submit currently reach a page with only an
error message. This adds the full navigation bar for users who errantly reach
/submit before logging in.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
pkg_details.php: Fix broken HTML for package page with no dependencies

The "Required by" column already handles an empty list appropriately. Move a
</div> tag to match that behavior in the "Dependencies" column

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Update docs to require Archive_Tar version greater than 1.3.7

Prior to version 1.3.8 of Archive_Tar, long filenames within a tar file
would result in the filename being a shortened string of the fullname. This
shortening would prevent the upload of any tar file having a filepath longer
than 99 characters. Require AUR installations to use an update Archive_Tar
version to avoid related issues

Fixes FS#30472

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>