Commit graph

953 commits

Author SHA1 Message Date
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
canyonknight
4235d24039 Remove documentation references to database parameter
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-02-10 12:10:38 +01:00
canyonknight
8d6c872297 Remove unnecessary database connection parameter from all functions
All functions now have a database connection method that will use
the same database connection. This imitates the functionality of
passing a database connection as an argument and makes it redundant.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-02-10 12:10:38 +01:00
canyonknight
8e03e68d68 Add database wrapper class and new connection method
Uses the Singleton pattern to ensure all queries use the same
database connection that is released upon script completion.

All database connections should now be called with DB::connect() and
not db_connect().

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-02-10 12:10:37 +01:00
Lukas Fleischer
8b791dee91 Merge branch 'maint' 2013-01-30 09:25:42 +01:00
canyonknight
65e93f134f acctfuncs.inc.php: Change wording of account editing message
An error message is printed when the number of affected rows is
0 for an edited account. A count of 0 doesn't imply an error,
only that no changes were made in the database.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-01-30 09:25:30 +01:00
canyonknight
150b0f9f0a Clear a user's active sessions following account suspension
A suspended user can stay in active sessions. Introduce new function
delete_user_sessions to remove all open sessions for a specific user.
Allows suspensions to take effect immediately.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-01-30 09:25:30 +01:00
canyonknight
1fd620cc2f acctfuncs.inc.php: Change return type of valid_username function
The function is only determining whether a username is valid,
so it makes more sense to simply return a boolean value.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-01-30 09:25:29 +01:00
canyonknight
a61d73d804 aur.inc.php: Fix PHP undefined index notice for AURSID
Occurs in the rare situation where a logged out user tries to POST
a CSRF token.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-01-30 09:25:29 +01:00
Lukas Fleischer
49e6184508 Merge branch 'maint' 2013-01-19 12:21:26 +01:00
canyonknight
07edcdab17 stats.inc.php: Remove unnecessary account type lookup
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-01-19 12:21:16 +01:00
Marcel Korpel
fcb30db59f Remove double htmlspecialchars
This is already done in header.php; doing this double will result
in &amp; in title element

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-01-19 12:21:04 +01:00
Marcel Korpel
8e1051932e Add description meta-element to package pages
Implements FS#33294

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-01-19 12:18:13 +01:00
Marcel Korpel
b004333ead Implemented typeahead suggest
Use Twitter Bootstrap JavaScript framework for typeahead support.

Add a new "suggest" JSON method, which returns the first 20
packages that match the beginning characters of a query.

canyonknight: Link format change, commit message
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-01-19 12:17:55 +01:00
Lukas Fleischer
b8f07c4c45 Merge branch 'maint' 2012-12-22 17:03:43 +01:00
Marcel Korpel
987faad145 Changed 'Dutch' to 'Nederlands'
Supported languages are listed in their native language. Only Dutch is
in English. Translate reference into Dutch.

canyonknight: Commit message clarity

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-12-22 17:01:54 +01:00
Lukas Fleischer
fce4f36e4f Merge branch 'maint' 2012-12-07 23:24:22 +01:00
canyonknight@gmail.com
20407bb8c6 Split package flagging and unflagging into separate functions
Currently, package flagging and unflagging takes place within the
pkg_flag() function. A bool is set to true or false depending on the
action.

Create new pkg_unflag() function with sole purpose of unflagging
and keep pkg_flag() in place. This split will be useful in the
overhaul of the notification system.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-12-07 23:24:11 +01:00
canyonknight
ec332bb7e6 Fix account privilege escalation vulnerability
A check is only done to verify a Trusted User isn't promoting their
account. An attacker can send tampered account type POST data to
change their "User" level account to a "Developer" account.

Add check so that all users cannot increase their own account
permissions.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-11-29 23:23:12 +01:00
canyonknight
87fe4701cd Fix account editing and hijacking vulnerability
Checks are in place to avoid users getting account editing forms
they shouldn't have access to. The appropriate checks before
editing the account in the backend are not in place.

This vulnerability allows a user to craft malicious POST data to
edit other user accounts, thereby allowing account hijacking.

Add a new flexible function can_edit_account() to determine if
a user has appropriate permissions. Run the permission check before
processing any account information in the backend.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-11-29 23:23:10 +01:00
canyonknight
16a20693be pkgfuncs.inc.php: Rework query to avoid "Required by" duplicates
Packages with multiple DepConditions are returned multiple
times in the "Required by" column.

Limit SQL results to distinct packages.

Fixes FS#32478

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-11-15 20:03:33 +01:00
Lukas Fleischer
dd61e561a0 Release 2.0.1
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-11-07 01:00:43 +01:00