Commit Graph

27 Commits

Author SHA1 Message Date
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
5382d0ce1a Remove unused import 2015-09-29 01:31:34 +02:00
295f29e53e Make linter happy 2015-09-29 01:31:09 +02:00
040ce52724 Return both unread and new notification count from the API
Related to #500.
2015-09-29 01:28:47 +02:00
68369ac5bb heavier validation for username 2015-09-24 23:07:30 +02:00
8937050aed Rename column for consistency 2015-09-22 16:54:32 +09:30
ece23de750 API: Add User::hasPermissionLike() and User::getPermissions() 2015-09-04 12:23:50 +09:30
0413daab74 call to $this-> assertValidPassword from static context 2015-09-04 00:00:24 +02:00
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
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
559110a83f Coding standards 2015-08-27 01:40:18 +02:00
0b8aa5c124 Add header comment; PSR-2 fixes; remove seeders 2015-08-26 16:56:32 +09:30
34d4a7ed89 Fix Laravel 5.1 compat 2015-08-14 12:50:32 +09:30
8aafce5fd8 Fix Laravel 5.1 compat 2015-08-13 10:41:17 +09:30
42e382045a API: Add event for determining user groups for permissions 2015-08-05 16:06:55 +09:30
f42c3cd1ed Allow admins to delete users 2015-08-05 12:08:28 +09:30
6641af3ac3 Refactor some model stuff out into traits 2015-07-31 20:09:31 +09:30
c0d57fd399 PERF: further simplify User::hasPermission() 2015-07-27 11:20:18 +09:30
07b4a5125f PERF: cache the results of User::hasPermssion() 2015-07-27 11:17:21 +09:30
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
57650fa648 Rework public API based on events 2015-07-18 22:59:47 +09:30
88b754ee8d Don't include deleted notifications in the unread count 2015-07-15 14:01:11 +09:30
38c2ff0306 Finish client action refactoring. closes flarum/core#126 2015-07-07 19:23:13 +09:30
8a54b362c7 Add todos to document magic properties on models 2015-07-07 19:20:18 +09:30
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
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
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