Commit graph

43 commits

Author SHA1 Message Date
Tom Hughes
c9fa49c994 Update to rails 3 2011-11-14 09:42:40 +00:00
Tom Hughes
59a49a6ef5 Fix problems with database offline mode 2011-06-23 08:30:44 +01:00
Tom Hughes
540e56a9cc Add an option to require the CTs to be agreed to edit 2011-06-14 22:57:05 +01:00
Tom Hughes
c4f7a8346a Use session.delete to remove entries instead of assigning nil 2011-06-01 10:17:54 +01:00
Tom Hughes
d681d7e07f Force a session to be created when doing a cookie test 2011-06-01 10:16:11 +01:00
Tom Hughes
02e186ee5b Allow user details to be fetched without agreeing terms 2011-04-20 21:17:59 +01:00
Matt Amos
c21aa5933a Added flash notice for CTs decline
Also ensured that CTs are either accepted or declined and cannot
be inadvertently bypassed.
2011-04-18 00:29:15 +01:00
Tom Hughes
2ba5067fcf Use report_error so Potlatch can see the errors 2011-04-17 21:45:04 +01:00
Tom Hughes
8024a38be4 Make sure "please read the terms" error is issued in the right language 2011-04-17 20:33:49 +01:00
Tom Hughes
685a35524a Try and patch up poor browser language selections
The HTTP RFC says that a language range specified by a browser only
matches a resource whose language tag is the same, or longer. This
means that a browser language range of de-DE will not match a resource
with a language tag of de.

Because of this browsers should always send the generic range, such
as de, as a secondary choice after a more specific range like de-DE.

Some browers don't this however, so if we don't get a language match
we try and patch up the list of language ranges by inserting the
more generic ranges.
2011-04-04 22:44:43 +01:00
Tom Hughes
392aa71015 Tidy up a few things 2011-04-03 13:46:16 +01:00
Matt Amos
8b12abd5bb Phase 2 CTs implementation and tests, with config parameter 2011-04-03 13:46:16 +01:00
Tom Hughes
f20a85a5c5 Allow the client to request errors as an XML document 2010-12-15 23:58:59 +00:00
Tom Hughes
3472c1d429 Channel all error reporting through report_error 2010-12-12 16:25:01 +00:00
Tom Hughes
f07819d81a Rework application configuration
Use a preinitializer to load the settings from application.yml so
that they are available as early as possible. All settings can also
be overridden using environment variables.

The ad-hoc settins in environment.rb are then moved to this new
system so we have one consistent location for settings.
2010-08-04 22:06:05 +01:00
Tom Hughes
af70363d02 Don't cache actions with a page number 2010-07-22 20:47:35 +01:00
Tom Hughes
0e19a9290d Remove use of wildcard cache expiry
Instead of doing wildcard cache expiry, just iterate over the
available locales, expiring the requested entry in each locale.
2010-07-22 20:47:34 +01:00
Tom Hughes
cd3fc33171 Remove the user type from cache keys 2010-07-22 20:47:34 +01:00
Tom Hughes
cf682f49b3 Add a timeout to the change list pages 2010-05-21 20:21:41 +01:00
Tom Hughes
9230721a1f Redirect suspended users to an information page
If the current session is for a logged in user and that user has
been suspended then log them out and redirect them to a page
explaining that their account has been suspended.
2010-05-07 10:00:24 +01:00
Tom Hughes
5a54630b57 Add support for suspended and confirmed users
Replace the existing "active" and "visible" with an enumerated status
that allows for extra cases. Currently we have "suspended" for users
who hve triggered the spam detector and "confirmed" for users that have
triggered the detector but have been confirmed as vald by an admin.
2010-05-06 17:18:34 +01:00
Tom Hughes
2df3a8d2e2 Rethrow ActionController::UnknownAction exceptions encountered by
the API so that rails handles them in the normal way and shows
the 404 page to the user. Closes #1989.
2010-02-26 15:27:52 +00:00
Tom Hughes
fa554045e5 Make cache distinguish pages views by admins or moderators from those
viewed by normal users.
2010-01-13 21:30:09 +00:00
Tom Hughes
7381dad23b Generate cache paths in the same way as the normal expire_action routine
so that the escaping matches correctly.
2010-01-11 18:24:55 +00:00
Tom Hughes
841ebe80d7 Use system_timer for timeouts to make them more reliable. 2010-01-11 09:28:31 +00:00
Tom Hughes
f5777a881f Don't cache the trace list for logged in users. 2010-01-11 00:16:21 +00:00
Tom Hughes
314b734aa5 Introduce some caching for diary views. 2010-01-09 16:43:38 +00:00
Tom Hughes
e23744bd8d Add :warning and :error flash messages which can be styled separately to
the existing :notice messages.

