1
0
mirror of https://github.com/flarum/core.git synced 2025-07-25 10:41:24 +02:00
Commit Graph

718 Commits

Author SHA1 Message Date
Toby Zerner
cda00550aa Rework sessions, remember cookies, and auth again
- Use Symfony's Session component to work with sessions, instead of a custom database model. Separate the concept of access tokens from sessions once again.
- Extract common session/remember cookie logic into SessionAuthenticator and Rememberer classes.
- Extract AuthenticateUserTrait into a new AuthenticationResponseFactory class.
- Fix forgot password process.
2015-12-05 15:11:25 +10:30
Toby Zerner
3f8cdd1e7e Fix case-sensitive class names 2015-12-03 18:29:00 +10:30
Toby Zerner
8e38197756 Allow forum to be taken offline via config 2015-12-03 17:56:27 +10:30
Toby Zerner
7498f488f5 Fix previous commit 2015-12-03 17:56:04 +10:30
Toby Zerner
d55ba2c483 Merge branch 'sudo-mode'
# Conflicts:
#	CHANGELOG.md
2015-12-03 15:12:51 +10:30
Toby Zerner
32e9c0587c Overhaul sessions, tokens, and authentication
- Use cookies + CSRF token for API authentication in the default client. This mitigates potential XSS attacks by making the token unavailable to JavaScript. The Authorization header is still supported, but not used by default.
- Make sensitive/destructive actions (editing a user, permanently deleting anything, visiting the admin CP) require the user to re-enter their password if they haven't entered it in the last 30 minutes.
- Refactor and clean up the authentication middleware.
- Add an `onhide` hook to the Modal component. (+1 squashed commit)
2015-12-03 15:11:57 +10:30
Toby Zerner
1c094c175e Fix crash when loading notifications in some instances
Specifically, the crash would occur when the first notification had a subject without a discussion relationship (e.g. the Subscriptions extension's newPost notification, where the subject itself was a discussion). Instead of simply eager loading the nested subject.discussion relationship, we load discussions manually instead.
2015-12-03 15:10:05 +10:30
Toby Zerner
127b4a7607 Fuzzy-match global forum permissions
This means that the "Start a Discussion" button will still be enabled if the user is not allowed to start globally, but only in certain tags.

Also add some other stuff to the changelog.

closes #640
2015-12-03 15:08:28 +10:30
Franz Liedke
033a118e97 Rename HTTP method override header
This is the name recommended by the JSON-API spec:
http://jsonapi.org/recommendations/#patchless-clients
2015-11-26 17:43:32 +01:00
young
37917bf2c8 Fix #627 2015-11-26 02:03:00 +08:00
Toby Zerner
a21a18721f cs fix 2015-11-23 14:18:56 +10:30
Toby Zerner
06dc4edb3a Prevent error if no input is given in create actions 2015-11-23 14:15:30 +10:30
Toby Zerner
b76c2f16e7 Validate avatar URL
Still needs refactor
2015-11-23 14:14:53 +10:30
Toby Zerner
4949cbc89e Prevent crash if logged in user has been deleted 2015-11-23 11:54:30 +10:30
Toby Zerner
08034c0d9a Allow provision of an avatar URL to upload during sign up
This can be used by authentication extensions (i.e. mirror Facebook/Twitter profile picture). Rough implementation, needs refactoring.
2015-11-23 11:53:57 +10:30
Franz Liedke
5f9fe677a5 Inject hardcoded prerequisite parameters
This affects version numbers, extensions and paths, which might be
skeleton-specific. This commit moves those hardcoded values out of
the classes and instead injects them through the constructor. This
way, all prerequisites can be configured in the service provider.
2015-11-11 19:30:35 +01:00
Franz Liedke
6d798b110e Update version number 2015-11-05 09:58:05 +01:00
Toby Zerner
dc4e783e75 Parse fallback catalogues for => references too 2015-11-04 18:34:41 +10:30
Toby Zerner
8bda570e7c Fix regression in permission logic: make sure admins can do everything 2015-11-04 09:27:06 +10:30
Toby Zerner
d6e6e517a1 Make sure all locale JS files are flushed
Even when no language packs are enabled, a forum-en-xxx.js (or whatever the default locale is) file is still generated because other extensions may contain translations. But when enabling the English language pack, since no locales are registered with the LocaleManager, that file doesn't get flushed and therefore doesn't get regenerated with the English translations. This fix always registers the default locale with the LocaleManager so that's not the case.
2015-11-04 09:27:06 +10:30
Toby Zerner
43c556f4a8 Release 0.1.0-beta.3 2015-11-03 10:01:52 +10:30
Toby Zerner
ec7db5e8b4 Improve performance of translation reference parsing 2015-11-02 23:22:00 +10:30
Toby Zerner
1c8b43c0b9 Automatically include the appropriate translations from extensions 2015-11-02 18:51:12 +10:30
Toby Zerner
be18298687 Fall back to en after the forum's default locale
Since we'll be encouraging (requiring?) people to include an "en" translation in extensions they want to put on the Marketplace, we should have a further fallback to "en" if it can't find translations in the forum's default language. That way if people only use extensions from the Marketplace, they'll hardly ever see any key names.

Thanks to @dcsjapan for the suggestion.
2015-11-02 17:55:31 +10:30
Toby Zerner
832b31ebd9 Fix error when renaming discussion
Discussion/user info is needed when serialising posts (checking permissions, etc.) so we can't just use the ID.
2015-11-02 17:53:26 +10:30
Toby Zerner
ef7674dde9 Fix permissions being incorrectly granted 2015-11-01 09:38:25 +10:30
Franz Liedke
24d6a1c6b2 Update to newest version of Whoops middleware 2015-10-31 12:56:38 +01:00
Toby Zerner
34502bc286 Use relative path for core migrations 2015-10-31 18:22:03 +10:30
Toby Zerner
d5538f4931 Only attempt to get default locale if db is up to date 2015-10-31 18:21:39 +10:30
Toby Zerner
b869fb7068 Fix check for whether there is a translation for a group name 2015-10-31 18:20:55 +10:30
Toby Zerner
2173d2d4a2 Merge pull request #615 from oldskool/ip-logging
Minor changes:
- Rename/restyle migration, fix namespace
- Make IP address optional on PostReply command
2015-10-31 10:04:06 +10:30
Toby Zerner
762a3c984b Update for new tobscure/json-api relationship handling 2015-10-30 11:03:38 +10:30
Toby Zerner
45106f67b5 Disable extensions that require credentials by default 2015-10-29 17:52:52 +10:30
Jan Dorsman
1dcbd6e22f WIP IP Logging 2015-10-27 21:53:21 +01:00
Kirk Bushell
765b894084 Added more tests 2015-10-27 13:22:30 +00:00
Toby Zerner
d2d167cb48 Use exception handlers instead of JsonApiSerializableInterface 2015-10-26 11:14:48 +10:30
Toby Zerner
aeeb16cb86 i18n: Make cross-file translation references work 2015-10-24 13:16:26 +10:30
Toby Zerner
d6691e6299 Don't let users view discussions without permission
closes #599
2015-10-22 21:52:31 +10:30
Toby Zerner
5f9f4a1536 Allow hyphens in referenced key names 2015-10-22 17:01:21 +10:30
Toby Zerner
b299bd36e8 Add flood control
closes #271
2015-10-22 16:57:48 +10:30
Toby Zerner
ee7bfddd4b More helpful avatar upload error messages
ref #165, #118
2015-10-22 10:40:38 +10:30
Toby Zerner
69f8acd0e0 Translate basic HTML views
app('view') call to set translator is temporary. See #189
2015-10-21 11:36:49 +10:30
Toby Zerner
882133ca55 Increase username max length
Not sure why it was at 8!
2015-10-21 11:13:55 +10:30
Toby Zerner
5bec750f12 Change back to 401 error on invalid login
See f2dbb96e84 (commitcomment-13866552)
2015-10-21 09:04:58 +10:30
Toby Zerner
c0e3cb1833 Don't use array_filter flag (PHP 5.6 only) 2015-10-20 22:25:20 +10:30
Toby Zerner
d237dc84aa Fix installation 2015-10-20 22:07:35 +10:30
Toby Zerner
f2dbb96e84 Improve client XHR error handling
The default XHR error handler produce an alert which is appropriate to the response status code. It can be overridden per-request (by specifying the `errorHandler` option) so that the alert can be suppressed or displayed in a different position (e.g. inside a modal).

ref #118
2015-10-20 12:48:26 +10:30
Toby Zerner
0952651cf3 Fix migrate command and generated migration namespace 2015-10-19 16:48:16 +10:30
Toby Zerner
1dd847bd36 Translate group names during serialization
closes #564
2015-10-19 15:44:28 +10:30
Toby Zerner
23eb4c805b Implement proper update process
If the version in the settings table mismatches the code version, then we return a 503 error for all requests coming through index.php and api.php, while admin.php serves up a form prompting for the database password which will run outstanding migrations.
2015-10-19 15:09:54 +10:30