Commit graph

774 commits

Author SHA1 Message Date
Lukas Fleischer
f461344211 Move package actions to package bases
Package actions now operate on package bases instead of packages. Move
all actions to the correct locations.

This also fixes some issues with comment notifications.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 13:54:06 +02:00
Lukas Fleischer
c1c77836a8 Allow for searching by package base name
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 13:51:28 +02:00
Lukas Fleischer
d7044eb1ec Factor out PKGBUILD parsing
This is legacy code. Move it to a separate source file in order to clean
up the submission code. The code will be removed altogether in an
upcoming release.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:36 +02:00
Lukas Fleischer
8921e4deb9 Do not allow for overwriting arbitrary packages
A package should only be overwritten if it already belongs to the
package base that is trying to overwrite it.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:36 +02:00
Lukas Fleischer
f7d13b5b36 Add package base detail pages
This adds package base details pages, similar to the package details
pages. Each package base details page contains general information
(package base name, category, submitter, maintainer, ...) and links to
all the corresponding packages. As on the package details pages,
comments and links to several package actions are also provided.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:36 +02:00
Lukas Fleischer
fb81bfd8df Add full support for the new .AURINFO format
This adds full support for the new .AURINFO format used by mkaurball,
including support for split packages.

The old PKGBUILD parser is still available for compatibility reasons.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:36 +02:00
Lukas Fleischer
b558572a2e Make the delete function remove package bases
Deleting a single package without deleting the whole package base makes
no sense. Comments and votes are already stored on a per-package basis,
making this a straightforward extension.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:36 +02:00
Lukas Fleischer
45bd1b34f1 routing.inc.php: Add get_pkgbase_uri()
This will be used to create links to package base pages later. For now,
this just returns a link to the corresponding package page since a
package base currently only consists of a single package having the same
name as the base itself.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:36 +02:00
Lukas Fleischer
d35cf67f7b Store comments on a per-package base basis
Move comments from the Packages table to PackageBases. Sharing comments
makes sense since they almost always refer to a source package.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:35 +02:00
Lukas Fleischer
b7941073ac Add provisional support for package bases
This adds a PackageBases table to the database schema and moves the
following fields from the Packages table to PackageBases:

* CategoryID
* NumVotes
* OutOfDateTS
* SubmittedTS
* ModifiedTS
* SubmitterUID
* MaintainerUID

It also fixes all database accesses to comply with the new layout.

Having a separate PackageBases table is the first step to split package
support. By now, we create one PackageBases entry per package (where the
package base has the same name as the corresponding package). When
adding full support for split packages later, the package base name will
be derived from the pkgbase variable and a single package base will be
shared amongst all packages built from one source package.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:35 +02:00
Lukas Fleischer
94a4f597ff Set Content-type header when sending UTF-8 mails
Fixes FS#38568.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-10 21:00:36 +01:00
Lukas Fleischer
16c3a86193 Use CRLF to separate headers in mail()
This is the correct delimiter for mail headers according to the PHP
documentation and RFC 2822.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-10 20:48:34 +01:00
Lukas Fleischer
8c07c091e8 Remove LastVoted column
This has been introduced by commit aae43d9 (started working on package
comments, 2005-03-05) but it seems to be of no practical use. Remove the
field to save some space.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-09 01:43:37 +01:00
Lukas Fleischer
c09dcc4e98 Simplify canDeleteComment()
Use COUNT(*) instead of COUNT(ID) and PDO::FETCH_NUM instead of
PDO::FETCH_ASSOC. This also includes some minor formatting fixes.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-06 18:59:40 +01:00
Lukas Fleischer
0722f46c6e Simplify valid_user() and valid_username()
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-06 18:59:40 +01:00
Lukas Fleischer
3f0a1a827a pkgfuncs.inc.php: Fix comment style
* Use C-style comments (/* */) instead of # or //.
* Remove some superfluous comments and slightly reword others.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-06 18:59:40 +01:00
Lukas Fleischer
34447e7233 acctfuncs.inc.php: Fix comment style
* Use C-style comments (/* */) instead of #.
* Remove some superfluous comments and slightly reword others.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-06 16:32:31 +01:00
Lukas Fleischer
165bcba54e Style fixes: Capitalization of "true" and "false"
Use "true" instead of "TRUE" and "false" instead of "FALSE" or "False".

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-06 16:32:31 +01:00
Lukas Fleischer
b8a31dcc72 Do not allow unauthenticated users to delete comments
Since commit fb7bde3 (Add support for anonymous comments, 2014-02-04),
we support comments with no specific author. Add a check to
canDeleteComment() and canDeleteCommentArray() to ensure an
unauthenticated user cannot delete such comments.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-06 16:28:33 +01:00
Lukas Fleischer
fb7bde3a6c Add support for anonymous comments
This allows for removing users without also removing the corresponding
comments. Instead, all comments from deleted users will be displayed as
"Anonymous comment".

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-04 18:48:23 +01:00
Lukas Fleischer
333ce08027 Sort last TU votes by vote and by user name
Instead of using a random secondary order, sort by the ID of the last
vote first, then by user name.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-01 17:38:58 +01:00
canyonknight
1e9d539acf Further optimize voters.php to only need the package name
* Extends changes in 81d4cc13dc
* Modify getvotes() to use the package name rather than package ID
* Rename getvotes() to votes_for_pkgname() for clarity with new changes
* Modify routing framework and links to now use package names for voters.php

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-01-22 18:27:42 +01:00
canyonknight
1bc78b9dff acctfuncs.inc.php: Allow translation of missing strings
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-01-20 15:41:17 +01:00
Lukas Fleischer
7fa50acc72 Release 2.3.1
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-01-13 19:55:53 +01:00
Lukas Fleischer
40fd73b668 Release 2.3.0
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-09-02 13:26:33 +02:00
Chris Down
35c5a5a3a9 Specify charset in Content-Type header when returning JSON data from API.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-09-02 00:29:58 +02:00
Lukas Fleischer
2276171b29 Only include current TUs in the last votes list
Do not show users that took part in past TU votes but no longer have TU
powers. Also, fix the sorting column while we're touching these lines.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-28 01:52:40 +02:00
Lukas Fleischer
c1c7f9b350 Move package comment check to packages.php
Checking whether to add a comment is something that really does not
belong to a function named display_package_details().

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-27 11:35:26 +02:00
Lukas Fleischer
23867a211c Add boolean return values to several pkg_*() functions
Change the return values of following functions to return both
error/success and an error/success message:

