Commit graph

258 commits

Author SHA1 Message Date
Loui Chang
2da9b55d9f Fix stats functionality when APC is unavailable.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-01-08 13:08:58 -05:00
Dan McGee
5d6f465170 Cache all front page stats in APC if available
Use the APC cache to store all of the counts and the recently updated
package list in a cache, which cuts down on the number of database queries
needed. If the data isn't perfectly up to date we will survive.

This version of the patch will also cache the relevant counts for individual
logged-in users and is more careful about checking whether the value
actually exists in the cache by using the status reference to apc_fetch().

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-01-08 11:48:58 -05:00
Loui Chang
36b44f371b Move package comments to a template.
Change layout in the process.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-01-05 15:59:59 -05:00
Dan McGee
207b565f1c Minimize calls to uid_from_sid()
Just like the previous patch for account_from_sid() over-usage.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-01-04 14:28:24 -05:00
Dan McGee
8f97330100 Store account type in local var when possible
No need to call this function way too often, especially when on the package
list page where it could be called up to once per row.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-01-04 14:09:53 -05:00
Dan McGee
bf4fe7f47c aur.inc: remove unused code
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-31 10:14:12 -05:00
Loui Chang
1529020e79 Get db connection for accounts search results.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-31 10:09:04 -05:00
Dan McGee
3b4662a58e Use non-persistant connections
There is really no need to use persistent connections to the database in
this day and age. Most PHP development guides recommend against it, and the
new mysqli interface doesn't even include the functionality.

Add a matching but currently unused db_disconnect() function while we are at
it. Reference counting will cover us for the most part, however.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-30 13:00:53 -05:00
Callan Barrett
a16f4c77b3 Make search page use mkurl function, change variables around
Changed all the normal variables to their $_GET counterparts so everything is destructively changing the original variables, there should be no issue with this. If there I guess we need to consider making mkurl use a custom array of variables rather than $_GET

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-29 17:33:19 -05:00
Callan Barrett
520d1e2a35 Add function to generate clean urls
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-29 17:29:53 -05:00
Callan Barrett
d4b80de492 Bump to version 1.5.4
Quick release to fix the chmod issue. GO TEAM!!

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-12-25 01:17:14 +09:00
Loui Chang
ae1c424c95 Really make all web paths relative.
I forgot about the forms.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-12-22 13:19:56 +09:00
Callan Barrett
b4a62c4915 Move package search results to a template
Logic is separated from html as much as possible, all html in a template

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-21 12:44:31 -05:00
Callan Barrett
6415b65ac9 Fix up valid email function, FS#12269
All we're looking for now is an @ in any email address to fix problem with not being able to have + in addresses and just because I see no advantage to having any sort of stringent validation

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-21 12:42:26 -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
cfeb080dcd Make all web paths relative.
The site no longer needs to be hosted from the
root of a domain, or virtual host.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-12-21 15:24:57 +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
a386ab5835 Revert "Move call to try_login to login_form."
This reverts commit 77d93c4946.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-20 12:49:28 -05:00
Nathan Jones
3de0a2ade3 Rename 'Un-Vote' and 'Unflag' buttons.
This is to be consistent with 'UnNotify'.

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-19 22:18:09 -05:00
Loui Chang
361609a034 Stop printing underscores around untranslated strings.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-17 14:38:18 -05:00
Loui Chang
77d93c4946 Move call to try_login to login_form.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-17 12:58:17 -05:00
Loui Chang
193a5c66cb Bump version to 1.5.3
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-17 09:27:37 -05:00
Loui Chang
2188d2a4f2 Quell missing argument warning in clear_expired_sessions().
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-12 12:08:42 -05:00
Loui Chang
3ec9ecc84e Remove remaining instances of do_Details
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-11-26 01:36:34 -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
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
f12b11abc7 Give group writable permissions to uploaded files.
Add a new function chown_group to recursively change permissions.
Tweak some of the coding style.
Replace some of the redundant string concatenation with a variable.

Thanks to Dan McGee for chmod_group.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-11-13 15:19:26 -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
Loui Chang
cf2a82fe85 Clear out old expired sessions on log out.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-11-13 15:18:48 -05:00
Loui Chang
a6147ab5ab Merge branch 'testing'
Conflicts:
	web/html/pkgsubmit.php

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-11-03 21:52:07 -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
78ace0914e Show developer-TUs their total community packages.
This closes:
FS#11561 - Devs in AUR can't see their packages in Community

Thanks to Hugo Doria for the original patch.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-10-06 19:38:10 +08:00
Loui Chang
c7bfd95284 Take formatting out of version number in web/lib/version.inc
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-09-29 15:20:35 +08:00
Callan Barrett
df39cded09 Sort required by list in package details page.
This closes FS#11420.

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-09-28 13:17:09 -04:00
Loui Chang
5c3f019093 Use system rm in rm_rf function.
PHP can't properly handle symlinks which causes problems when
self-referencing symlinks appear.

This closes FS#11187.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-09-21 20:10:50 -04:00
Andrea Scarpino
52fb8550a2 doesn't show disown package when already disowned
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-08-27 21:34:24 +08:00
Loui Chang
1d416d6891 Add Turkish to SUPPORTED_LANGS in config.inc.proto.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-08-19 15:35:58 -04:00
Simo Leone
c85dfacc74 Include File/Find.php PEAR module
Since this module requires root to install
system-wide, and is somewhat rare, it's better
to just include it in the AUR code itself.

Signed-off-by: Simo Leone <simo@archlinux.org>
2008-07-28 10:27:38 -05:00
Loui Chang
2c6bae2e63 Convert special chars in translations to html entities.
This closes
FS#10809 - bug in french translation of AUR web interface

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-07-28 16:58:58 +08:00
Loui Chang
1a1a6eb36e Add a new DEFAULT_LANG constant.
DEFAULT_LANG will essentially be used to specify what language
strings are initially written in.

This will eliminate the need for English translation arrays in
AUR and make adding or changing the English strings a lot easier.

DEFAULT_LANG may be required for strings to display properly.

Also change the output when a translation isn't found.
Eliminate the <b> which can cause validation errors depending
on where the string is placed.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-07-22 13:47:17 -04:00
Loui Chang
1deb924674 Make JSON search return more information.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-07-16 18:16:04 -04:00
Andrea Scarpino
2feee92a75 Remember user between sessions.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-07-08 14:06:16 -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
4372ddb914 Bump version to 1.5.2
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-07-07 10:52:46 -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
bf5029ad8a Don't show None on pacckage info page
Just cuts out the table of deps/sources if none exist instead of
displaying "None"

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-06-07 18:20:00 +08:00