Commit graph

69 commits

Author SHA1 Message Date
Lukas Fleischer
3b1dad229b Fix category selection
Add a package ID parameter to pkg_change_category() instead of relying
on the "ID" or "N" GET parameters.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-09-18 16:09:30 +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
f3ce74c714 Merge branch 'maint'
Conflicts:
	web/html/account.php
	web/html/addvote.php
	web/html/pkgsubmit.php
	web/lib/acctfuncs.inc.php
	web/template/actions_form.php
	web/template/pkg_comment_form.php
	web/template/pkg_comments.php
	web/template/pkg_details.php
	web/template/pkg_search_results.php
	web/template/tu_details.php
2012-07-14 22:52:04 +02:00
canyonknight
2c93f0a98f Implement token system to fix CSRF vulnerabilities
Specially crafted pages can force authenticated users to unknowingly perform
actions on the AUR website despite being on an attacker's website. This
cross-site request forgery (CSRF) vulnerability applies to all POST data on
the AUR.

Implement a token system using a double submit cookie. Have a hidden form
value on every page containing POST forms. Use the newly added check_token() to
verify the token sent via POST matches the "AURSID" cookie value. Random
nature of the token limits potential for CSRF.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-06-24 10:59:23 +02:00
Lukas Fleischer
5b0f1f39db web/html/packages.php: Remove duplicate code
Retrieve the package ID early and merge the if-branches calling
package_details().

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-05-06 12:47:19 +02:00
Lukas Fleischer
cf2f667512 Support canonical links to packages
This is more user-friendly than supporting package IDs only and can be
used as a basis to support direct links to AUR packages in places where
links are computer-produced (e.g. Wiki templates).

Addresses FS#21600 and FS#28839.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-03-24 10:34:35 +01:00
Dan McGee
34fe0bec4c Use 'true' instead of 'True' everywhere
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-08-11 16:17:09 +02:00
Lukas Fleischer
87bdee60bc Allow for merging deleted packages into existing ones
Merge all comments and votes of deleted packages into another package if
the "Merge with" field is used. Duplicate votes (votes from a user who
already voted on the target package or voted on more than one of the
deleted packages) are discarded.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-08-11 16:17:07 +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
Lukas Fleischer
d142ca4053 Fix PHP warning when browsing a non-existent package.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-04 23:31:19 +02:00
Lukas Fleischer
55eb55a75f Fix PHP undefined notice in "web/html/packages.php".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-30 11:06:20 +02:00
Dan McGee
80401c6afc More PHP Notice undefined fixups
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-10 18:15:59 +01:00
Dan McGee
d1d0288598 Add action lookup helper function
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-04 10:29:15 +01:00
Dan McGee
90485e8f42 Fix potential injection vulnerability
We trusted the values we pulled out of the IDs array and never coerced
them to integers, passing them to the backend unescaped and uncasted.
Ensure they are treated as integers only and validate the resulting
value is > 0.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-01 20:27:49 +01:00
Dan Vratil
57a5cbfd88 Auto redirect from confirmation screens.
Finally move comment deletion and category editing into functions and
remove pkgedit.php

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
-Fix indentation
-Fix variable naming conflict $id vs $cid
2010-11-21 03:37:17 -05:00
Lukas Fleischer
b5bc6ab742 Confirmation when deleting packages
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2010-07-01 21:19:18 -04:00
Loui Chang
d53901eecd packages.php: Fix explicit sorting when search keywords aren't specified.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2010-03-13 00:03:00 -05:00
Loui Chang
b6e012ea3b packages.php: Only sort by vote if search keyword isn't set.
People entering explicit search terms would expect alphabetical order.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2010-03-12 16:47:48 -05:00
Loui Chang
b51458f752 packages.php: Check if _GET value is set before assuming a default.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-12-15 22:39:14 -05:00
Loui Chang
9c1781f03d packages.php: Make default view sort packages by descending votes.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-12-15 11:15:43 -05:00
Loui Chang
1bc4836e19 Restyle the layout.
Make HTML markup more logical.
Remove some unused style sheets rules.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-11-23 23:24:56 -05: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
402c6d0933 Fix the comment poop bug.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-02-20 20:59:07 -05: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
Callan Barrett
e12a8ad3da Remove success messages after package functions
Just displays message at the top of the page of what happened (errors or not) and goes back to the same page

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-20 18:33:45 -05:00
Callan Barrett
cde524e175 Change behaviour of package functions to accept normal arrays
Package functions use a normal array of pkgids now and packages.php has been changed to accomodate for it

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-20 16:58:30 -05:00
Callan Barrett
ac8b080e43 Clean up packages.php and document new package functions
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-11-23 13:23:33 -05:00
Loui Chang
2ac75bd812 Move package notification into a function.
Also modify the way notification is done. Instead of toggling
notification, users can explicitly notify or unnotify.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-11-13 15:19:20 -05:00
Callan Barrett
132fd7cfc7 Convert package voting to a function
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-10-30 10:45:31 -04:00
Callan Barrett
5d4303d0b6 Convert package adoption/disowning to a function
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-10-27 20:40:37 -04:00
Callan Barrett
a447281d4f Convert package deletion to a function
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-10-16 22:27:45 -04:00
Callan Barrett
8f5882e68d Convert package flagging to a function
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-10-14 19:36:04 -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
604156950c Make use of PEAR packages in pkgsubmit.php
Uses File_Find and Archive_Tar in pkgsubmit.php
Removes references to PackageContents

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-06-12 02:30:17 +08:00
Callan Barrett
94a8053210 Disable user package deletion
Users can no longer delete packages if they own them, only TUs and devs

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-06-06 02:10:59 +08:00
Callan Barrett
04dae8d94f Remove references to AURMaintainerUID
This (should) get rid of anything to do with the unused column AURMaintainerUID
in the scripts and schema files

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Simo Leone <simo@archlinux.org>
2008-03-27 02:34:35 -05:00
Simo Leone
99e65b28d8 Revamped pkg_search_page()
- Reduced database hits
- Improved speed
- Improved sanity (slightly)
- Fixed searches,buttons,gizmos