Also reviewd all existing flash messages and changed them to be errors or
warnings when appropriate and checked that those which are not followed by
a redirect are done as flash.now[] instead of flash[].
2009-11-01 13:07:46 +00:00
Tom Hughes
2541ad0f09 We don't need the @notice hack - we can use flash.now to achieve the same thing. 2009-11-01 12:32:31 +00:00
Tom Hughes
0189bce496 Test that the user has cookies enabled at critical points where we
are about to require them and warn the user if they are not enabled.
2009-10-09 08:47:47 +00:00
Matt Amos
77851bac7b Added better messages and error handling in a couple of places. Added integration checks to ensure that the blocking is actually working. Tests FTW. 2009-09-30 17:39:42 +00:00
Matt Amos
daa2496024 First version of blocking feature. Allows both time-based (for map protection) and notice-based (for education) blocks on users. Also introduces user roles and a simple UI for displaying and administering these. 2009-09-28 16:01:00 +00:00
Tom Hughes
d227589a63 Merge oauth branch at r17138 to trunk. 2009-08-18 20:01:56 +00:00
Tom Hughes
cd8bb0dc57 Log unexpected exceptions raised by API calls. 2009-08-15 11:35:43 +00:00
Matt Amos
0d5be22cb5 Merging 16820:16891 from trunk. 2009-08-06 16:24:39 +00:00
Tom Hughes
e48e4ccbd3 Send an appropriate Vary header when we negotiate the language to stop
caches doing the wrong thing. Closes #1995.
2009-08-05 20:35:28 +00:00
Matt Amos
d75bc6ef69 Use method rather than direct access to member for the current token. 2009-08-04 12:59:02 +00:00
Tom Hughes
25d0017b18 Fix compatible_language_from in the http_accept_language plugin to
correctly follow the RFC 2616 language selection algorithm and then
revert to the previous way of selecting languages.
2009-07-15 23:42:56 +00:00
Tom Hughes
1368f194da Try preferred_language_from as it looks for an exact match - only if that
fails do we fall back to compatible_language_from which will take any
language where the first token matches. Fixes #2069.
2009-07-15 23:29:07 +00:00
Tom Hughes
f4571eeb7c Revert r16046.
DO NOT COMMIT MAJOR ENHANCEMENTS TO TRUNK WITHOUT TALKING TO ME FIRST.
2009-06-23 02:48:38 +00:00
Matt Amos
b8f6dbd403 Adding initial version of the OAuth token authentication method. This adds basic OAuth support for registering apps, getting and revoking keys, etc... The tokens come with 6 separate permissions bits; read/write user preferences, write diaries, write API and read/write GPS traces. Needs more tests. 2009-06-22 16:54:37 +00:00
Tom Hughes
1db05339d3 Don't set the Status header - it is set automatically by the FastCGI code
and this manually set one conflicts with that and causes a 200 response
in rails 2.3.2 it seems.
2009-06-04 22:53:05 +00:00
Tom Hughes
2f3e23f6eb Move to version 2.3.2 of rails. 2009-06-04 08:08:24 +00:00
Renamed from app/controllers/application.rb (Browse further)