Commit Graph

890 Commits

Author SHA1 Message Date
Toby Zerner
296b822636 Merge branch 'master' into composer 2015-10-03 16:41:23 +09:30
Toby Zerner
232f3b6bc6 API: Reverse splitting of BuildClientView event, but add checker methods 2015-10-03 16:40:41 +09:30
Toby Zerner
03f862fe8c Merge branch 'master' into composer 2015-10-02 17:57:24 +09:30
Toby Zerner
b4cb5a11da Allow extension icon styles to reference assets
Example usage:

"icon": {
    "backgroundImage": "url('{$assets}/icon.svg')"
}
2015-10-02 17:55:42 +09:30
Toby Zerner
ef2cc9b0cd Remove ability for extensions to register a service provider
The concept of returning a bootstrapper function is simpler and the use of service providers had no advantage over it.
2015-10-02 17:54:53 +09:30
Toby Zerner
2a17590412 Change migration namespace format 2015-10-02 17:49:43 +09:30
Toby Zerner
e251cf34c4 Use composer.json for extension metadata 2015-10-02 17:49:16 +09:30
Toby Zerner
0142b01cc5 Add server 2015-10-02 17:47:12 +09:30
Toby Zerner
89338290a4 Only include namespaced translations 2015-10-02 17:43:41 +09:30
Toby Zerner
58eaf79a98 API: Split BuildClientView into two separate events
Much easier to work with. Extension stub hasn't been updated yet.
2015-10-02 17:42:34 +09:30
Toby Zerner
f255d318ef Add multiple UrlGenerator classes for forum/api/admin
Spent quite a while looking into the best solution here and ended up going with three separate classes. Thanks to @Luceos for the PR that got this rolling (#518). My reasoning is:

- The task of routing and URL generation is independent for each section of the app. Take Flarum\Api\Users\IndexAction for example. I don't want to generate a URL to a Flarum route... I specifically want to generate a URL to an API route. So there should be a class with that specific responsibility.
- In fact, each URL generator is slightly different, because we need to add a certain prefix to the start (e.g. /api)
- This also allows us to get rid of the "flarum.api" prefix on each route's name.
- It's still DRY, because they all extend a base class.

At the same time, I could see no reason this needed to be "interfaced", so all of the classes are concrete.

Goes a long way to fixing #123 - still just a few places left remaining with hardcoded URLs.
2015-10-02 17:35:29 +09:30
Toby Zerner
aa203de6e9 Update docblocks 2015-09-29 16:41:34 +09:30
Toby Zerner
e0aa99fabb Properly mark all notifications as read
Previously, clicking the "mark all notifications as read" button would individually mark each of the visible notifications as read. Since we now always show a badge with the number of unread notifications, we need to make sure that all notifications (not just the visible ones) can be marked as read. Otherwise it would be possible to get stuck with an unread badge there.

This commit adds a new API endpoint which marks *all* of a user's notifications as read. The JSON-API spec doesn't cover this kind of thing (updating all instances of a certain resource type), so I'm a bit unsure regarding what the endpoint should actually be. For now I've gone with POST /notifications/read, but I'm open to suggestions.

ref #500
2015-09-29 16:41:05 +09:30
Franz Liedke
5382d0ce1a Remove unused import 2015-09-29 01:31:34 +02:00
Franz Liedke
295f29e53e Make linter happy 2015-09-29 01:31:09 +02:00
Franz Liedke
040ce52724 Return both unread and new notification count from the API
Related to #500.
2015-09-29 01:28:47 +02:00
kirkbushell
c3374197d1 Added zend-stragility (missing), removed some redundant code. 2015-09-28 15:59:07 +01:00
Toby Zerner
3efbffdcec Extract English translations into a language pack
To make this work, we add support for the client working without any locale.

Also fixes #412.
2015-09-25 16:12:09 +09:30
Toby Zerner
02e40f7c47 Allow extensions to return a callback instead of a provider name
This is useful for very simple extensions like language packs, because it means no Composer/namespacing and thus bootstrap.php doesn't have to be changed at all.
2015-09-25 16:05:01 +09:30
Franz Liedke
de216af08d Change name of header for faking HTTP methods
Refs #502.
2015-09-25 00:35:57 +02:00
Franz Liedke
418b1b9bac Implement middleware for faking HTTP methods
Refs #502.
2015-09-25 00:31:31 +02:00
Daniel Klabbers
68369ac5bb heavier validation for username 2015-09-24 23:07:30 +02:00
Franz Liedke
7404debb21 Clean up unused variable
Closes #501.
2015-09-24 16:27:00 +02:00
Toby Zerner
35360b690c Temporary solution to resolve translation references
Just implemented this roughly so I can keep working :D /cc @franzliedke
2015-09-24 09:27:47 +09:30
Toby Zerner
b9bda2d443 Compile all core translations for now
May need to be specific again once we have admin translations, or it
may be better to just put admin translations under a different
namespace...
2015-09-24 09:06:44 +09:30
Toby Zerner
91fb24f7a3 Fix is:unread gambit
closes #485
2015-09-24 08:31:56 +09:30
Toby Zerner
273461040c Update local copy of notification when marking as read 2015-09-23 10:52:26 +09:30
Franz Liedke
ee9862004d Make sure JSON request bodies are parsed as array.
Refs #533.
2015-09-22 15:19:54 +02:00
Toby Zerner
db067c7d87 Refresh discussion metadata to make sure it's correct
The new Approval extension may hide new posts, in which case we don't
want to increment the comments count/set the last post.
2015-09-22 17:57:20 +09:30
Toby Zerner
7a0299d246 Relax self edit/rename restrictions
- Fixes the last post not being self-editable if it's hidden
- Fixes the discussion not being self-renameable its only post is hidden
2015-09-22 17:56:09 +09:30
Toby Zerner
264725d872 Allow discussions to be hidden and restored 2015-09-22 17:48:21 +09:30
Toby Zerner
8e19312534 Add API to run callback after a model instance is saved 2015-09-22 17:22:25 +09:30
Toby Zerner
ed602c6032 Remove importer for the time being 2015-09-22 17:14:01 +09:30
Toby Zerner
d6ed04ffce Fix incorrect version requirement in extension generator 2015-09-22 17:13:41 +09:30
Toby Zerner
8937050aed Rename column for consistency 2015-09-22 16:54:32 +09:30
Toby Zerner
8f387bbd52 Allow formatter to be used for things other than post formatting 2015-09-18 13:29:43 +09:30
Toby Zerner
c4dc1a5ee2 Allow settings to be deleted using LIKE
Also give migrations access to the SettingsRepository
2015-09-18 13:28:38 +09:30
Toby Zerner
ca09e834b1 Add events for serializing/unserializing config values 2015-09-18 13:16:35 +09:30
Toby Zerner
f4a4ed8b49 Extend social login access token expiry 2015-09-17 12:57:22 +09:30
Toby Zerner
dbd33f687c Remove "custom" home page input
Also add an API to let extensions define additional default route
options.

Allowing default routes with parameters (e.g. /d/123) is very difficult
because of the way Mithril routing works, and it doesn't have a
convincing use-case to justify the trouble. So I've removed the custom
input altogether.

closes #427
2015-09-17 12:56:39 +09:30
Toby Zerner
e038c5c9d9 Add migration generator 2015-09-17 12:16:38 +09:30
Toby Zerner
7fb582e8d7 Namespace migrations to avoid potential conflicts
Core migrations are under the Flarum\Migrations\Core namespace.
Extension migrations must be under the
Flarum\Migrations\{ExtensionName} namespace.

closes #422
2015-09-17 08:54:31 +09:30
Daniel Klabbers
84e670082b fixed flarum/core#489 missing meta description from admin area 2015-09-16 21:43:53 +02:00
Franz Liedke
ad060126ae Small cleanup in extension manager 2015-09-16 08:56:27 +02:00
Davide Bellini
fc8dfd8893 Changed default Admin password
Default Admin password doesn't pass the new validation rule (min 8 chars)

See: cbcad27679 (diff-2e6d4ed85cd06d3e11f7f8428746214eR126)
2015-09-15 17:52:33 +02:00
Toby Zerner
701ad0a977 Add API to set asset compiler filename 2015-09-15 21:20:32 +09:30
Franz Liedke
cd5f5515e2 Try to make PHP extension requirement message clearer 2015-09-15 09:18:26 +02:00
Toby Zerner
d8c2cbc265 Mark all notifications with the same subject as read 2015-09-15 16:20:22 +09:30
Toby Zerner
f6ad891850 Rename ExternalAuthenticator to Authenticator 2015-09-15 16:03:10 +09:30
Toby Zerner
e524c59f97 Improve external authentication API
Some providers (e.g. Twitter) don't expose user email addresses, so it
turns out we can't use that as the sole form of identification/account
matching.

This commit introduces a new `auth_tokens` table which stores arbitrary
attributes during the sign up process. For example, when Twitter is
authenticated, a new auth token containing the user's Twitter ID will
be created. When sign up is completed with this token, that Twitter ID
will be set as an attribute on the user's account.
2015-09-15 15:56:48 +09:30
Toby Zerner
6beb4fe898 Add external authenticator (social login) API
Allows registrations to be completed with a pre-confirmed email address
and no password.
2015-09-15 11:27:31 +09:30
Toby Zerner
cbcad27679 Improve installer validation
Very rough, but works for now. The basic premise being that we need to
collect all user data before we proceed with installation.
2015-09-14 18:13:24 +09:30
Toby Zerner
60323e0cf9 Bump version number 2015-09-14 16:32:31 +09:30
Toby Zerner
8cccaaaf6b Improve API error handling
- Change 'path' key to 'source.pointer', as per spec
- Add 500 error detail if debug mode is on
2015-09-14 15:40:07 +09:30
Toby Zerner
190aa925ac Set cookies to be HTTP only 2015-09-14 14:40:05 +09:30
Toby Zerner
60b19efe0a Password is not necessarily required
e.g. on my LAMP setup, I sometimes use a MySQL account without a
password
2015-09-14 14:39:18 +09:30
Franz Liedke
e7d7df3b0c Cleanup 2015-09-11 09:16:53 +02:00
Franz Liedke
3b5a01e603 Implement more validation in installer 2015-09-11 09:16:43 +02:00
Franz Liedke
902d01712b Remove pointless JSON-API action base class
Cleanup related to #118.
2015-09-09 09:04:49 +02:00
Franz Liedke
502a3787d5 Move remaining extension handling to middleware 2015-09-09 08:56:11 +02:00
Franz Liedke
b8ac49ffcc Move exception handling for Flarum exception classes to middleware
Related to #118.
2015-09-08 22:36:32 +02:00
Franz Liedke
4b4cea4d87 Implement interface to serialize exceptions to JSON-API format
Related to #118
2015-09-08 22:35:39 +02:00
Toby Zerner
8c4e095f23 Allow first post to be hidden/restored
Anti-spam extensions may automatically hide the first post in a
discussion, and thus we had to implement smarter permissions so
discussions with zero posts wouldn't be visible to users other than the
author/mods. This change allows those hidden posts to be restored again.
2015-09-07 16:03:45 +09:30
Toby Zerner
84012ca2fd Preliminary implementation of master API keys
Part of #205
2015-09-07 08:37:33 +09:30
Toby Zerner
6ee9412f35 Prevent invalid LESS from crashing application
Failure is silent for now... The default LESS will compile without the
invalid customisations. Not sure if we should log an error somewhere
and display it on the admin page?

closes #400
2015-09-04 22:33:26 +09:30
Toby Zerner
478ca90c31 Fallback to English if system-wide default_locale doesn't exist 2015-09-04 22:19:28 +09:30
Toby Zerner
1f8f79d272 Don't require database password confirmation 2015-09-04 21:45:52 +09:30
Franz Liedke
db8b9ed0c0 Installer: Fix password confirmation 2015-09-04 12:11:13 +02:00
Franz Liedke
a3d59977b3 Clean up code 2015-09-04 12:05:12 +02:00
Franz Liedke
211d2d25cd Merge pull request #413 from WinterSilence/patch-2
Update RouteCollection::getPath
2015-09-04 12:03:51 +02:00
Franz Liedke
42f1abacaf Ask for password confirmation in web installer, too
Closes #405.
2015-09-04 12:00:03 +02:00
Franz Liedke
b26c67dd3c Require password confirmation in console installer
Refs #405.
2015-09-04 11:57:11 +02:00
Toby Zerner
fc7fc41383 Prevent error when hiding/restoring a post with a deleted user 2015-09-04 13:51:13 +09:30
Toby Zerner
ece23de750 API: Add User::hasPermissionLike() and User::getPermissions() 2015-09-04 12:23:50 +09:30
Toby Zerner
4705600d47 Fix typehint 2015-09-04 12:23:27 +09:30
Toby Zerner
8423de754c Fix bad query in isVisibleTo 2015-09-04 12:23:17 +09:30
Toby Zerner
b597e6f8f6 Don't load a custom relation if the relation is already loaded 2015-09-04 12:22:49 +09:30
Toby Zerner
276334ec52 Improve some post/discussion permission logic
- Allow users to see their own posts, even if they have been hidden by
someone else
- Don't require hiding a post to be necessarily attributed to a user
- Hide discussions with zero posts, unless the user can edit posts, or
they are the discussion author
2015-09-04 12:22:27 +09:30
Toby Zerner
f0186d7674 API: Add typehints 2015-09-04 12:18:09 +09:30
Daniel Klabbers
0413daab74 call to $this-> assertValidPassword from static context 2015-09-04 00:00:24 +02:00
Franz Liedke
21dd516eaa Fix code style issues 2015-09-03 08:48:26 +02:00
Franz Liedke
3c9d851889 Check prerequisites in console installer, too 2015-09-03 08:42:16 +02:00
Franz Liedke
942db77416 Extract installation prerequisites into composable classes and use those in the web-based installer 2015-09-03 08:23:34 +02:00
Anton
04db806995 Update RouteCollection.php 2015-09-02 19:22:40 +03:00
Anton
f3bc7d1c23 Update RouteCollection::getPath
This version work faster - old code create closure at every calling getPath
2015-09-02 10:58:44 +03:00
Johann Rodríguez
e35bb9e400 Fix enable extension in EntensionManager 2015-09-01 12:09:11 +01:00
Franz Liedke
753a846e7a Check MySQL version when installing on console
Related to #364.
2015-09-01 08:02:07 +02:00
Franz Liedke
d3e57d77b4 Fix typehint 2015-09-01 07:49:06 +02:00
Toby Zerner
6e0bffe395 API: Add more locale registration APIs 2015-09-01 10:08:37 +09:30
Toby Zerner
eec4e97d65 Tidy up default extension metadata 2015-09-01 10:08:37 +09:30
Toby Zerner
6aafe54ee7 Fix potential error when discussion doesn't exist
Not sure how this could be the case, but can't hurt to add the checks.
addresses #343
2015-09-01 10:08:36 +09:30
Franz Liedke
4c34d0867d Add field for table prefix in web installer
Related to #269.
2015-08-31 09:10:27 +02:00
Toby Zerner
f2a3a0cb10 Require the PHP fileinfo extension
It's required for the intervention/image package
2015-08-31 15:29:20 +09:30
Toby Zerner
5b7527144c Permit trailing slashes in discussion/user URLs
closes #334
2015-08-31 14:43:42 +09:30
Toby Zerner
6c169499b5 Only migrate enabled extensions when upgrading
Also remove the Extension::install() and Extension::uninstall()
methods, because they add nothing that can't be done with migrations.
2015-08-31 14:35:52 +09:30
Toby Zerner
5e22458014 Installer: Prevent crash when views directory is not writable
Use plain PHP templates instead of Blade templates so there is nothing
that needs to be written.

closes #376
2015-08-31 14:25:16 +09:30
Toby Zerner
c72bdc8238 Fix Laravel 5.1 compat
closes #307
2015-08-31 14:07:11 +09:30
Toby Zerner
bcc16a3329 Add target="_blank" and rel="nofollow" to all formatted links
closes #247
2015-08-31 13:36:54 +09:30
Toby Zerner
f5517fbd88 Validate password length
We can't do this using the ValidatesBeforeSave trait because the
password has been hashed by then. Instead, we must validate the
original password as it comes in.
2015-08-31 12:38:15 +09:30
Toby Zerner
6a0e3fcf2d Validate post length to prevent truncation
closes #235
2015-08-31 12:36:19 +09:30
Toby Zerner
9f28b4e8dc Require extensions directory to be writable 2015-08-31 11:22:57 +09:30
Franz Liedke
1d1cc9e443 Fix asset URL generation
This is important when Flarum is deployed in a subfolder.

Closes #291.
2015-08-29 22:38:31 +02:00
Franz Liedke
f5d2d2ff79 Installer: Check for openssl extension
Closes #296.
2015-08-29 22:07:50 +02:00
Lorenz Bausch
a4fe6f3ce3 limit max title length to 80 characters 2015-08-29 11:26:18 +02:00
Lorenz Bausch
ae06b45bc1 remove executable flag from file 2015-08-29 11:23:05 +02:00
Toby Zerner
12d5e48b95 Add helpful hint on how to upgrade PHP 2015-08-29 14:44:55 +09:30
Toby Zerner
bb3c57f9a4 Fix default database name 2015-08-28 14:53:01 +09:30
Toby Zerner
d5074c5286 Use gd as the image driver
Presumably gd is more common than imagick, and we already check for it
during installation.
2015-08-28 05:41:25 +09:30
Toby Zerner
41019597d0 Require the PHP DOM extension 2015-08-28 05:30:27 +09:30
Toby Zerner
b689c9de3b Allow non-admins to reset their password
The EditUser command requires the actor to have the "edit" permission,
which is only granted to admins. We don't want to allow users to change
their own password via the API, though. So instead of dispatching the
command, we'll just update the user's password directly in the action.
2015-08-28 03:38:55 +09:30
Toby Zerner
baed659668 Fix reset password error 2015-08-28 02:16:28 +09:30
Toby Zerner
268b041da2 Fix incorrect chmod instruction 2015-08-27 21:51:36 +09:30
Toby Zerner
7d9527e5a0 Check to make sure directories are writable 2015-08-27 21:45:02 +09:30
Toby Zerner
a289884f7c Fix typo causing bundled extensions to not be enabled 2015-08-27 21:28:15 +09:30
Toby Zerner
822b31468a Check some more extension requirements 2015-08-27 20:37:20 +09:30
Toby Zerner
d050a7775f Don't enable the Pusher extension by default 2015-08-27 20:11:14 +09:30
Toby Zerner
5c5be89928 Check some requirements before installation 2015-08-27 20:11:06 +09:30
Toby Zerner
2820ae8ac7 User lighter default theme color 2015-08-27 10:51:14 +09:30
Toby Zerner
498aac5b76 Import admin "log out" translation 2015-08-27 10:50:57 +09:30
Toby Zerner
b0db7bf751 Polish admin dashboard 2015-08-27 10:50:15 +09:30
Franz Liedke
559110a83f Coding standards 2015-08-27 01:40:18 +02:00
Franz Liedke
c0030dc98a Revert PATH_INFO magic 2015-08-27 01:31:28 +02:00
Franz Liedke
3b2a0697e2 Fix config retrieval 2015-08-27 00:58:56 +02:00
Franz Liedke
9ec54ad892 Change base URL etc. in config.php file 2015-08-27 00:47:54 +02:00
Franz Liedke
49f20995b2 By default, don't rewrite API base URL 2015-08-26 23:43:33 +02:00
Franz Liedke
1e1f9e51ee Use path info for routing 2015-08-26 23:39:39 +02:00
Franz Liedke
d12106809f Extract method 2015-08-26 10:33:41 +02:00
Toby Zerner
b194f07a72 Redirect using configured base URL 2015-08-26 17:48:25 +09:30
Toby Zerner
3e804ca0b5 Delete config.php if installation fails 2015-08-26 17:46:49 +09:30
Toby Zerner
0b8aa5c124 Add header comment; PSR-2 fixes; remove seeders 2015-08-26 16:56:32 +09:30
Franz Liedke
dae8e617ae Cleanup small things in installer 2015-08-26 09:02:28 +02:00
Toby Zerner
8ec342f6cb Autoload the cached PHP renderer 2015-08-26 09:46:20 +09:30
Toby Zerner
b67ae4c8a3 Use PHP formatter rendering engine
Removes dependency on XSLT extension
2015-08-26 09:34:49 +09:30
Toby Zerner
b8fc0bc376 Make discussion slug URL parameter optional 2015-08-25 19:32:41 +09:30
Toby Zerner
3392d9fdcf Migrate extensions in upgrade script 2015-08-18 13:56:49 +09:30
Toby Zerner
71c7740086 Get generate:extension command working again 2015-08-18 13:56:25 +09:30
Toby Zerner
edccd10693 Only delete avatar if it exists 2015-08-17 16:06:51 +09:30
Toby Zerner
a32250884c Ensure posts are sorted correctly 2015-08-17 15:52:39 +09:30
Toby Zerner
2b812ab211 Use a relative path to locate migrations 2015-08-17 14:57:33 +09:30
Toby Zerner
ce91058ab1 Derive base URL from the original URI 2015-08-17 14:57:12 +09:30
Toby Zerner
fec6e39fe1 Fix PHP 5.5 compat 2015-08-17 14:56:39 +09:30
Toby Zerner
1052aa55ea Implement web installer 2015-08-17 14:12:02 +09:30
Toby Zerner
17dbeefabe Clean up 2015-08-17 14:11:45 +09:30
Toby Zerner
212880640d Support table custom table prefix
Laravel automatically adds a table prefix to any table names, so we
need to wrap our aliased table in DB::raw.
2015-08-14 12:51:30 +09:30
Toby Zerner
34d4a7ed89 Fix Laravel 5.1 compat 2015-08-14 12:50:32 +09:30
Toby Zerner
8065c980d4 Don't redirect to HTML-only mode if in debug mode 2015-08-14 12:50:15 +09:30
Toby Zerner
6cee3b7160 Automatically derive base_path from base_url 2015-08-14 12:50:00 +09:30
Toby Zerner
014bacb7ab Add ability to uninstall an extension 2015-08-14 12:48:29 +09:30
Toby Zerner
2edcbacccc Improve install command, add custom migrations system
Implemented our own migration repository + migrator (based on Laravel's
stuff) so that we can keep track of which migrations have been run for
core and per-extension. That way we can simple call the migrator to
upgrade core/extensions, and to uninstall extensions.
2015-08-14 12:47:59 +09:30
Toby Zerner
5bcf6ae630 Add Escaper plugin so that formatting can be escaped 2015-08-13 13:04:56 +09:30
Toby Zerner
58223b8a23 Don't allow empty post content
Parsing the post content makes it non-empty (`<t></t>`), so we don't
parse it if it is empty. Also delete a created discussion if the first
post was invalid.

closes flarum/core#224
2015-08-13 13:03:49 +09:30
Toby Zerner
9a0190e13a Allow post author to see their own deleted post
closes flarum/core#225
2015-08-13 13:02:13 +09:30
Toby Zerner
6dd6942e17 Fix avatar uploading permissions
closes flarum/core#230
2015-08-13 12:59:40 +09:30
Toby Zerner
9c7fab5d8c Support running in subdirectory with base_path config 2015-08-13 12:58:59 +09:30
Toby Zerner
aec83b295a Remove old files 2015-08-13 12:56:26 +09:30
Toby Zerner
6123773001 New listen API
Event subscriptions now take place before *any* boot method is called.
This ensures that all event listeners are registered before things
happen – e.g. locales are registered before the translator is
instantiated in the Tags extension's boot method.
2015-08-13 12:55:48 +09:30
Toby Zerner
acf27cebb1 Fix tobscure/json-api compat 2015-08-13 10:41:39 +09:30
Toby Zerner
8aafce5fd8 Fix Laravel 5.1 compat 2015-08-13 10:41:17 +09:30
Toby Zerner
46a69b6b7e Fix PHP 5.5 compat
Might be better to opt for a getLayout method?
2015-08-13 10:41:08 +09:30
Toby Zerner
47595ff9c4 Decouple from Laravel, implement translator 2015-08-12 18:33:39 +09:30
Toby Zerner
9f0358bb39 Update to Laravel 5.1
Eloquent `lists()` now returns a collection
2015-08-12 13:24:11 +09:30
Franz Liedke
25c5fb075f Redo installer 2015-08-12 01:42:39 +02:00
Franz Liedke
7b07e02e75 Use dependency injection in migrations 2015-08-12 01:29:40 +02:00
Toby Zerner
4e01aa10d8 Flush client assets when custom LESS is updated 2015-08-06 16:17:05 +09:30
Toby Zerner
3aebd458b0 Make sure access/email/password tokens are valid 2015-08-06 15:04:38 +09:30
Toby Zerner
2553f4f0a3 Throw an exception if discussion not found
closes flarum/core#208
2015-08-06 13:59:09 +09:30
Toby Zerner
edddeeb553 Make some changes to facilitate updates to mentions extension 2015-08-06 13:16:53 +09:30
Toby Zerner
fa5c7cb123 Build very rough HTML-only content
And redirect to the "no JS" mode if the JS app crashes on boot.

ClientView/ClientAction is all a bit of a mess and will need to be
radically cleaned up at some point...
2015-08-06 12:21:11 +09:30
Toby Zerner
80e13ae289 Implement default route config setting 2015-08-06 12:18:59 +09:30
Toby Zerner
c361c97394 Enforce discussion renaming/deleting/post editing timed permissions 2015-08-05 19:21:33 +09:30
Toby Zerner
4c06e78b57 Allow/disallow signup per config 2015-08-05 18:19:26 +09:30
Toby Zerner
023eff95e3 Let users see themselves even if they can't see the forum 2015-08-05 18:12:09 +09:30
Toby Zerner
ff8dc5ef25 Enforce forum.view permission 2015-08-05 18:08:31 +09:30
Toby Zerner
ca8fee4685 Let users see their own email/activation status 2015-08-05 16:07:22 +09:30
Toby Zerner
42e382045a API: Add event for determining user groups for permissions 2015-08-05 16:06:55 +09:30
Toby Zerner
57e37e06ef Disable "start discussion" button if no permission 2015-08-05 16:06:25 +09:30
Toby Zerner
f42c3cd1ed Allow admins to delete users 2015-08-05 12:08:28 +09:30
Toby Zerner
1679f1e27b Implement edit user modal
EditUserHandler is a bit rough
2015-08-05 11:49:37 +09:30
Toby Zerner
f49d0e5341 Allow locale to be selected in footer 2015-08-05 09:50:57 +09:30
Toby Zerner
48df9bb678 Fix syntax error 2015-08-04 21:50:44 +09:30
Toby Zerner
187517a9c7 Remove ability for users to delete themselves 2015-08-04 21:35:41 +09:30
Toby Zerner
5fa7a8c555 Add the parsedBody to API request input 2015-08-04 21:22:40 +09:30
Franz Liedke
eee34598f1 Include editUser relationship when editing posts.
Closes flarum/core#214. Hopefully. :)
2015-08-04 13:15:56 +02:00
Toby Zerner
e091b037f3 Radically simplify user activity system
The activity system we were using was built around a separate table.
Whenever the user posted something, or deleted a post, we would sync
the table. The advantage of this was that we could aggregate activity
of all different types very efficiently.

It turns out that it came with a huge disadvantage: there was no
efficient way to enforce permissions on activity. If a user posted
something in a private tag, everyone could still see it on their
activity feed. My stopgap solution was to only sync activity for posts
that are viewable by guests, but that was way too limited.

It also turns out that aggregating activity of different types is
really not that useful, especially considering most of it is the user
making posts. So I've gotten rid of that whole overly-complicated
system, and just made the user profile display separate lists of posts
and discussions, retrieved from those respective APIs. The discussions
page is an actual discussion list too, which is pretty cool.

It's still technically possible to aggregate different activity types
(basically just aggregate API responses together), but we can do that
later if there's a need for it.

This is probably my favourite commit of the day :)
2015-08-04 18:44:22 +09:30
Toby Zerner
a2c3c4e51b Only add posted activity if the post is visible publicly
This is very restrictive behaviour and we'll probably need to think of
something a bit more powerful in the future. But it's a good stopgap.
2015-08-04 17:47:46 +09:30
Toby Zerner
667fe56947 Use morphTo instead of mappedMorphTo
Turns out we don't need MappedMorphTo after all.
2015-08-04 17:33:58 +09:30
Toby Zerner
556b93e367 Add admin client JS/LESS to extension stub 2015-08-04 17:18:45 +09:30
Toby Zerner
9700fbbb0b Add API to add translations to admin client
Again, I'll split up these APIs soon enough
2015-08-04 17:16:34 +09:30
Toby Zerner
7ed3834dc9 Include discussion last user relationship in response after creating post 2015-08-04 17:15:57 +09:30
Toby Zerner
5b3484d3c8 Improve error handling somewhat
- Fix composer crashing/not showing alert on error
- Make a general ValidationException which takes an array of field ⇒
messages to be outputted nicely by the API
2015-08-04 13:03:46 +09:30
Toby Zerner
2e4d38b3e7 Move config/permission actions to API; clean up cache flushing 2015-08-04 10:40:04 +09:30
Toby Zerner
83e8503df1 Rough implementation of appearance settings 2015-08-03 14:35:51 +09:30
Toby Zerner
70901b1420 Rough extension management implementation 2015-08-03 12:03:30 +09:30
Toby Zerner
66ee6e57ee Convert permission IDs into strings 2015-08-02 18:02:35 +09:30
Toby Zerner
025d8f691d Add API methods to add POST/DELETE routes to the API 2015-08-02 17:26:30 +09:30
Toby Zerner
6f09ba6591 Clean up 2015-07-31 20:17:17 +09:30
Toby Zerner
fde7afd3e2 Finish admin permissions page and clean up everything 2015-07-31 20:16:47 +09:30
Toby Zerner
5706c71c86 Convert email/password token date fields 2015-07-31 20:14:19 +09:30
Toby Zerner
ba41c5313a Allow for the addition of admin assets
I think the `BuildClientView` event should ultimately be split into two
separate events for the forum/admin clients, but this is fine for now.
2015-07-31 20:13:13 +09:30
Toby Zerner
4e0cfdc1b2 Allow for the addition of new API endpoints 2015-07-31 20:11:44 +09:30
Toby Zerner
cea8e7f567 Add group management actions to API 2015-07-31 20:10:49 +09:30
Toby Zerner
6641af3ac3 Refactor some model stuff out into traits 2015-07-31 20:09:31 +09:30
Toby Zerner
e204794b91 Allow custom variables to be set on the client app 2015-07-31 20:08:27 +09:30
Toby Zerner
513d896f51 Fix more aspects of the password reset process 2015-07-31 14:13:35 +09:30
Toby Zerner
8db17b3fb8 Fix password saving 2015-07-31 14:00:42 +09:30
Toby Zerner
42fd8e26c1 Begin implementing permissions page 2015-07-29 21:00:27 +09:30
Toby Zerner
f96cac6057 Implement basic settings page 2015-07-29 21:00:09 +09:30
Toby Zerner
e863bd53d3 Get admin area working again 2015-07-29 20:58:22 +09:30
Toby Zerner
d8d9cac7c3 Enable caching of minified formatter JS 2015-07-29 20:54:48 +09:30
Toby Zerner
97334bea12 Don't display notifications with deleted subjects 2015-07-28 17:15:09 +09:30
Toby Zerner
8f29949016 Fix email confirmation 2015-07-28 17:14:08 +09:30
Toby Zerner
02944548a1 Clean up 2015-07-28 15:35:03 +09:30
Toby Zerner
697cb2ed63 Supporting routing of URL with nothing after the discussion ID
closes flarum/core#181
2015-07-28 13:46:43 +09:30
Toby Zerner
8c18ff3349 Tweak TextFormatter JS settings 2015-07-28 12:44:58 +09:30
Toby Zerner
62a01c69a9 Make sure sort key exists 2015-07-28 12:27:59 +09:30
Toby Zerner
3489791932 Allow customisation of the client layout 2015-07-27 14:45:35 +09:30
Toby Zerner
153a5b7ce4 PERF: avoid reinstantiation of event subscribers 2015-07-27 11:53:47 +09:30
Toby Zerner
c0d57fd399 PERF: further simplify User::hasPermission() 2015-07-27 11:20:18 +09:30
Toby Zerner
07b4a5125f PERF: cache the results of User::hasPermssion() 2015-07-27 11:17:21 +09:30
Toby Zerner
b04e7f96c8 Cache model dates 2015-07-27 10:59:24 +09:30
Toby Zerner
e5e737eca4 Update LESS variable names 2015-07-24 10:03:11 +09:30
Toby Zerner
ae3bbc1700 Replace duplicate tags instead of erroring 2015-07-23 20:29:39 +09:30
Toby Zerner
c1b12c7fc9 Extract emoticons, BBCode, and Markdown into extensions 2015-07-23 20:24:41 +09:30
Toby Zerner
cb3004b6de Various fixes to extension generator/stub 2015-07-23 20:24:28 +09:30
Toby Zerner
c8e6fbc338 Pass correct param to notification email views 2015-07-23 16:39:56 +09:30
Toby Zerner
8c6e87760c Docblock cleanup 2015-07-23 14:35:17 +09:30
Toby Zerner
53326e509c Number is a filter, not page param 2015-07-23 14:34:19 +09:30
Toby Zerner
5b54a122c9 Notification one-per-user limit should work between instances 2015-07-23 14:33:58 +09:30
Toby Zerner
6d57f902b3 Ensure we don't preload index data on non-index pages 2015-07-23 14:33:31 +09:30
Toby Zerner
b699bbadbc Make formatter extensible 2015-07-23 14:29:33 +09:30
Toby Zerner
34b7a2fbf6 Move locale files 2015-07-22 16:05:24 +09:30
Toby Zerner
8442f65cdf Fix post visibility scoping 2015-07-22 16:05:11 +09:30
Toby Zerner
017c258e46 Live preview of post editing/replying thanks to TextFormatter 👏 2015-07-22 16:05:00 +09:30
Toby Zerner
a0fe68272c Implement TextFormatter for posts
Get rid of formatting on user bios, we'll do that with JavaScript
2015-07-22 16:03:48 +09:30
Toby Zerner
6c50f1614b Group assets by client in extension stub 2015-07-22 10:12:11 +09:30
Toby Zerner
4fb292a777 Always use default includes when preloading discussion list
Making them explicit causes problems when extensions want to include
something by default (e.g. tags)
2015-07-22 10:11:23 +09:30
Toby Zerner
57f55c2dd6 Improve forum route registration API 2015-07-22 10:04:22 +09:30
Toby Zerner
c697c734d5 Don't run gambits if there's no search query 2015-07-22 09:57:52 +09:30
Toby Zerner
e1a51f095f Random cleanup 2015-07-22 09:57:25 +09:30
Toby Zerner
d410746c51 Fix new notifications on old subjects not appearing 2015-07-20 18:20:34 +09:30
Toby Zerner
c287d40072 Fix incorrect variable name 2015-07-20 18:10:11 +09:30
Toby Zerner
3820b8c65f Fix incorrect member visibility on event 2015-07-20 18:10:04 +09:30
Toby Zerner
605c56ce3c Update extension generator 2015-07-20 18:08:50 +09:30
Toby Zerner
6b7cf1b6bf Rework extension bootstrapping
System JS modules don't execute when they're registered, so we need to
import them explicitly. While we're at it, we may as well make the
locale bootstrapper a module too.
2015-07-20 18:08:28 +09:30
Toby Zerner
19fe138770 Change order of bootstrapping
See commit on flarum/flarum for explanation
2015-07-20 18:01:08 +09:30
Toby Zerner
57650fa648 Rework public API based on events 2015-07-18 22:59:47 +09:30
Toby Zerner
6ae270db95 Remove duplicates; replace missing commas 2015-07-17 17:47:53 +09:30
Toby Zerner
f93ff7cb3f Make front-end localizable 2015-07-17 17:43:28 +09:30
Toby Zerner
ea29bd42d8 Merge remote-tracking branch 'origin/master' 2015-07-17 15:05:03 +09:30
Toby Zerner
bc750c8694 Fix login action 2015-07-17 14:48:24 +09:30
Toby Zerner
e3bfa8e404 Fix notifications 2015-07-17 14:48:20 +09:30
Toby Zerner
6fa4d25a5b Fix forgot password action 2015-07-17 14:48:06 +09:30
Franz Liedke
fab9bdb0ef Remove unused import 2015-07-16 00:44:02 +02:00
Franz Liedke
48c5574c66 Try to fix some namespace imports 2015-07-16 00:43:49 +02:00
Franz Liedke
9af1519864 Rename import command 2015-07-16 00:38:27 +02:00
Franz Liedke
6b3a86dd87 Move extension loading to boot method
This will likely have to be reverted, to make things like $this->app->extend() work
reasonably well in extensions' service providers.

