mirror of
https://github.com/filegator/filegator.git
synced 2025-08-15 14:54:17 +02:00
WordPress adapter included in the main repo
This commit is contained in:
@@ -58,13 +58,38 @@ At the end, open `configuration.php` and update AuthInterface handler to reflect
|
||||
],
|
||||
```
|
||||
|
||||
## Custom Authentication using 3rd party (WordPress or similar)
|
||||
## Configuring Auth service to use WordPress
|
||||
|
||||
Replace your current Auth handler in `configuration.php` file like this:
|
||||
|
||||
```
|
||||
'Filegator\Services\Auth\AuthInterface' => [
|
||||
'handler' => '\Filegator\Services\Auth\Adapters\WPAuth',
|
||||
'config' => [
|
||||
'wp_dir' => '/var/www/my_wordpress_site/',
|
||||
'permissions' => ['read', 'write', 'upload', 'download', 'batchdownload', 'zip'],
|
||||
'private_repos' => false,
|
||||
],
|
||||
],
|
||||
```
|
||||
Adjust in the config above:
|
||||
- `wp_dir` should be the directory path of your wordpress installation
|
||||
- `permissions` is the array of permissions given to each user
|
||||
- `private_repos` each user will have its own sub folder, admin will see everything (false/true)
|
||||
|
||||
Note: With more recent versions of FileGator you can set `guest_redirection` in your `configuration.php` to redirect logged-out users back to your WP site:
|
||||
```
|
||||
'frontend_config' => [
|
||||
...
|
||||
'guest_redirection' => 'http://example.com/wp-admin/',
|
||||
...
|
||||
]
|
||||
```
|
||||
|
||||
## Custom Authentication using 3rd party
|
||||
|
||||
If you want to use FileGator as a part of another application, you probably already have users stored somewhere else. What you need in this case is to build a new custom Auth adapter that matches the [AuthInterface](https://github.com/filegator/filegator/blob/master/backend/Services/Auth/AuthInterface.php) to connect those two. This new adapter will try to authenticate users in your application and translate each user into filegator [User](https://github.com/filegator/filegator/blob/master/backend/Services/Auth/User.php) object.
|
||||
|
||||
You can look at this simple [WordPress auth adapter](https://github.com/filegator/wp_auth_adapter) to see how all this works.
|
||||
|
||||
|
||||
## API authentication
|
||||
|
||||
Front-end will use session based authentication to authenticate and consume the back-end.
|
||||
|
@@ -23,7 +23,7 @@ File upload supports drag&drop, progress bar, pause and resume. Upload is chunke
|
||||
|
||||
## Features & Goals
|
||||
- Multiple storage adapters (Local, FTP, Amazon S3, Dropbox, DO Spaces, Azure Blob and many others via [Flysystem](https://github.com/thephpleague/flysystem))
|
||||
- Multiple auth adapters with roles and permissions (Store users in json file or database)
|
||||
- Multiple auth adapters with roles and permissions (Store users in json file, database or use WordPress)
|
||||
- Multiple session adapters (Native File, Pdo, Redis, MongoDB, Memcached and others via [Symfony](https://github.com/symfony/symfony/tree/4.4/src/Symfony/Component/HttpFoundation/Session/Storage/Handler))
|
||||
- Single page front-end (built with [Vuejs](https://github.com/vuejs/vue), [Bulma](https://github.com/jgthms/bulma) and [Buefy](https://github.com/buefy/buefy))
|
||||
- Chunked uploads (built with [Resumable.js](https://github.com/23/resumable.js))
|
||||
|
Reference in New Issue
Block a user