Commit graph

113 commits

Author SHA1 Message Date
canyonknight
1e9d539acf Further optimize voters.php to only need the package name
* Extends changes in 81d4cc13dc
* Modify getvotes() to use the package name rather than package ID
* Rename getvotes() to votes_for_pkgname() for clarity with new changes
* Modify routing framework and links to now use package names for voters.php

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-01-22 18:27:42 +01:00
canyonknight
dbf1d474f7 Convert adopt/disown package action link to form
* Changes adopting/disowning packages to use GET instead of POST
* Uses CSS to make form submit button look like a link
* Complements commit 3bc951e3d8

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-09-08 13:53:47 +02:00
Lukas Fleischer
69b98efa35 Re-add CRSF tokens to most package actions
We fixed all known CRSF vulnerabilities in commit 2c93f0a (Implement
token system to fix CSRF vulnerabilities, 2012-06-23). c349cb2 (Add
virtual path support for package actions, 2012-07-17) partly reverted
this by injecting a valid CRSF token when virtual paths are in use.

This patch allows for keeping the virtual path feature, while
reintroducing POST forms and CRSF tokens. Actions like package flagging,
votes and notifications are no longer prone to CRSF (see FS#35437 for
details).

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-27 02:27:19 +02:00
Lukas Fleischer
0703b02c53 Use minified typeahead JS from archweb
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-03-26 00:54:18 +01:00
Marcel Korpel
b004333ead Implemented typeahead suggest
Use Twitter Bootstrap JavaScript framework for typeahead support.

Add a new "suggest" JSON method, which returns the first 20
packages that match the beginning characters of a query.

canyonknight: Link format change, commit message
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-01-19 12:17:55 +01:00
canyonknight
c7d20163a4 index.php: Move voter page token check to switch control structure
Voter page token check takes place in the same way as other
existing token checks. Move the check for consistency.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-11-24 13:20:44 +01:00
Lukas Fleischer
69e2d1dcff Return 404 for invalid account/package subpages
Display an error page and return a 404 status code in the following
cases:

* An invalid package name is passed to the "packages" action.
* An invalid user name is passed to the "account" action.
* An invalid package action is passed.
* An invalid account action is passed.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-10-30 14:56:43 +01:00
Lukas Fleischer
f0be65875b Display an error page if a virtual path doesn't exist
Give user feedback instead of bailing out with an empty HTTP response
body.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-10-20 18:28:17 +02:00
canyonknight
752c5a6e34 Move package merging to a separate page
Package actions now have a separate box on the package details page. Add
a package merge link in that box.

Link leads to a new page (pkgmerge.php) that can be used to confirm package
merging. A separate page with confirmation is used to avoid CSRFs.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-09-28 08:57:25 +02:00
canyonknight
00cffd7ddb Move package deletion to a separate page
Package actions now have a separate box on the package details page. Make
a package deletion link in that box.

Link leads to a new page (pkgdel.php) that can be used to confirm package
deletion. A separate page with confirmation is used to avoid CSRFs.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-09-28 08:57:24 +02:00
Lukas Fleischer
2e552cbcad Do not set GET parameters in the routing framework
Setting GET parameters manually is bad style and causes some strange
side effects when using virtual URLs and mkurl().

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-09-18 14:05:11 +02:00
Lukas Fleischer
3d4cb66aed index.php: Fix undefined variable notice
Spotted when browsing the package details page while being logged out.

Reported-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-09-18 14:01:09 +02:00
canyonknight
e84eb4ae54 Overhaul ability to edit own account
* Restructure account.php to remove redundant code.
* Remove own_account_details().
* Rework logic check to default to no access to account edit form.
* Make default account action viewing account info.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-09-18 00:59:45 +02:00
canyonknight
d6f89f97c0 Use URL rewriting for user account update page
The "UpdateAccount" page displays information as to whether an account
update was successful. All POST account info goes to this page, so use
it with sane URLs.

Before:
AUR_URL/account/?Action=UpdateAccount&U=userfoo

After:
AUR_URL/account/userfoo/update

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-09-18 00:59:29 +02:00
canyonknight
5c0de7825d Use URL rewriting for user editing page
Allows for easier account editing and saner URLs. Update account editing links
to use new URL.

Before:
AUR_URL/account/?Action=DisplayAccount&U=userfoo

After:
AUR_URL/account/userfoo/edit

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-09-18 00:59:23 +02:00
canyonknight
98b6ba9479 Use URL rewriting for user info page
Navigation to the "AccountInfo" page should only require a user to know the
username of the account they are looking for. Update all AUR links that use
the user info page to reflect the new URL.

Before:
AUR_URL/account/?Action=AccountInfo&U=userfoo

After:
AUR_URL/account/userfoo

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-09-18 00:59:21 +02:00
canyonknight
36abb9efb9 Use the "new" icon from archweb for the recent updates table
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-09-18 00:59:00 +02:00
Lukas Fleischer
7ad4bc352d 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>
2012-07-18 08:23:27 +02:00
Lukas Fleischer
f2301ca922 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>
2012-07-17 23:10:27 +02:00
Lukas Fleischer
6790b36247 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>
2012-07-17 23:10:26 +02:00
Lukas Fleischer
c349cb2fea 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>
2012-07-17 22:19:07 +02:00
Lukas Fleischer
03486c3b6f Use virtual paths for package details
Extend the routing front/back ends to allow for using
"/package/$pkgname/" for individual packages.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-15 22:48:32 +02:00
Lukas Fleischer
eb22bcc754 Add routing front/back ends
This adds a URL mapping library that can be used to implement virtual
paths. Also, "web/html/index.php" is moved to "web/html/home.php" and
"web/html/index.php" becomes a routing front end that maps virtual paths
to corresponding files.

