Commit Graph

1802 Commits

Author SHA1 Message Date
7596dec7b9 Comply to new interface 2015-06-17 12:48:10 +09:30
61bea371ab Use UrlGenerator to get avatar URL 2015-06-17 12:48:01 +09:30
b91ca93e09 Fix LoginWithCookie middleware being ineffective
Flarum\Support\Actor needs to be a singleton. There is a comment in
LoginWithHeader - is there a better approach to the whole Actor thing?
2015-06-17 12:47:49 +09:30
00cb2f2e55 Change event so that data can be modified before it is serialized 2015-06-17 12:46:50 +09:30
708782637e Change config values to match new base URLs 2015-06-17 02:37:06 +02:00
e8aff5bc95 Make sure generated usernames cannot break validation 2015-06-17 02:36:51 +02:00
ce34d922d7 Fix merge conflict 2015-06-17 01:27:44 +02:00
29c7bf1b42 Remove debug statement 2015-06-17 00:53:03 +02:00
1cbc60ca41 Merge branch 'master' into psr-7
Conflicts:
	src/Api/Actions/Discussions/IndexAction.php
	src/Api/Actions/SerializeAction.php
	src/Core/Formatter/FormatterManager.php
	src/Extend/ForumAssets.php
	src/Forum/Actions/IndexAction.php
	src/Forum/ForumServiceProvider.php
2015-06-17 00:52:50 +02:00
ffb28838b5 Add TODO message 2015-06-17 00:18:16 +02:00
33d663bc8e Revamp routing
All routes are now stored in a RouteCollection, which is then used
for dispatching by the (reusable) RouterMiddleware.

This change also entails moving all routes to the service providers.
This may be changed again later, and is done for convenience reasons
right now.
2015-06-17 00:16:35 +02:00
d1e7453ffd Override static property
@franzliedke I didn’t realise that static properties are static to the
class they are defined on, and not each individual subclass. All of the
static members of the SerializeAction class (which are intended for
extensions to alter per-action) are being inherited by all actions.

Any ideas on how to work around this other than defining every static
member on each individual subclass?
2015-06-16 21:55:59 +09:30
4b4ff1e7fd Add API to add a link to an action 2015-06-16 17:39:47 +09:30
f0df751465 Overhaul permissions
Get rid of Permissible - too complex and inefficient. Replace with:
- a “Locked” trait which works similarly but only evaluates logic on
hydrated models.
- a “VisibleScope” trait which also works similarly but only scopes
queries

This is all we need, Permissible is overkill. There is only one
instance where we have to duplicate some logic
(Discussion::scopeVisiblePosts and Post::allow(‘view’, …)) but it’s
barely anything.

Haven’t decoupled for now, we can definitely look at doing that later.

Permissions table seeder slightly updated.

Also did a bit of a query audit, there’s still a lot to be done but
it’s much better than it was. Some relatively low-hanging fruit
detailed in EloquentPostRepository.
2015-06-16 17:33:56 +09:30
be2d0ac682 Add WillRespond event
So that custom data can be loaded onto a model before it is serialized.
(Tags extension uses this to load tags onto the forum model.)
2015-06-16 17:22:15 +09:30
c20a5bb793 Static relationship collections need to be initialised on subclasses
Will probably make this whole “custom relationships” thing a trait
instead of being on the base class
2015-06-16 17:21:04 +09:30
963078b375 Cache user permissions between calls 2015-06-16 17:18:02 +09:30
9ac1f53244 Add todo about query optimization 2015-06-16 16:59:48 +09:30
64e6b7d26c Remove total results from discussion searching
It’s too inefficient (requires a whole table scan) to do a query like:
select count(*) from discussions where [conditions determining
visibility]
2015-06-16 16:58:10 +09:30
c1e3820480 Add a serializer and API action to get information about the forum 2015-06-15 12:18:20 +09:30
823027b839 Prefer passing an array to ServiceProvider::extend 2015-06-15 08:59:33 +09:30
9997c5d7a3 Update permissions 2015-06-12 16:41:46 +09:30
8cebb4d8e6 API: Reorder Extend\Relationship arguments 2015-06-11 18:42:49 +09:30
48e33591c9 Add newline in-between JS files, in case last line is a comment 2015-06-11 18:42:26 +09:30
8b162344cd Lay the groundwork for translation & refactor asset compilation
Ditched the idea of having language packs as extensions. Reasoning:

