Commit graph

570 commits

Author SHA1 Message Date
Lukas Fleischer
eef5353bde Remove "New Package Notify" option from user account settings.
Do this in preparation for the upcoming notification script removal.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-13 12:22:28 +02:00
Lukas Fleischer
3a5693166c Remove comment on translation helpers from "web/lib/translator.inc".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 16:27:48 +02:00
Lukas Fleischer
22a718ea89 Replace translation engine with php-gettext.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 15:40:50 +02:00
Lukas Fleischer
779ecc8c3a Add php-gettext libraries to "web/lib/".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 15:40:49 +02:00
Lukas Fleischer
668826226a Release 1.8.2.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 15:38:28 +02:00
Lukas Fleischer
1c55e6b40c Add option to search for exact name matches only (fixes FS#23556).
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-06 19:21:19 +02:00
Lukas Fleischer
8cd2aef50d Initialize "$name" in pkgname_from_id().
Ensures "$name" is always initialized, even if the package doesn't
exist. Fixes PHP warnings appearing when retrieving package details of a
package with an invalid ID.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-05 11:38:43 +02:00
Lukas Fleischer
8b4b2d207e Remove File_Find PEAR module from code base.
We removed the code depending on this a long time ago - drop it and add
some note to "UPGRADING".

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-05 11:31:12 +02:00
Dan McGee
2005a2889c Add more stats to the front page table
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-03 22:59:33 +02:00
Dan McGee
7c91c59245 Remove Dummy Package concept
Instead, we just store dependencies directly in the PackageDepends
table. Since we don't use this info anywhere besides the package details
page, there is little value in precalculating what is in the AUR vs.
what is not.

An upgrade path is provided via several SQL statements in the UPGRADING
document. There should be no user-visible change from this, but the DB
schema gets a bit more sane and we no longer have loads of junk packages
in our tables that are never shown to the end user. This should also
help the MySQL query planner in several cases as we no longer have to be
careful to exclude dummy packages on every query.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-03 22:59:32 +02:00
Dan McGee
1f252eba64 Always set ModifiedTS including new packages
Set it equal to the SubmittedTS field, which will be our indication the
package is new when we show the logo on the front page of the AUR.

This results in the ability to remove the use of the unindexable
GREATEST() function from the AUR code everywhere we had to use it before
to handle the 0 timestamp case.

Note that there is no race condition here in calling UNIX_TIMESTAMP()
twice- it always returns the time at the beginning of statment
execution:

    mysql> select unix_timestamp(), sleep(2), unix_timestamp();
    +------------------+----------+------------------+
    | unix_timestamp() | sleep(2) | unix_timestamp() |
    +------------------+----------+------------------+
    |       1300851746 |        0 |       1300851746 |
    +------------------+----------+------------------+
    1 row in set (2.00 sec)

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-03 22:59:31 +02:00
Dan McGee
b6a34d013b Bump up default per-page value to 50
25 is woefully small for the number of packages many searches can
return, and with 28000+ packages in AUR, it makes sense to show a lot
more per page by default.

The new choices of (50, 100, 250) happen to match those from the main
site.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-24 15:32:08 +01:00
Lukas Fleischer
bd36412321 Fix searching for orphans with "$LANG != 'en'" (fixes FS#23252).
Regression introduced in commit ef8fab0c. Removed the strict check again
instead of wrapping it in __() to ensure search URLs are language
independent.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-12 19:54:35 +01:00
Lukas Fleischer
7f9e498e48 Fix broken XHTML.
Fix a lot of invalid XHTML in the templates and actions. There might
still be some legacy code left, but this should cover most of it.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-11 19:00:50 +01:00
Dan McGee
c34bebf428 Perform a second query to find total search count
This removes the need for SQL_CALC_FOUND_ROWS which can really slow down
queries in a lot of cases. The COUNT(*) query we end up performing can
reuse a lot of the original clauses from our primary query, but we can
really slim it up by omitting some joins and the sorting/limiting
clauses.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-10 18:16:00 +01:00
Dan McGee
2cfcddf24e Split package search query into parts
No functional change here; we should be rebuilding the same query at the
end of the process.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-10 18:16:00 +01: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
Lukas Fleischer
29b2f3b399 Release 1.8.1.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-09 17:44:21 +01:00
Dan McGee
d186bcfd89 Add a sanitize_ids function and use it in all pkg_* functions
And use implode() instead of some looping/first time logic.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-04 10:29:18 +01:00
Dan McGee
d4b1ca7cf1 Set a default timezone
With our use of strtotime() in stats.inc, we are "required" to do so or at
least the emitted warning tells us it is a good idea.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-04 10:29:17 +01:00
Dan McGee
cdc01130cf Fix PHP notices in account pages
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-04 10:29:17 +01:00
Dan McGee
ddbe6d0d33 Remove dead dependency/required by link code
For some reason we were doing this song and dance "iterate all the known
parameters" business. This is totally unnecessary, clutters the links,
and was spewing errors all over the place, so kill it.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-04 10:29:17 +01:00
Dan McGee
ef8fab0c12 Ensure all variables are set in package search form
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-04 10:29:16 +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
bbc90846f5 Ensure all package ID values are coerced to integers
We don't need mysql_real_escape_string(), we need valid integer
conversions.

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
0e30410767 Vastly simplify pkg_delete function
Since only TUs/Devs can delete packages, we can remove almost all checks
except the account type check. And now that our DB uses foreign keys,
all of the other deletes happen implicitly when a package is deleted so
we don't need to take care of it here.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-04 10:29:14 +01:00
Dan McGee
f9eba12312 Ensure users can be deleted when foreign keys are present
This change is necessary to prevent this:
    mysql> delete from Users where ID = 112;
    ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (`aur`.`Packages`, CONSTRAINT `Packages_ibfk_2` FOREIGN KEY (`SubmitterUID`) REFERENCES `Users` (`ID`) ON DELETE NO ACTION)

As a bonus, due to foreign keys, orphaning of packages will be
automatic.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-04 10:29:14 +01:00
Dan McGee
984ce9529c Improve cookie handling
* Remove comment that is mostly bogus- the domain is automatically set.
* When logging out, don't delete the language cookie.
* Make the language cookie persistent.
* Use the minimal time possible to expire cookies; no need to compute
  anything.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-04 10:29:13 +01:00
Florian Pritz
85c0db0ccd Set the character set when connecting to mysql
We should not rely on the default server setting staying the same
forever.

Signed-off-by: Florian Pritz <bluewind@server-speed.net>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-27 19:46:30 +01:00
Lukas Fleischer
1e3fa38de5 Define "Packages.SubmitterUID" and "Packages.MaintainerUID" as "NULL".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-27 19:46:19 +01:00
Lukas Fleischer
40ccf77ca0 Define "PackageComments.DelUsersID" as "NULL".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-27 16:20:02 +01:00
Lukas Fleischer
09d8128f99 Protect users against ZIP bombs (fixes FS#22991).
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-23 11:17:27 +01:00
Lukas Fleischer
f961ffd9c7 Add a per-user session limit (fixes FS#12898).
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-23 11:17:26 +01:00
Lukas Fleischer
c39183c3ee Add ability to search for non-out-of-date packages (fixes FS#17896).
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-22 18:33:27 +01:00
Wieland Hoffmann
743cffe7d1 Fix typo in "web/lib/pkgfuncs.inc".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-21 18:56:38 +01:00
Lukas Fleischer
52dfa9ca7c Make persistent cookie timeout configurable via "config.inc" (FS#22994).
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-21 18:17:58 +01:00
Lukas Fleischer
31b0b68b47 Automatically adopt when updating an orphan package (fixes FS#22992).
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-21 17:56:19 +01:00
Lukas Fleischer
a77420126b Release 1.8.0.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-20 18:40:48 +01:00
PyroPeter
1fdecbd5a4 pkg_search_results: rewrite of pagination
* Most of the PHP-code was moved to pkgfuncs.php to keep the template simple.

Signed-off-by: PyroPeter <abi1789@googlemail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-17 18:54:26 +01:00
Lukas Fleischer
b69f548065 Add a package name blacklist.
Can be used to blacklist package names for normal users. TUs and
developers are not affected. This is especially useful if used together
with a cron job that updates the blacklist periodically, e.g. to reject
packages which are available in the binary repos (FS#12902).

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-11 14:43:22 +01:00
Lukas Fleischer
0e0e80aeea Minor bugfix in pkg_change_category().
This cleans up some broken MySQL query introduced by commit 57a5cbfd.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-09 08:58:44 +01:00
Dan McGee
7f5af61c88 Drop PackageLocations table and references
We don't need this anymore since all packages managed here are
well...managed here. Rip out all of the places we were using this field,
many of which depended on the magic value '2' anyway.

On the display side of things, we had a column that was always showing
'unsupported' that is now gone, and you can no longer sort by this column.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-01 12:41:08 +01:00
Lukas Fleischer
da2ebb667b aurjson: Escape wildcards in "LIKE" patterns (fixes FS#18626).
Percent signs ("%") and underscores ("_") are not escaped by
mysql_real_escape_string() and are interpreted as wildcards if combined
with "LIKE", so we need to deal with them separately.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-01-28 16:54:58 +01:00
Lukas Fleischer
389d3a552e Replaced rm_rf() by rm_tree().
Implemented recursive directory deletion in PHP properly without the use
of exec(). This improves security, performance and portability and makes
the code compatible with PHP's Safe Mode as well as with PHP setups that
disable exec() using the "disable_functions" directive.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-01-25 10:45:52 +01:00
Lukas Fleischer
556de318ae Build URLs from package names (fixes FS#15308, FS#19327).
Drop the "URLPath" field from the "Packages" table, build URLs from
package names instead.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-01-24 18:08:29 +01:00
Lukas Fleischer
60edcd04e5 Make external links in comments clickable (FS#20137).
Comments are now split at link boundaries and links are converted
separately. I find this to be a much cleaner way than re-converting
comments that have already been converted using htmlspecialchars(). This
also doesn't require any callback procedure.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-01-19 21:18:45 +01:00
Jacob Bang
53ad66e0a5 Add Danish translation
Signed-off-by: Laszlo Papp <djszapi@archlinux.us>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2010-12-04 22:58:12 -05: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
eda713032c Add timestamp when a package is flagged out-of-date (FS#20848).
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
- resolve conflict and omit i18n changes.
2010-11-10 14:50:35 -05:00
Loui Chang
7933bbb53f acctfuncs: Make message translatable.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2010-10-09 08:44:26 -04:00