-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Hasan Özbey
committed
Jun 27, 2021
1 parent
53b9b86
commit cb3285c
Showing
32 changed files
with
5,927 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
### 0.1.0 | ||
First release. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,29 @@ | ||
flarum-miserable-users | ||
|
||
# Miserable Users | ||
|
||
[![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/the-turk/flarum-miserable-users/blob/master/LICENSE) [![Latest Stable Version](https://img.shields.io/packagist/v/the-turk/flarum-miserable-users.svg)](https://packagist.org/packages/the-turk/flarum-miserable-users) [![Total Downloads](https://img.shields.io/packagist/dt/the-turk/flarum-miserable-users.svg)](https://packagist.org/packages/the-turk/flarum-miserable-users) | ||
|
||
Make the browsing experience of problematic users as frustrating as possible. | ||
|
||
Running a community forum like the discuss? Kylo got your back, brothers. Show them no mercy. Do some nasty redirections, if you know what I mean 😏 | ||
|
||
![](https://i.imgur.com/3SR6lQ8.png) | ||
|
||
- [Sample miserable user](https://i.imgur.com/GylCEKY.png) | ||
- [Control modal](https://i.imgur.com/bHIVVWJ.png) | ||
- [Sample broken page](https://i.imgur.com/wpcqW0K.png) | ||
|
||
**Note:** "Miserable User" badge will (hopefully) only show up to users those can class others as miserables, no worries. 😂 | ||
|
||
## Installation | ||
|
||
```bash | ||
composer require the-turk/flarum-miserable-users | ||
``` | ||
|
||
## Links | ||
|
||
- [Source code on GitHub](https://github.com/the-turk/flarum-miserable-users) | ||
- [Changelog](https://github.com/the-turk/blob/master/CHANGELOG.md) | ||
- [Report an issue](https://github.com/the-turk/flarum-miserable-users/issues) | ||
- [Download via Packagist](https://packagist.org/packages/the-turk/flarum-miserable-users) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"name": "the-turk/flarum-miserable-users", | ||
"description": "Make the browsing experience of problematic users as frustrating as possible.", | ||
"keywords": [ | ||
"flarum", | ||
"miserable", | ||
"user", | ||
"management", | ||
"ban" | ||
], | ||
"type": "flarum-extension", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Hasan Özbey", | ||
"email": "[email protected]", | ||
"homepage": "https://github.com/the-turk" | ||
} | ||
], | ||
"support": { | ||
"issues": "https://github.com/the-turk/flarum-miserable-users/issues", | ||
"source": "https://github.com/the-turk/flarum-miserable-users" | ||
}, | ||
"require": { | ||
"flarum/core": "^1.0.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"TheTurk\\Miserable\\": "src/" | ||
} | ||
}, | ||
"replace":{ | ||
"the-turk/flarum-miserable-users": "*" | ||
}, | ||
"extra": { | ||
"flarum-extension": { | ||
"title": "Miserable Users", | ||
"category": "feature", | ||
"icon": { | ||
"name": "far fa-sad-cry", | ||
"backgroundColor": "#b72a2a", | ||
"color": "#fff" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the-turk/flarum-miserable-users. | ||
* | ||
* Copyright (c) 2020 Hasan Özbey | ||
* | ||
* LICENSE: For the full copyright and license information, | ||
* please view the LICENSE file that was distributed | ||
* with this source code. | ||
*/ | ||
|
||
namespace TheTurk\Miserable; | ||
|
||
use Flarum\Extend; | ||
|
||
use TheTurk\Miserable\Access\UserPolicy; | ||
use TheTurk\Miserable\AddUserMiserableAttributes; | ||
use TheTurk\Miserable\AddCurrentUserMiserableAttributes; | ||
use TheTurk\Miserable\Listener; | ||
use TheTurk\Miserable\Query\MiserableFilterGambit; | ||
use Flarum\Api\Serializer\UserSerializer; | ||
use Flarum\Api\Serializer\CurrentUserSerializer; | ||
use Flarum\User\Event\Saving; | ||
use Flarum\User\Filter\UserFilterer; | ||
use Flarum\User\Search\UserSearcher; | ||
use Flarum\User\User; | ||
use Flarum\Post\Event\Saving as PostSaving; | ||
|
||
return [ | ||
(new Extend\Frontend('forum')) | ||
->css(__DIR__.'/less/forum.less') | ||
->js(__DIR__.'/js/dist/forum.js'), | ||
|
||
(new Extend\Frontend('admin')) | ||
->css(__DIR__.'/less/admin.less') | ||
->js(__DIR__.'/js/dist/admin.js'), | ||
|
||
(new Extend\Locales(__DIR__.'/locale')), | ||
|
||
(new Extend\Model(User::class)) | ||
->dateAttribute('miserable_until'), | ||
|
||
(new Extend\ApiSerializer(UserSerializer::class)) | ||
->attributes(AddUserMiserableAttributes::class), | ||
|
||
(new Extend\ApiSerializer(CurrentUserSerializer::class)) | ||
->attributes(AddCurrentUserMiserableAttributes::class), | ||
|
||
(new Extend\Event()) | ||
->listen(Saving::class, Listener\SaveMiserableToDatabase::class) | ||
->listen(PostSaving::class, Listener\SetFakeFloodings::class), | ||
|
||
(new Extend\Policy()) | ||
->modelPolicy(User::class, UserPolicy::class), | ||
|
||
(new Extend\Filter(UserFilterer::class)) | ||
->addFilter(MiserableFilterGambit::class), | ||
|
||
(new Extend\Settings()) | ||
->serializeToForum('miserable_users.loading_delay_min', 'the-turk-miserable-users.loading_delay_min') | ||
->serializeToForum('miserable_users.loading_delay_max', 'the-turk-miserable-users.loading_delay_max') | ||
->serializeToForum('miserable_users.broken_page_chance', 'the-turk-miserable-users.broken_page_chance') | ||
->serializeToForum('miserable_users.redirection_page_url', 'the-turk-miserable-users.redirection_page_url') | ||
->serializeToForum('miserable_users.redirection_chance', 'the-turk-miserable-users.redirection_chance') | ||
->serializeToForum('miserable_users.log_out_chance', 'the-turk-miserable-users.log_out_chance'), | ||
|
||
(new Extend\SimpleFlarumSearch(UserSearcher::class)) | ||
->addGambit(MiserableFilterGambit::class) | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"printWidth": 150, | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"trailingComma": "es5" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './src/admin'; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.