1. Because we use machine keys for translations (rather than English
keys), extensions need to be able to define default translations. If
English translations are to be included in extensions and not in a
language pack extension, then it doesn’t make sense to have other
languages as language pack extensions. Inconsistency → complexity.

2. Translations should maintain version parity with their respective
extensions. There’s no way to do this if extension translations are
external to the extension.

Instead, localisation will be a core effort, as well as a per-extension
effort. Translators will be encouraged to send PRs to core + extensions.

In core, each locale has a directory containing three files:
- translations.yml
- config.js: contains pluralisation logic for the JS app, as well as
moment.js localisation if necessary
- config.php: contains pluralisation logic for the PHP app

Extensions can use the Flarum\Extend\Locale extender to add/override
translations/config to a locale.

Asset compilation has been completely refactored with a better
architecture. Translations + config.js are compiled and cached for the
currently active locale.
2015-06-10 14:23:56 +09:30
b65d18ee7f Use singleton method 2015-06-09 02:51:20 +02:00
d1cd4b174b Remove last remaining usage of DB facade 2015-06-09 02:40:02 +02:00
2a713ccb67 Remove HTTP method from generated URLs 2015-06-09 00:06:33 +02:00
fed3c2ebd1 Remove facade usage 2015-06-09 00:06:08 +02:00
238893a601 Get rid of more facade usage 2015-06-08 11:21:42 +02:00
38dfe787f2 Avoid usage of facade in user model 2015-06-08 11:20:46 +02:00
4db5cc347b Fix cookie retrieval in admin panel 2015-06-08 10:00:29 +02:00
f3c854ca57 Always initialize variable 2015-06-08 09:49:07 +02:00
0450aba462 Remove old code. 2015-06-08 14:57:05 +09:30
36257b1534 Load extensions from the root directory, with precedence. 2015-06-08 14:56:49 +09:30
b864ada389 Add extension generator command. 2015-06-08 14:56:19 +09:30
4d2f58b693 Clear bio HTML cache when saving bio 2015-06-08 09:50:07 +09:30
7a76bf175d Make HTMLPurifier config extensible; allow images 2015-06-08 09:37:30 +09:30
f928e746d9 Prevent formatter from being invoked if bio is empty 2015-06-08 09:34:39 +09:30
1962eeab72 Remove outdated column name from user table seeder 2015-06-07 22:04:11 +02:00
c2df8d5214 Merge branch 'master' into psr-7
Conflicts:
	composer.json
	composer.lock
	src/Api/Actions/TokenAction.php
	src/Core/Formatter/FormatterManager.php
	src/Core/Handlers/Events/EmailConfirmationMailer.php
	src/Forum/Actions/ConfirmEmailAction.php
	src/Forum/Actions/IndexAction.php
	src/Forum/Actions/ResetPasswordAction.php
	src/Forum/Actions/SavePasswordAction.php
	src/Forum/routes.php
2015-06-06 13:59:59 +02:00
381e7a2c57 Usernames must only contain alphanumeric chars/dashes/underscores
Perhaps we can relax this a little bit, but right now these are the
only characters that are parsed for @mentions anyway
2015-06-04 11:19:23 +09:30
aae7678cea Really rough fulltext driver implementation 2015-06-04 11:11:56 +09:30
42851f425b Rejig formatting API. closes flarum/core#85
It works but it’s not the most pretty thing in the world. @franzliedke
Would be great if you could take a look at the whole formatting API and
work your magic on it sometime… my brain is fried!
2015-06-04 10:48:07 +09:30
9487a56d61 Allow <hr> in posts 2015-06-03 18:12:15 +09:30
5d89618bbd Implement search on front end 2015-06-03 18:10:56 +09:30
9564778701 Upgrade to stable cookie dependency 2015-06-03 10:17:59 +02:00
5151a5aef5 Fix login response not containing the token 2015-06-03 03:41:09 +02:00
82ccf28072 Fix redirect after logout 2015-06-03 03:36:49 +02:00
ed79f7c4ea Fix middleware if cookie does not exist. 2015-06-03 03:36:17 +02:00