diff --git a/configuration/auth.html b/configuration/auth.html index 371f497..57f0f9d 100644 --- a/configuration/auth.html +++ b/configuration/auth.html @@ -169,9 +169,30 @@ VALUES 'database' => 'filegator', ], ], -
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 installationpermissions
is the array of permissions given to each userprivate_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/',
+ ...
+]
+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 to connect those two. This new adapter will try to authenticate users in your application and translate each user into filegator User object.
-You can look at this simple WordPress auth adapter to see how all this works.
Front-end will use session based authentication to authenticate and consume the back-end.
Note: The application will not work if you disable cookies.
diff --git a/configuration/basic.html b/configuration/basic.html index 06910c7..fcb2de8 100644 --- a/configuration/basic.html +++ b/configuration/basic.html @@ -144,6 +144,7 @@ 'default_archive_name' => 'archive.zip', 'editable' => ['.txt', '.css', '.js', '.ts', '.html', '.php'], 'date_format' => 'YY/MM/DD hh:mm:ss', // see: https://momentjs.com/docs/#/displaying/format/ + 'guest_redirection' => '', // useful for external auth adapters ],You can add additional html to the head and body like this:
diff --git a/index.html b/index.html index 94cd68b..992d417 100644 --- a/index.html +++ b/index.html @@ -145,7 +145,7 @@