Signed-off-by: Simo Leone <simo@archlinux.org>
2008-03-23 03:07:22 -05:00
Callan Barrett
e0582fd0e2 Fix weird title setting on search page
This is to fix FS#9610, pretty simple patch

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Simo Leone <simo@archlinux.org>
2008-03-23 03:04:16 -05:00
Simo Leone
7bad8a8357 Removed QBUG and DBUG
It was broken and hardly used. It's just as easy
to add short print statements or logging if
some debugging output is needed.

Signed-off-by: Simo Leone <simo@archlinux.org>
2008-01-23 02:51:33 -06:00
Simo Leone
2bcd8ff1db Fix package detail action buttons
Drop-down boxes broke them, now they work again.
Yippee!

Signed-off-by: Simo Leone <simo@archlinux.org>
2008-01-21 16:23:28 -06:00
Callan Barrett
d14def92ff Turn action bar into drop box
Moves the action bar down to the bottom right of the search results and turns it
into a drop-down selection box.

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Simo Leone <simo@archlinux.org>
2008-01-20 03:18:16 -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
d4b07f2b33 Tweaks of various page layouts and handling of data
This is a patch that fixes a lot of little things:
* We no longer have pkgsearch or pkgdetails link functions and all
references to them are gone, that's what a back button is for and if
we really need it we can come up with something better
* No longer have do_Details variable, this means links on the package
search are simply ?ID=foo
* On the pkgdetails pages when there are either no deps, deps by,
sources or comments for a package the list for each will display
"None" instead of nothing at all (ruining the layout)
* Fixed a bug where if a package had no sources or no deps
pkgsubmit.php would submit an empty one
* Translation of the word "Search'" has been changed to "Search"

Most of these relate to each other.

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-01-20 00:21:20 -06:00
Callan Barrett
8c94552042 Add notify column in search results and notify button
Adds a column to search results showing if a package has comment
notification enabled and adds support for toggling notify for
multiple packages from search

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-01-20 00:21:19 -06:00
Callan Barrett
9a83e56b69 Adds support for TUs and devs to disown packages they do not own
This is to add support for either devs or TUs to disown packages
whether they own them or not. I know of countless times where I or
another TU have been asked to orphan packages for someone and end up
having to adopt the package first and then disown it, this gets really
tedious for more than one package. As far as I can tell there's no
other way to disown packages you don't own and if there is at least
this is a more obvious way, pretty sure I didn't leave anything out in
the patch.

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-01-20 00:21:19 -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
tardo
881b921eb3 Fixed version strings.
Added AUR_VERSION to config file, so now we should only need to
change one location. KISS ftw.

Signed-off-by: tardo <tardo@nagi-fanboi.net>
2007-10-02 07:29:27 -04:00