For now, since we fetch the enabled extensions from the config, there is no other way
for us to guarantee that the config is already available.
2015-07-16 00:36:14 +02:00
Franz Liedke
c2bf0b6b3a Inject SettingsRepository where possible 2015-07-16 00:32:50 +02:00
Franz Liedke
31e9f44dfb Rename caching setting repository implementation
I'm foreseeing another implementation that uses real caching (across requests).
2015-07-16 00:10:52 +02:00
Franz Liedke
6a7889934c Register database and cache implementations as binding for the settings repository 2015-07-15 23:54:56 +02:00
Franz Liedke
ba3fa73f16 Build a caching repository decorator for settings 2015-07-15 23:22:25 +02:00
Franz Liedke
8e9cf4fd2e Move settings repositories to own namespace
Also add a third method to the contract. This will help with building a caching decorator.
2015-07-15 23:16:57 +02:00
Toby Zerner
88b754ee8d Don't include deleted notifications in the unread count 2015-07-15 14:01:11 +09:30
Toby Zerner
0bb00e4eb2 Fix broken user activity syncer 2015-07-15 14:01:11 +09:30
Toby Zerner
ab6c03c0cc Massive JavaScript cleanup
- Use JSX for templates
- Docblock/comment everything
- Mostly passes ESLint (still some work to do)
- Lots of renaming, refactoring, etc.

