Commit graph

103 commits

Author SHA1 Message Date
Dan McGee
3609cf140e SQL: treat all UID/ID values as numbers, not strings
Ensure we are not quoting these values in any of our SQL queries.

Thanks-to: elij <elij.mx@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-27 14:50:27 +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
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
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
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
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
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
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
Denis Kobozev
b22f66b3ee Header and navbar consistent with Arch site redesign
-- Loui Chang
Change is_tu to check_user_privileges
Change div#archdev-navbar style

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2010-07-23 05:40:15 -04:00
Linas
7e3c624a69 aur.inc: generate_salt() now uses mt_rand()
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2010-06-16 17:11:10 -04:00
Denis
290c436046 Support for storing salted passwords
To upgrade existing databases:

ALTER TABLE Users ADD Salt CHAR(32) NOT NULL DEFAULT '';

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2010-04-17 16:50:24 -04:00
Loui Chang
c97f558898 Remove useless or redundant code for translations.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2010-01-09 18:24:53 -05:00
Athurg Gooth
8eab9ed462 Make DEFAULT_LANG mean the default language for displayed messages.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2010-01-08 17:23:09 -05:00
Evangelos Foutras
6d65997f0c Add uid_from_email(), similar to uid_from_username
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-11-13 16:49:55 -05:00
Loui Chang
ec214fdb42 Remove author information from scripts.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-04-12 23:02:08 -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
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
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
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
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
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
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
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
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
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
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
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
a49ee80aa2 Fix FS#8672
Patches can_submit_pkg(), this fixes the heaps of bugs people are having

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-06-05 12:30:48 -04:00
Loui Chang
a5a8895f49 Put login into its own function.
Utilise login form template.
Also cleaned up a couple notices.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Signed-off-by: Simo Leone <simo@archlinux.org>
2008-03-23 03:04:16 -05:00
eliott
4d9d5d3966 Fix for information leak in login logic.
Fix for information leak in login logic.
No point telling people they have a valid username when the pass is wrong, etc.
2008-02-18 17:55:28 -06: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
Callan Barrett
52a770e7e7 Fix login error and translation bug
Fixes a login error where entering nothing would result in the login message
"Incorrect password for username, ." and changes the translation "TU" to
"Trusted User" so the menu bar on the accounts page doesn't bug up (we need a
new translation system :((()

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Simo Leone <simo@archlinux.org>
2008-01-20 03:16:07 -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
dbbf50ac90 Removes need for name, overwrite and comment fields from pkgsubmit.php
This removes the name, overwrite and comment options from pkgsubmit.php
by moving when the tarball is extracted (and where) and when the pkgbuild
is parsed so pkgname is taken from the pkgbuild instead of user input

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-01-20 00:21:20 -06:00
Callan Barrett
bf5c28cf22 Fix bug with botched AURSID values
In the check_sid function in aur.inc the condition for expiring the
cookie and redirecting to hacker.php could never be met and instead
the user would be given blank login instead of being considered logged
out, now fixed. This also means we no longer need either hacker.php or
timeout.php at all.

Also, this bug seems to be present in the AUR version running on
aur.archlinux.org.

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-01-20 00:21:19 -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
Loui Chang
878d0bb39a Added header, footer, and login form templates
Implemented the first two in web/lib/aur.inc.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-01-19 23:45:07 -06:00
Simo Leone
016e8796c3 Update tur-users -> aur-general
Fix broken links after mailing list rename.

Signed-off-by: Simo Leone <simo@archlinux.org>
2007-12-02 16:10:59 -06:00
Paul Mattal
22fcea238f Tweak to version strings patch.
Rather than rely in any way on config.inc, which is expected to be edited
by the user and to persist across versions without change, the version
string definition is stored in version.inc and included from aur.inc.
2007-10-02 07:33:53 -04:00
Loui Chang
10f6a7c401 nitpick: Changed "AUR-Home" button to "AUR Home"
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2007-09-27 00:09:43 -04:00
Loui Chang
d2134f7637 Merge commit 'origin/testing'
Yeah I actually want to work from testing.
Conflicts:

	web/lib/pkgfuncs.inc

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2007-09-27 00:06:56 -04:00
Loui Chang
e8ae65abf6 I forgot to change AUR_db* usage to constants. Fixed now.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2007-09-27 00:04:47 -04:00
Loui Chang
c764f078f1 Made some things in config.inc.proto that should be constants constants
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2007-09-26 23:57:51 -04:00
eliott
ac8291a5dc Changes to bring the main arch site theme to the aur. 2007-09-22 12:09:00 -07:00
pjmattal
452d6b1245 patch from eliott to convert all <? to <?php 2007-09-20 21:46:43 +00:00
swiergot
0b92839bee - Applied a patch from Loui to fix session removal.
- Replaced all occurences of mysql_escape_string()
  with mysql_real_escape_string().
2007-09-20 15:33:04 +00:00