Commit graph

1647 commits

Author SHA1 Message Date
Lukas Fleischer
07d3649c2d pkg_details.php: Fix link to voters if ID is unset
When a package is requested by name, the "ID" request parameter might be
unset. Use the "ID" field of the query result instead.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-17 17:55:53 +02:00
Lukas Fleischer
7c1c36ebc8 web/html/pkgsubmit.php: Remove stray "</div>"
Regression introduced in f3ce74c714 when
resolving conflicts.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-15 22:55:48 +02:00
Lukas Fleischer
799c1ead82 Redirect to the home page after successful login
Jump to the home page instead of displaying a page that only tells you
that you're logged in.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-15 22:48:33 +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
2425f963f8 Use virtual path feature for links
Use virtual paths in links (e.g. link to "/packages/" instead of
"/packages.php" etc.) if the virtual path feature is enabled.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-15 22:44:51 +02:00
Lukas Fleischer
a03c684ecd Use absolute URIs for style sheets and images
This is needed for our new URI scheme, since we will use virtual
directories, such as "/packages/" instead of "/packages.php" etc.

Having relative URIs results in incorrect paths, such as
"/packages/css/aur.css" (instead of "/css/aur.css").

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-15 22:42:45 +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
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
857de725d1 pkgsubmit.php: Refactor source processing to fix PHP notice
A foreach() being run without checking to see if the uploaded PKGBUILD had any
sources now no longer causes an undefined index notice when there are no
sources.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-14 22:19:52 +02:00
canyonknight
1fd559151b aur.inc.php: Use delete_session_id() where appropriate
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-14 22:19:52 +02:00
canyonknight
50e97446bb acctfuncs.inc.php: Make user_suspended() work correctly
Fixes broken account suspension system.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-14 22:18:58 +02:00
canyonknight
81e0b7fe18 tu.php: Fix PHP notice for "hasvoted" variable
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-11 19:26:30 +02:00
canyonknight
8201dead3b pkgsubmit.php: Remove stray "</div>" tag
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-11 19:26:30 +02:00
Lukas Fleischer
44b857a98c pkg_details.php: Move "<div>" tag into if-branch
The corresponding closing "</div>" tag is only printed if the if-branch
is taken, which results in broken HTML code if the if-branch is skipped.
Move the "<div>" tag so that either both or none of the tags are
included in the generated HTML code.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-09 20:36:53 +02:00
Lukas Fleischer
6f7de5c818 pkg_details.php: Fix dependency links
Remove an erroneous quote from the destination URL of links to
officially supported package dependencies on archweb.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-09 20:28:53 +02:00
Lukas Fleischer
a5f1fb66fc Update archweb stylesheet
Pull in the latest changes from the archweb Git repository.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-09 13:10:35 +02:00
Lukas Fleischer
a64f23ff94 Remove legacy CSS
We completely switched to using the archweb stylesheet (with some custom
extensions in "aur.css"). The old CSS files are no longer needed.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-08 10:32:40 +02:00
Lukas Fleischer
8a5adf46ae acctfuncs.inc.php: Fix "Undefined variable" notices
Initialize the "$details" and "$whovoted" variables with an empty
array/string to suppress a "Undefined variable" notice if the
votes/voters list is empty.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-08 10:31:18 +02:00
canyonknight
c1bb1df2b3 acctfuncs.inc.php: Move XHTML to account_details.php template
XHTML should be eliminated from lib/ as much as possible. This pulls the XHTML
out of the display_account_info function that echoes the code, and moves it
to the new account_details.php template file.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:27:16 +02:00
canyonknight
b5ffdeb63e pkgsubmit.php: Improve file upload error messages
* Currently, $_FILES showing a filesize of zero is interpreted as no file was
uploaded, despite other errors potentially being the cause.
* The $_FILES superglobal stores what the actual error was, so use it. This
includes file write problems, empty uploads, partial uploads, and
upload_max_filesize being exceeded.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:27:14 +02:00
canyonknight
5ebf9d64ee aur.inc.php: Remove old and unused make_seed function
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:27:12 +02:00
canyonknight
d8d36d6f4b acctfuncs.inc.php: Make user_is_privileged() work
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:27:11 +02:00
canyonknight
445932d8e8 Remove deprecated configuration variable
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:27:09 +02:00
canyonknight
dac62225d3 acctfuncs.inc.php: Allow functions to take DB handle as argument
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:27:07 +02:00
canyonknight
41986bbc78 rss.php: Pull out DB code
* Move DB code in rss.php to new function in aur.inc.php
* Centralization of DB code important in a future transition to PDO interface

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:27:06 +02:00
canyonknight
c15441762c Pull out DB code from trusted user page
* Move DB code in tu.php and tu.php and tu_list.php to new functions in
accfuncs.inc.php
* Centralization of DB code important in a future transition to PDO interface

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:27:04 +02:00
canyonknight
8a59cd6208 account.php: Pull out DB code
* Move DB code in account.php to new functions in  acctfuncs.inc.php
* Centralization of DB code important in a future transition to PDO interface
* Consolidate redudant SQL statements from DisplayAccount and AccountInfo
* Consolidation also adds ability to edit accounts based on username

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:27:03 +02:00
canyonknight
763cbf8373 pkgsubmit.php: Pull out DB code
* Move DB code in pkgsubmit.php to new functions in  aur.inc.php and
pkgfuncs.inc.php
* Centralization of DB code important in a future transition to PDO interface

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:27:02 +02:00
canyonknight
82d234c4d5 passreset.php: Pull out DB code
* Move DB code in passreset.php to new functions in acctfuncs.inc.php
* Centralization of DB code important in a future transition to PDO interface

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:27:00 +02:00
canyonknight
f93f1a652f logout.php: Pull out DB code
* Move DB code for removing a session in logout.php to a new function in
acctfuncs.inc.php
* Add ability for clear_expired_sessions function to check for DB connection
* Centralization of DB code important in a future transition to PDO interface

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:26:59 +02:00
canyonknight
d3de667901 pkg_comment_form.php: Pull out DB code
* Move DB code and e-mail code from pkg_comment_form.php to new function in
pkgfuncs.inc.php
* Centralization of DB code important in a future transition to PDO interface

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:26:57 +02:00
canyonknight
84d21e6f30 pkg_search_results.php: Pull out DB code
* Move DB code from pkg_search_results.php to already existing function
in pkgfuncs.inc.php
* Centralization of DB code important in a future transition to PDO interface

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:26:56 +02:00
canyonknight
71f2efd7af account_search_results.php: Pull out DB code
* Move DB code from account_search_results.php to already existing function
in acctfuncs.inc.php
* Centralization of DB code important in a future transition to PDO interface

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:26:54 +02:00
canyonknight
c2b65f2b7b action_form.php: Pull out DB code
* Create new functions in pkgfuncs.inc.php with SQL queries from
action_form.php
* Centralization of DB code important in a future transition to PDO interface
* Flip logic of vote and notify XHTML button to use function return rather
than a more confusing NOT (!) logical operator statement

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:26:53 +02:00
canyonknight
1eea2951fb addvote.php: Pull out DB code
* Verifying a username exists should use already present valid_user function
* Create new functions in acctfuncs.inc.php with SQL queries from addvote.php
* Centralization of DB code important in a future transition to PDO interface

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:26:51 +02:00
canyonknight
09e50568e4 voters.php: Pull out DB code
* Create new function in pkgfuncs.inc.php with SQL queries from voters.php
* Centralization of DB code important in a future transition to PDO interface

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:26:50 +02:00
Lukas Fleischer
091c2b5f55 Move language selection to a drop-down list
Move all languages to a select container to save some space. Language
selection is a rarely used feature, so there's no need to make this a
one click option.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:26:47 +02:00
canyonknight
16e250b69d actions_form.php: Overhaul to match archweb
* Change all CSS to match archweb
* General clean-up of XHTML formatting
* Change control structures to use PHP alternative syntax for better
readability with inter-mixed XHTML

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:26:45 +02:00
Lukas Fleischer
98c497d039 Restructure the navigation bar
* Remove "Bugs" and "Discussion" links. Move these to the home page.
* Reorder links in a reasonable and consistent manner.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: canyonknight <canyonknight@gmail.com>
2012-07-06 11:26:42 +02:00
Lukas Fleischer
0928525793 Move login form to a separate page
Do not show the login form on every page. Move it to a separate login
page and add a link to the navigation bar. Also, add a logout link for
logged-in users.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: canyonknight <canyonknight@gmail.com>
2012-07-06 11:26:38 +02:00
canyonknight
2d53cdd4d5 passreset.php: Overhaul to match archweb
* Switch to CSS used by archweb
* General fixups in XHTML

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:26:36 +02:00
canyonknight
be0cf7f41f acctfuncs.inc.php: Move XHTML to account_search_results.php template
XHTML should be eliminated from lib/ as much as possible. This pulls the XHTML
out of a function that simply echoes the code, and moves it into a more
reasonable template file in account_search_results.php

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:26:34 +02:00
canyonknight
f78d46c654 acctfuncs.inc.php: Move XHTML to account_edit_form.php template
XHTML should be eliminated from lib/ as much as possible. This pulls the XHTML
out of a function that simply echoes the code, and moves it into a more
reasonable template file in account_edit_form.php

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:26:31 +02:00
canyonknight
13b892e923 Overhaul account pages to match archweb
* Use CSS from archweb
* General clean-up of XHTML formatting

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:26:30 +02:00
canyonknight
1b0b989fa1 addvote.php: Overhaul to match archweb
* Switch CSS over to archweb styling
* General clean-up of XHTML
* Set proposal box size to something more sane for a default

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:26:28 +02:00
canyonknight
af8f60fe7f Overhaul trusted user proposal page to match archweb
* Change all boxes and other CSS to match archweb
* General fixups in XHTML formatting
* Change results table to match color scheme everywhere else

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:26:26 +02:00
canyonknight
d2480e8b9d Overhaul to stat tables to match archweb
* Move stat tables into widget boxes to match archweb
* Remove old span styles
* Clean-up XHTML formatting
* Minor whitespace fix

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:26:25 +02:00
canyonknight
d8b2eb4b62 pkg_comments.php: Overhaul to match archweb
* Limit PHP echoing XHTML as much as possible, and use pure XHTML
* Switch to alternative syntax in control structures for better readability of
inter-mixed XHTML
* Remove box for every comment and switch to archweb news post style

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:26:23 +02:00
Lukas Fleischer
941f310068 Search form layout overhaul
* Always show advanced search criteria.

* Rearrange filter criteria (list filters first, list sorting and
  pagination options behind).

* HTML cleanup.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: canyonknight <canyonknight@gmail.com>
2012-07-06 11:26:19 +02:00
Lukas Fleischer
0d05a26a5a Refactor package submission form
* Adjust style to match the overall layout.
* Use proper HTML tags and double quotes.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: canyonknight <canyonknight@gmail.com>
2012-07-06 11:26:16 +02:00