Commit graph

750 commits

Author SHA1 Message Date
Kristian Klausen
bab74dd307
Update wiki links to the new short URL
Done with: find -type f -exec sed -Ee ':wiki.archlinux.org: s:(wiki.archlinux.org)/index.php/:\1/title/:g' -i {} \;

Fixes #16

[1] https://gitlab.archlinux.org/archlinux/infrastructure/-/merge_requests/335

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
2021-05-09 18:06:32 -04:00
Felix Yan
21c457817f Use jsDelivr instead of Google CDN for jquery
jsdelivr is another free CDN service for open source projects.

The main motivation for this change is that it is the only one that works fairly
well across the globe. The Google CDN service is known to be hardly
accessible in mainland China, unfortunately.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2021-02-20 11:26:32 -05:00
Justin Kromlinger
d5d333005e RSS: Decrease cache time and increase item count
I think after 10-15 years we might want to adjust those values. With a
30min cache and 20 items per creation I would bet some new AUR packages
might be swept under the carpet.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2021-02-20 11:25:21 -05:00
Justin Kromlinger
eb11943fed RSS: Always provide a GUID
https://validator.w3.org/feed/docs/warning/MissingGuid.html
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2021-02-20 11:25:21 -05:00
Justin Kromlinger
1d0c6ffe24 RSS: Make sure image title matches channel title
https://validator.w3.org/feed/docs/warning/ImageTitleDoesntMatch.html
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2021-02-20 11:25:21 -05:00
Justin Kromlinger
78dbbd3dfa RSS: Set proper content type header
https://validator.w3.org/feed/docs/warning/UnexpectedContentType.html
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2021-02-20 11:25:21 -05:00
Frédéric Mangano-Tarumi
8c28ba6e7f Redirect to referer after SSO login
Introduce a `redirect` query argument to SSO login endpoints so that
users are redirected to the page they were originally on when they
clicked the Login link.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2021-02-20 11:25:21 -05:00
Frédéric Mangano-Tarumi
4d0f2d2279 Implement SSO logout
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2021-02-20 11:24:30 -05:00
Frédéric Mangano-Tarumi
d12ea08fca SSO: Add an SSO option in the login page
We’ll probably change the whole login page in the future, but this makes
development easier.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2021-02-20 11:24:30 -05:00
Lukas Fleischer
169607f153 Fix PHP notices in the account form
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2020-04-05 15:59:56 -04:00
Lukas Fleischer
ee2aa9755f Add support for backup email addresses
Support secondary email addresses that can be used to recover an account
in case access to the primary email address is lost. Reset keys for an
account are always sent to both the primary and the backup email
address.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2020-02-02 12:12:42 +01:00
Lukas Fleischer
e5a839bf0b Add option to send reset key for a given user name
In addition to supporting email addresses in the reset key form, also
support user names. The reset key is then sent to the email address in
the user's profile.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2020-02-02 12:12:42 +01:00
Lukas Fleischer
def2787b45 Require password when changing account information
Since commits daee20c (Require current password when setting a new one,
2020-01-30) and 8fc8898 (Require password when deleting an account,
2020-01-30), changing a password and deleting an account require the
current password. Extend this to all other profile changes.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2020-01-30 14:05:24 +01:00
Lukas Fleischer
8fc8898fef Require password when deleting an account
Further reduce the attack surface in case of a stolen session ID.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2020-01-30 13:25:15 +01:00
Lukas Fleischer
daee20c694 Require current password when setting a new one
Prevent from easily taking over an account by changing the password with
a stolen session ID.

Fixes FS#65325.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2020-01-30 10:31:26 +01:00
Lukas Fleischer
dd0e090301 Sync CSS with archweb
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2019-10-19 00:19:16 -04:00
Lukas Fleischer
d6ae970785 Add a simple CAPTCHA to the sign up form
Add a CAPTCHA to protect against automated account creation. The CAPTCHA
changes whenever three new accounts are registered.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2019-10-05 13:44:00 -04:00
Eli Schwartz
3ac958ac01
Move permission for LIST_COMMENTS to dev/tu block
In commit 3578e77ad4 we implemented
listing of comments from the account details page , but this was
intended to only be available to TUs and Devs. As the comment says:
"display the comment list if they're a TU/dev"

The credential checking code, however, set this credential for all
users, contrary to the intention of the commit.

In order to preserve the ability to list a person's own comments, also
declare the allowed uids based on the profile being viewed.
2019-08-18 13:01:37 -04:00
Lukas Fleischer
fc9c519852 Display warning when flagging VCS packages
VCS packages should not be flagged out-of-date when the package version
does not match the most recent commit.

Implements FS#62733.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2019-05-25 19:01:33 -04:00
Lukas Fleischer
5a66a381fb Sync CSS with archweb
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2019-05-25 12:40:18 -04:00
Vladimir Panteleev
e3ca3c96e5 Add "Enable notifications" checkbox in "Add Comment" form
Currently, it is a little to easy to forget to enable notifications
for a package after leaving a comment, thus never being notified of a
reply. Even though the "Enable notifications" link is on the same
page, it is not part of the flow for posting a new comment, and so,
easy to miss.