* pkg_flag()
* pkg_unflag()
* pkg_adopt()
* pkg_vote()
* pkg_delete()
* pkg_notify()
* pkg_delete_comment()
* pkg_change_category()

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-27 11:19:45 +02:00
Lukas Fleischer
86d2efaaa0 Exclude running votes from "Last Votes by TU"
Showing running votes potentially allows for tracking votes and
associating yes/no/abstain votes with specific TUs.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-27 10:52:38 +02:00
Lukas Fleischer
be80aa0f01 Add Japanese and Slovak languages
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-26 18:45:10 +02:00
Lukas Fleischer
2dd3d04f45 Add "Last Votes by TU" list
This shows a list of all Trusted Users and the vote ID of the last
proposal each of the TUs voted on. This list is sorted by vote ID.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-26 17:34:31 +02:00
Lukas Fleischer
d41e40d9d6 Add a vote type to the TU proposal form
There are only four valid reasons for starting a TU vote, so instead of
letting the user choose a vote length, let her pick a reason and set
vote length and quorum based on that selection.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-22 17:48:18 +02:00
Lukas Fleischer
9ff082be25 Store the number of TUs when starting a vote
This will be used for automated calculation of vote participation later.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-22 17:47:51 +02:00
Lukas Fleischer
6844f6c1d2 Allow for setting an account's inactivity status
This adds a field to the users table and corresponding fields to the
account edit and display forms that allow for setting an (in-)activity
status.

This might turn out to be useful if a user is on vacation and can not
respond to update/orphan/deletion requests.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-22 17:43:13 +02:00
Lukas Fleischer
6ecfe12ce2 Merge branch 'maint' 2013-08-17 21:36:39 +02:00
Lukas Fleischer
95df5e4503 Release 2.2.1
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-17 21:35:56 +02:00
Lukas Fleischer
4bba2672cf Merge branch 'maint' 2013-08-17 19:54:34 +02:00
Dave Reisner
5abd366547 Upgrade Archive/Tar from PEAR to work with php 5.5
This resolves issues with backwards incompatible changes to
pack/unpack in php 5.5:

http://www.php.net/manual/de/migration55.incompatible.php

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-17 19:51:51 +02:00
canyonknight
cf083cf9ba Remove superfluous search wrapper function
The search_accounts_form() wrapper function doesn't have any
arguments and only makes it unclear what is happening within
account.php

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-04-24 11:05:51 +02:00
Lukas Fleischer
f542383bc5 Release 2.2.0
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-03-26 07:28:23 +01:00
Lukas Fleischer
cd59a313b4 Show hint if password is empty during login
A user might have an empty password due to two reasons:

* The user just created an account and needs to set an initial password.
* The password has been reset by the administrator.

In both cases, the user might be confused as to why the login does not
work. Add a message that helps users debug the issue in both cases.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-03-25 02:15:12 +01:00
canyonknight
cb91942595 Implement IP banning for user registration and user login
Adds a new is_ipbanned() function to determine whether the user
attempting to login or register for an account has their IP
address listed in the "Bans" table.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-03-24 22:12:17 +01:00
Lukas Fleischer
5660816ea0 Save last login IP address
Save the IP address used for the last login in the "Users" table. This
makes it a bit easier to create IP ban lists for spammers without
looking at web server logs.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-03-21 22:26:46 +01:00
Lukas Fleischer
de39a712b0 process_account_form(): Highlight errors
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-03-21 22:26:45 +01:00
Lukas Fleischer
97dd4b0f4d process_account_form(): Allow using empty passwords
If an empty password is passed during account registration, login for
the new user is disabled and a reset key is sent to the new user's
e-mail address so that they can set an initial password manually.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-03-19 14:03:34 +01:00
Lukas Fleischer
5d31bb2450 Move reset key submission to a separate function
This allows for reusing reset key submission for other things, such as
sending an initial password reset code during account registration.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-03-19 14:03:33 +01:00
Connor Behan
a386bbd35d Fix typo in delete permission warning
Signed-off-by: Connor Behan <connor.behan@gmail.com>
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-03-19 13:50:45 +01:00
Lukas Fleischer
fe096e31cf Release 2.1.0
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-03-18 19:55:58 +01:00
canyonknight
cf2ab50b82 Remove checks before calling connection method
Large amount of boilerplate code that checks if a database
connection exists is useless now that the new connection method
automatically does the same check.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-02-10 12:10:38 +01:00