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

320 Commits

Author SHA1 Message Date
Tristian Kelly
818a100625 feat: add delete own posts permission (#3784) 2023-04-17 08:53:51 +01:00
Sami Mazouz
8372363cc2 feat: conditional extenders (#3759) 2023-03-14 21:53:16 +01:00
Sami Mazouz
3af0481f30 test: remove use of deprecated phpunit assertion
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-03-06 15:03:33 +01:00
Sami Mazouz
fa30f4f250 fix(regression): cannot delete users (#3746)
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-02-24 18:22:12 +01:00
Sami Mazouz
bbf873442a feat: global logout to clear all sessions, access tokens, email tokens and password tokens (#3605)
* chore: re-organize security locale keys alphabetically
* test: can globally logout
* feat: add global logout controller
* feat: add global logout UI to user security page
* test: re-adapt tests to changes
* feat: add boolean to indicate if logout even is global
* chore(review): split loading property
* chore: follow-up branch update

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-02-21 15:28:55 +01:00
Sami Mazouz
9342903d68 feat: access tokens user management UI (#3587)
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
Co-authored-by: David <hi@davwheat.dev>
2023-02-21 14:14:53 +01:00
IanM
1ee5cf6ba9 feat(core): PHP 8.2 Support (#3709)
* chore: test with php 8.2
* chore: bump httphandlerunnder
* chore: bump httphandlerunner
* chore: address php8.2 deprecation
* chore: php 8.2
* chore: bump less.php version
* avoid dynamic properties
* avoid another dynamic property
* Apply fixes from StyleCI
* tags php82
* php82
* fix: check for property existence
* Rerun checks after s9e/text-formatter update
* chore: disable deprecation warnings for php 8.2
* chore: PHP8.2 does not accept dynamic properties
* chore: temporarily disable package manager tests workflow

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2023-02-14 19:09:56 +01:00
Sami Mazouz
5fe3cfd837 feat(phpstan): foundation for usage in extensions (#3666)
* feat(phpstan): pick up extended model relations typings
* feat(phpstan): pick up extended model date attributes
* feat(core): introduce `castAttribute` extender
Stops using `dates` as it's deprecated in laravel 8
* feat(phpstan): pick up extended model attributes through casts
* fix: extenders not resolved when declared namespace
* fix(phpstan): new model attributes are always nullable
* chore(phpstan): add helpful cache clearing command
* Apply fixes from StyleCI
* chore: improve extend files provider logic
* chore: rename `castAttribute` to just `cast`
* chore: update phpstan package to detect `cast` method
* Update framework/core/src/Extend/Model.php

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-01-15 15:25:13 +01:00
Sami Mazouz
4a38047bfb Merge branch 'main' into merge-1.6.3-into-main 2023-01-13 19:12:11 +01:00
Sami Mazouz
666223fa8c test: make data providers public
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-01-10 15:00:38 +01:00
Sami Mazouz
12dfcc5c79 Merge pull request from GHSA-hph3-hv3c-7725
* test: add reply creation tests

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: access checking being bypassed for post creation when first post is deleted

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chore: recover tests

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chore: make provider public

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-01-10 15:00:38 +01:00
StyleCI Bot
248a71d9b5 Apply fixes from StyleCI 2023-01-10 15:00:37 +01:00
Sami Mazouz
a131e87911 Merge pull request from GHSA-8gcg-vwmw-rxj4
* fix: notifications grant access to private data of posts

* chore: fix tests

* test: start with tests about notification subject visibility

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: check subject access before sending notification to user

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: Daniël Klabbers <daniel@klabbers.email>
2023-01-10 15:00:37 +01:00
IanM
67c0d75ebc feat: include current user as forum relation (#3668)
* feat: include current user as forum relation

* Update framework/core/src/Api/Controller/ShowForumController.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* Update framework/core/src/Api/Controller/ShowForumController.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* Update framework/core/src/Api/Serializer/ForumSerializer.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* Update framework/core/tests/integration/api/forum/ShowTest.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* Update framework/core/tests/integration/api/forum/ShowTest.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* No need to call the user endpoint as we already have the data loaded

* chore: return types

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2022-11-25 11:00:19 +00:00
Sami Mazouz
f0a867b20f chore: throw an exception when no serializer is provided to the controller (#3614)
* chore: throw an exception when no serializer is provided to the controller

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>

* test: no serializer set throws exception

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-11-06 18:56:07 +00:00
Sami Mazouz
f6761843b2 feat: customizable session driver (#3610) 2022-09-14 18:10:30 +01:00
Sami Mazouz
84c31165e5 fix: password reset leaks user existence (#3616) 2022-09-14 15:57:52 +01:00
Sami Mazouz
f7dd609b26 feat: discussion UTF-8 slug driver (#3606)
* feat: add utf-8 slug driver
* test: add tests for slugging expectations
* fix: non-word characters aren't removed

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
Co-authored-by: Alexander Skvortsov <sasha.skvortsov109@gmail.com>
2022-08-21 15:27:41 +01:00
Sami Mazouz
25122fd355 fix: user has wrong discussion read status (#3591)
* test: deleting last post(s) then posting new replies works as expected
* fix: user has wrong discussion read status
2022-08-09 22:43:38 +02:00
Ian Morland
d02bf0faa1 feat: Delete all notifications (#3529)
* Add delete all notifications option
* chore: `DELETE /api/notifications` as per conventions
* test: can delete all notifications

Co-authored-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-08-08 19:26:16 +01:00
Sami Mazouz
4b25c2d425 test: relying on a third-party for avatar URL tests is unreliable (#3586) 2022-08-05 19:24:43 +01:00
Sami Mazouz
2b31b185e4 feat: clear password & email tokens when appropriate (#3567)
* test: password tokens are generated and deleted on password change
* chore: delete all password tokens when the password is changed
* test: email tokens are generated and deleted on email change
* test: email tokens are deleted after password reset
* chore: delete email tokens after password change
* test: password tokens are deleted after email change
* chore: delete password tokens after email change
* chore: syntactic sugar
* chore: unify event listening
2022-07-30 13:02:06 +01:00
Sami Mazouz
f610f8aa67 feat: throttle email change, email confirmation, and password reset endpoints. (#3555)
* chore: move post throttler to separate class
* feat: throttle email change requests
* feat: throttle email activation requests
* feat: throttle password resets for logged-in users
* docs: comment new throttlers
2022-07-30 08:18:51 +02:00
David Wheatley
bf6f63cfe1 feat: extender to add custom less variables (#3530) 2022-07-14 13:04:38 +01:00
Sami Mazouz
eb4bac3b8f fix: settings extender working only with first instances (#3439)
* test: settings extender works not only with first extender instance
* fix: settings extender working only with first instances
2022-05-24 17:55:05 +01:00
Daniël Klabbers
57d3c9a99a chore: simplify container binding
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2022-05-13 21:22:22 +02:00
Daniël Klabbers
999b345db1 chore: simplify container resolving of settings
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2022-05-13 21:22:22 +02:00
Daniël Klabbers
5e2f952fe6 fix: update test to reflect changes to slug transliteration 2022-05-13 21:22:22 +02:00
Daniël Klabbers
899b931b89 chore: add tests 2022-05-13 21:22:22 +02:00
Alexander Skvortsov
ffc9f9f5a4 fix(core): don't pass null to functions where that's deprecated (#3405)
Should fix remaining PHP 8.1 deprecation warnings/
2022-04-24 16:26:18 -04:00
Sami Mazouz
fb717db57c fix: slug transliteration assuming the language is always en (#3387)
* fix: transliteration assuming the language is always `en`
* test: transliteration works with forum locale
2022-04-16 11:31:23 +01:00
Sami Mazouz
6de1ea0194 fix: languages with combining characters cannot be searched (#3385)
* test: searching other types of languages
* fix: languages with combining characters cannot be searched
* test: can search in discussion titles
2022-04-09 23:04:15 +01:00
Alexander Skvortsov
431ba30434 fix: dont ignore optional dependencies on disabled extensions. (#3352)
There is a check in the ExtensionManager::resolveExtensionOrder function that ignores optional dependencies on extensions that don't exist in the system. This is sufficient for resolution purposes.

The filter removed in this PR would ignore optional dependencies on non-enabled extensions, so when such an extension was enabled, dependency resolution would run incorrectly.
2022-04-06 11:48:52 -04:00
Alexander Skvortsov
e25c53c00f fix: canonicalize comparisons in Posts ListTest
That doesn't matter since there's no default sort for posts in the backend.
2022-03-31 08:46:20 +02:00
Alexander Skvortsov
b0395b3eb7 chore: flarum-cli audit infra --fix 2022-01-27 16:45:10 -05:00
Alexander Skvortsov
22f8c44b4d Use v1.0.0 of backend testing properly (#3247) 2022-01-03 16:04:17 -05:00
Sami Mazouz
fbb1d95557 fix: Until reply renaming permission of discussions broken in php 8 (#3243)
* test: `until reply` rename discussion ability
* fix: `Until reply` renaming of discussions broken in php 8
2021-12-31 20:19:26 +01:00
David Wheatley
d60f1953f1 perf: only update last time when current value outdated (#3230)
* perf: only update last seen time when current > 120s ago

* perf: only update `last_activity_at` every 2 mins

* docs: add comment

* fix: add missing param

* test: add tests

* tests: attempt tests fix

* fix(tests): call `$this->app()`

* chore: extract hard-coded values out to private consts

* chore: increase diff

* Apply suggestions from code review
2021-12-28 00:39:42 +01:00
David Wheatley
fbaf936e7e feat: allow replacing of blade template namespaces via extender (#3167)
* feat: allow replacing of blade template namespaces

* wip: add `prependNamespace` support

* test: add replace namespace test

* Apply fixes from StyleCI

[ci skip] [skip ci]

* fix: add missing property

* test: add prepend test

* fix: add view namespaces before resolving

Allows `replaceNamespace()` extender to actually remove old routes.

* test: make replace test ensure that replaced view does not exist

* docs: update docblock

* Apply fixes from StyleCI

[ci skip] [skip ci]

* fix: missing `\` before class

* fix: change test view namespace

* chore: simplify test

* Remove replace namespace code

We only really need prepend.

* chore: rename extender

* ci: add override test

* Apply fixes from StyleCI

[ci skip] [skip ci]

* fix(tests): add `trim` call

* revert: 3d46ead14b

Co-authored-by: luceos <luceos@users.noreply.github.com>
2021-12-20 09:56:48 +01:00
David Wheatley
fbfc80f979 feat: add Less custom function extender, is-extension-enabled function (#3190)
Co-authored-by: luceos <luceos@users.noreply.github.com>
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2021-12-14 19:25:39 +00:00
Alexander Skvortsov
b6e7fad8df Fix test cases for SetSettingsController 2021-11-16 16:54:23 -05:00
Alexander Skvortsov
80833d154f Apply fixes from StyleCI
[ci skip] [skip ci]
2021-11-16 21:50:53 +00:00
Alexander Skvortsov
28d6471877 Add integration tests for settings API endpoint 2021-11-16 16:48:09 -05:00
Sami Mazouz
029e34bfd7 feat: Use an extensible document title driver implementation (#3109)
* feat: Use an extensible document title driver implementation
* chore: Add todo to use DI in 2.0
2021-11-08 23:15:32 +01:00
Clark Winkelmann
ef9db0655a Fix post policy for PHP 8 (#3145)
* Add tests to verify post policy works as intended
* Fix "reply" post edit setting not working on PHP 8

Fixes #3144
2021-11-01 16:38:21 -04:00
Sami Mazouz
e8ffdead39 feat: Allow registering settings as Less config vars through Settings Extender (#3011)
Co-authored-by: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
2021-11-01 15:41:19 +01:00
Sami Mazouz
62b92ba02e feat: Create loadWhere relations extender (#3116) 2021-11-01 10:45:02 +01:00
Sami Mazouz
ba493a90c1 feat: Default Settings Extender (#3127)
Co-authored-by: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
2021-10-31 21:09:06 +01:00
MatusMak
f508c829db #2492 - Groups filtering & retrieve single endpoint (#3084)
Fixes #2492

* Added api/groups/{id} endpoint for retrieving a single group by its id
* Fixed GroupRepository incorrectly opening query to User instead of Group model
* Added filtering & paging abilities to GET api/groups endpoint
* Added test for sorting for GET api/groups endpoint

Co-authored-by: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
2021-10-25 11:48:25 -04:00
Alexander Skvortsov
16aeed9689 Throw error if required route params missing (#3118)
Co-authored-by: Daniël Klabbers <daniel@klabbers.email>
Co-authored-by: luceos <luceos@users.noreply.github.com>
Co-authored-by: David Wheatley <hi@davwheat.dev>
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2021-10-23 14:05:47 -04:00