Most web forums and comment systems include a checkbox to enable
notifications when posting for the first time in a thread. This patch
implements this in aurweb, as well.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
2019-04-28 08:58:29 -04:00
Johannes Löthberg
3578e77ad4 Allow listing all comments from a user
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2018-08-06 06:03:58 +02:00
Lukas Fleischer
41a4189d20 Sync CSS with archweb
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2018-07-07 15:57:47 +02:00
Lukas Fleischer
4b8b2e3eb1 Stop using each()
The each() function has been deprecated as of PHP 7.2.0. Use foreach
loops instead.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2018-05-12 13:35:11 +02:00
Mark Weiman
f15c700ad2 Add capability for co-maintainers to disown packages
Implements FS#53832.

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2018-02-24 14:57:31 +01:00
Lukas Fleischer
a04fe6a13e Add route for /users.gz
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-12-03 13:59:54 +01:00
Lukas Fleischer
3be28d016f Sync CSS with archweb
This partially fixes FS#56472.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-11-28 08:52:12 +01:00
Lukas Fleischer
e2fa5ea6fa login.php: Escape quotes in the referer field
Replace special characters in the referer GET parameter using
htmlspecialchars() before inserting it into the login form fields to
prevent from XSS attacks.

Fixes FS#55286.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-11-05 11:28:11 +01:00
Lukas Fleischer
a8ac2004d3 Add support for Terms of Service documents
This allows for adding Terms of Service documents to the database that
registered users need to accept before using the AUR. A revision field
can be used to indicate whether a document was updated. If it is
increased, all users are again asked to accept the new terms.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-04-30 16:47:13 +02:00
Lukas Fleischer
6892ec7791 Call check_sid() from a central location
Instead of calling check_sid() from every single PHP script representing
a web page, add the call to aur.inc.php which is sourced by all of them.

Also, remove set_lang() calls from the scripts since these are also
already included in aur.inc.php.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-04-27 09:22:53 +02:00
Lukas Fleischer
4be9aa6350 Fix the comment collapse feature
In commit 4abde89 (Use JavaScript to collapse long comments,
2017-04-19), support for collapsing/expanding long comments was added.
This was broken by the recent Markdown support since comments no longer
live inside a single HTML paragraph. Fix this by wrapping each comment
in another div container.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-04-24 21:10:02 +02:00
Lukas Fleischer
4abde895a5 Use JavaScript to collapse long comments
Instead of using CSS to limit the height of package comments as
implemented in 7b13203 (Limit comment height to 15 lines, 2016-03-12),
use JavaScript to collapse long comments and add a link to expand them.
Clicking the same link twice results in the corresponding comment being
collapsed again.

If JavaScript is disabled, the full comments are shown (without any
possibility to collapse or expand).

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-04-20 07:03:54 +02:00
Lukas Fleischer
682de0ead7 index.php: Remove routes for dropped images
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-03-04 13:20:37 +01:00
Lukas Fleischer
1af5ba64e7 pkgbase.php: Fix PHP notice
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-28 19:29:36 +01:00
Lukas Fleischer
cc84e0b7fd pkgbase.php: Squelch PHP warning
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-28 07:14:21 +01:00
Lukas Fleischer
eb6ae0c685 account.php: Always initialize $success
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-28 07:09:51 +01:00
Lukas Fleischer
f1d95c09a8 pkgflag.php: Remove stray variable
Drop the fragment part of the redirection code which is an artifact of
the original code copy-pasted in commit ca954fe (Do not redirect when
showing errors during flagging, 2015-10-21).

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-27 18:20:00 +01:00
Lukas Fleischer
9ec1cfa192 404.php: Squelch warning on empty PATH_INFO
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-27 18:20:00 +01:00
Lukas Fleischer
29a48708bb Use bcrypt to hash passwords
Replace the default hash function used for storing passwords by
password_hash() which internally uses bcrypt. Legacy MD5 hashes are
still supported and are immediately converted to the new format when a
user logs in.

Since big parts of the authentication system needed to be rewritten in
this context, this patch also includes some simplification and
refactoring of all code related to password checking and resetting.

Fixes FS#52297.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-24 22:04:49 +01:00
Lukas Fleischer
5059056567 Fix several PHP short open tags
Use "<?=" instead of "<?" for printing.

Fixes a regression introduced in a9048bb (Dedupe translatable strings,
2015-11-25).

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-15 22:05:03 +01:00
Lukas Fleischer
e724b123ec pkgbase.php: Add default title
Instead of triggering a PHP warning and using an empty title if no
package base is specified, use a default title.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-15 22:01:34 +01:00
Lukas Fleischer
92049e8061 Hide old requests from the dashboard
Only show package requests created less than 6 months ago on the
dashboard.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-15 07:23:06 +01:00
Lukas Fleischer
3a167a109b Move package search links on the dashboard
Move the package search links below the section headings.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-12 12:42:47 +01:00
Lukas Fleischer
3ac5108db3 Move my packages to separate dashboard sections
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-08 19:18:27 +01:00
Lukas Fleischer
2bc208c13e Add requests to dashboard
Add a new table which shows all package requests affecting the currently
logged in user.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-08 19:18:27 +01:00
Lukas Fleischer
403241baa3 pkgreq_results.php: Add a flag to hide headers
Introduce a new boolean flag that can be used to disable extended
headers, pagination and forms.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-08 19:18:27 +01:00
Lukas Fleischer
05007d8b1a pkgreq_results.php: Split out package results box
Do not include the wrapper div container in the template.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-08 19:18:27 +01:00
Lukas Fleischer
d45585e36d Add flagged packages to the dashboard
Implement a table that shows all packages which are flagged out-of-date
and either maintained or co-maintained by the currently logged in user.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-08 19:18:27 +01:00
Lukas Fleischer
a1890d400b Add links to all owned packages to the dashboard
In addition to showing the 50 most recent maintained and co-maintained
packages, add links to all packages one owns or co-maintains.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-08 19:18:26 +01:00
Lukas Fleischer
1049f93191 Add dashboard
For logged in users, the home page is replaced with an overview of the
packages the user maintains or co-maintains.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-04 11:20:59 +01:00