CSS hasn't been updated yet.
2015-07-15 14:01:11 +09:30
Toby Zerner
42f1fa1272 Improve fulltext search API and interface 2015-07-07 20:35:18 +09:30
Toby Zerner
38c2ff0306 Finish client action refactoring. closes flarum/core#126 2015-07-07 19:23:13 +09:30
Toby Zerner
8a54b362c7 Add todos to document magic properties on models 2015-07-07 19:20:18 +09:30
Toby Zerner
54daad6e7d CSRF protection on logout action 2015-07-07 15:30:13 +09:30
Toby Zerner
99876e9e36 Initial refactor of client actions, data preloading, SEO
An initial stab at flarum/core#126. Still WIP. Preliminary
implementation of flarum/core#128 and flarum/core#13.
2015-07-07 15:29:21 +09:30
Toby Zerner
5fe88e448e Improve post stream
- Return all discussion post IDs from API requests which add/remove
posts, so the post stream updates appropriately. Related to #146
- Always unload posts that are two pages away, no matter how fast
you’re scrolling
- Retrieve posts from cache instead of reloading them
- Fix various bugs. Maybe #152, needs confirmation
2015-07-06 16:26:27 +09:30
Toby Zerner
01ec661c3f PSR-2 fixes 2015-07-05 21:46:57 +09:30
Toby Zerner
873088750f Remove Interface suffix from some classes 2015-07-05 12:30:23 +09:30
Toby Zerner
2cc619a998 Remove todo 2015-07-05 12:25:51 +09:30
Toby Zerner
53e269fd89 Extract model validation into a trait
Also use Laravel’s ValidationException rather than our own custom one
2015-07-05 12:25:08 +09:30
Toby Zerner
04501545e3 Move Group to its own namespace
We’ll need to add commands etc. for group management in the future
2015-07-04 19:30:58 +09:30
Toby Zerner
81170980e0 Don't error if trying to serialise a non-existent relationship 2015-07-04 18:39:43 +09:30
Toby Zerner
86811c6508 Get rid of Repository interfaces 2015-07-04 18:38:59 +09:30
Toby Zerner
f7b6d8a568 Merge 2015-07-04 12:28:50 +09:30
Toby Zerner
336c05e77a Clean up
Goddammit GitHub for Mac
2015-07-04 12:25:21 +09:30
Toby Zerner
a74b40fe47 Massive refactor
- Use contextual namespaces within Flarum\Core
- Clean up and docblock everything
- Refactor Activity/Notification blueprint stuff
- Refactor Formatter stuff
- Refactor Search stuff
- Upgrade to JSON-API 1.0
- Removed “addedPosts” and “removedPosts” relationships from discussion
API. This was used for adding/removing event posts after renaming a
discussion etc. Instead we should make an additional request to get all
new posts