To enable the virtual path feature, all requests need to be redirected
to the "index.php" routing script. If you use lighttpd, following
rewrite rule can be used:

    url.rewrite = ( "^(.*)$" => "/index.php/$1" )

A similar rule can be used for Apache (using mod_rewrite).

Note that the current routing front end only works if PATH_INFO is
provided.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-15 18:16:26 +02:00
canyonknight
c1c74f0c37 index.php: Overhaul to match archweb
* Switch to CSS used by archweb
* Move package search to a smaller box to match the style of the main site
* Add text describing mailing list and bug tracker. Eventually remove those
associated nav bar links.
* General clean-up of XHTML

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:26:04 +02:00
Lukas Fleischer
f90d569376 Remove all traces of "pgboxtitle"
Using a div container to format heading is ridiculous. Use "<h2></h2>"
instead.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: canyonknight <canyonknight@gmail.com>
2012-07-06 11:25:58 +02:00
Dan McGee
97085daadc user_table optimization
Rather than looking up by username, it makes more sense to look the
stats up by user ID to reduce the number of needed joins.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-05-06 12:12:51 +02:00
Dan McGee
8dc7b37909 Remove a boatload of inline table styles
Replacing with CSS styles where appropriate. A previously unused CSS
style is tweaked in the stylesheet to match most of what was done via
non-CSS styling.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-24 17:57:52 +02:00
Lukas Fleischer
ee4b398033 Use "%s" instead of "%h" in format strings
Use the standard string type specifier instead of "%h" in format
strings. Both specifiers are treated equally in __() so we shouldn't
break anything here. This also allows us to replace the hacky
substitution algorithm in __() by vsprintf().

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-08-20 20:28:47 +02:00
elij
888db089c5 rename *.inc files to *.inc.php and adjust imports and references
Lukas: Add note to "UPGRADING".

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-06-22 15:15:04 +02:00
Dan McGee
46f2798524 Use include_once where applicable
All of these are sourcing function libraries so we don't need to include
them more than once. Things that insert actual HTML into the output were
left calling include().

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-08-11 13:58:12 -04:00
Loui Chang
610733eafd Remove excess whitespace.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-06-25 00:05:44 -04:00
Loui Chang
2ee3276348 Use new conglomerated translation files.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-01-19 16:29:45 -05:00
Callan Barrett
d62baaecf0 Add search bar to index and pkg details pages
Also changed it around a little bit so it's not tied down the search results function

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-29 17:31:55 -05:00
Loui Chang
78c2b5c67f Introduce function include_lang for translations.
This includes only the requested language for each page and
makes top level language include files obsolete.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-21 18:03:27 +09:00
Loui Chang
25e9bb1698 Reword the disclaimer in index.php.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-17 12:58:16 -05:00
Loui Chang
692cc1e953 Make remembered sessions actually save themselves.
Also clean up a notice in index.php

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-11-25 01:31:08 -05:00
Loui Chang
b81e3c2f68 Tweak index.php and update translations.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-07-28 16:57:56 +08:00
Loui Chang
6bae84f34a Change some of the index page notices.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-07-22 13:51:13 -04:00
Loui Chang
36ee556103 Move code out of index.php
Move database queries to functions and html to templates.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-07-07 11:41:39 -04:00
Loui Chang
3a42725601 Remove all vim mode lines. Add HACKING file.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-06-17 01:38:01 -04:00
Callan Barrett
4d29be001b Split html and php in index.php
No more prints, still all in same file

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-06-12 01:29:34 +08:00
Michael Klier
a410303e4c Remove obsolete inline CSS in index.php.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-06-07 14:46:55 -04:00
Callan Barrett
f197dff507 Revert "Split html from front page"
This reverts commit 0cf3c5ea8b.
2008-06-08 01:58:07 +08:00
Callan Barrett
0cf3c5ea8b Split html from front page
html from the index page has been moved to a template file (front_page.php)
needs indentation really bad

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-06-08 01:15:40 +08:00
eliott
249d92f5aa Cleaned up the front page.
Cleaned up the front page.

Removed the blank box on the right of the front page, that was leftover from
the change to the login form (move).
2008-02-18 17:55:54 -06:00
Callan Barrett
8ab823728c More cleanup, add TU link to header
Cleans up links on front page, adds a TU link to the header to the voting
application, fixes some titles and styling for logged in text

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-01-20 00:21:21 -06:00
Callan Barrett
379e16eebd Support for verbose page titles
Verbose page titles again

Adds support for more verbose page titles based on current
page and action by user and removes sort by options from
search form as they're obsolete by column links.

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-01-20 00:21:20 -06:00
Callan Barrett
0e4b25211b Removes timeout page and moves login form to header
This removes the need for a timeout page (and probably hacker.php) and
moves the login form and status to the header. If your login times out
you won't lose your place anymore and links will always work. Works
for me but at the moment index_po.php is imported in aur.inc which has
to stay until the translations from it for login are moved to
aur_po.php.

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-01-20 00:21:19 -06:00
eliott
d245f691ee Fixes to disclaimer text. 2008-01-20 00:21:18 -06:00
eliott
a9837329d6 Hand diff of simo's patch to remove flag safe functionality.
Simo's original commit text:
 The idea of safe flagging is unclear, poorly named, misunderstood,
 and not even used. At the time this patch was created, less than
 a third of the packages in unsupported were flagged safe, and less
 than a tenth of users knew how to interpret it.

 The safe flag has been replaced by a disclaimer on the main page.
2008-01-20 00:21:18 -06:00