Todo:
- Fix Extenders and extensions
- Get rid of repository interfaces
- Fix other bugs I’ve inevitably introduced
2015-07-04 12:24:48 +09:30
Franz Liedke
126039850a Some things should not be run when Flarum is not installed yet 2015-07-02 23:14:25 +02:00
Franz Liedke
12dd550a14 Add settings repository interface and database implementation.
Almost done with flarum/core#121 now.
2015-07-01 23:08:26 +02:00
Franz Liedke
03fd4a5aba Read debug mode from config 2015-07-01 22:49:38 +02:00
Franz Liedke
1e04a20220 Fix login
We cannot write to an empty response.
2015-07-01 22:45:14 +02:00
Franz Liedke
ccbebce93b Get rid of JsonApiResponse class
With the JSON-API library being updated, we can just make use of
Diactoros' JSON response class.
2015-07-01 20:58:14 +02:00
Toby Zerner
c1e7c00e2d Clean up some relation stuff 2015-07-01 22:35:56 +09:30
Toby Zerner
56932604db Refactor CoreServiceProvider
A good start I think, but still some work to do. If we go ahead with
https://github.com/flarum/core/issues/132#issuecomment-117507974 (which
I am in favour of), we can extract the entity-related stuff into some
smaller service providers (e.g. discussion repo, an event listener,
permissions, and gambits stuff could all go in
Flarum\Core\Discussions\DiscussionsServiceProvider).
2015-07-01 22:34:11 +09:30
Toby Zerner
d414ee33ed Make traits more generic
Type hinting User should take place in the callbacks. Theoretically
these traits could be used for another project now, where something
else has permissions (like a Sheep class, or a number)
2015-07-01 16:49:40 +09:30
Toby Zerner
810f79ee77 Cleanup, fix static date property error 2015-07-01 16:47:07 +09:30
Toby Zerner
d44b101373 Clean up merging stuff 2015-07-01 16:31:06 +09:30
Toby Zerner
3f32236379 API: allow date attributes to be added 2015-07-01 15:11:57 +09:30
Toby Zerner
c1595af84f Add todo about model validation 2015-07-01 13:35:27 +09:30
Toby Zerner
eafdd415ef Clean up model custom relation functionality 2015-07-01 13:22:09 +09:30
Toby Zerner
094825792a Clean up activity model 2015-07-01 13:19:24 +09:30
Franz Liedke
6e7cb1ff0e Some fixes to get along with the new bootstrapping 2015-06-30 23:29:52 +02:00
Franz Liedke
31effe943e Implement Android theme color support
As requested in the forums.
http://updates.html5rocks.com/2014/11/Support-for-theme-color-in-Chrome-39-for-Android
2015-06-26 23:11:13 +02:00
Franz Liedke
074f8087fa Update FastRoute
This enables optional route parameters.

Required some code changes in the RouteCollection class; once we
actually use optional route parameters, we will have to see whether
route generation for those works as expected.

Closes flarum/core#108
2015-06-26 23:09:58 +02:00
Franz Liedke
391c510f90 Upgrade Zend Diactoros to 1.1
This gives us a bunch of handy helper classes for empty responses,
redirects, HTML and JSON content types.

Closes flarum/core#153
2015-06-26 22:38:43 +02:00
Toby Zerner
558d12c870 Search API tweaks
Rename some methods, include a mechanism for gambit negation.
Also always include the relevant posts in results. closes
flarum/core#111
2015-06-26 12:20:43 +09:30
Toby Zerner
bdd7e43e5a Notification API tweaks 2015-06-26 12:18:53 +09:30