Files Gallery 0.12.0
Following the release of multi-user login support, this release completes user logins with a settings editor, user manager and several new login features. See the new User Logins documentation.
See demo
Settings Editor and User Manager
The new settings editor and user manager allows you to edit settings and create users directly from the Files Gallery interface. This means you no longer need to edit config files or create users manually. New config option allow_settings allows the user to edit settings and create new users.
New Login Features
- Login page is now translated [forum]
- Login "ping" every 60 seconds that checks if user is still logged in, and shows login form if not.
- New Javascript config login options for login buttons, "ping" and
on_logout
event. - New
data-username="{USERNAME}"
in<body>
can be used for per-user CSS styling. - Optional user-specific custom CSS
_files/users/{USERNAME}/css/custom.css
- Fixed so that login button always appears in topbar if there is login [forum]
- Remove
?logout=1
in url on logout to prevent logging out from browser back button [forum]
Install Mode
New convenient install mode allows you to edit settings and create users directly from the interface simply by naming the file install.php
. This is useful when you are installing Files Gallery and want to edit settings or create users upfront without having to edit config files manually.
- Rename the file
install.php
and run in browser. - Edit settings, save license key and/or create users as required.
- Rename the file back to
index.php
when you are done.
More Features
- New index_cache config option allows creating
index.html
cache for faster initial load Beta - New files_include and dirs_include config options to include only certain files and folders.
- New Javascript config option
map_link
allows assinging GPS map link template. - Fixed issue where inline PDF's seem to load multiple times, causing failure in Safari [forum]
- Fixed so that upload watermark option displays when only
allow_all
is enabled [forum] - Included license attribution files for 3rd-party plugins when using self-hosted assets.
- Added support for mjml files (XML) [forum]
- Fixed so FFmpeg commands use
escapeshellcmd()
to avoid potential exploits [github] - Config start_path now accepts paths relative to
root
which should be most logical.
New Config Options
The following new PHP config options have been added.
// PHP regex to include and display only certain file names and extensions. When populated, only files that match the regex will display. The regex is tested on the file name (basename) without the full path. You can test regular expressions at phpliveregex.com.
'files_include' => '', // empty (default) all files are included
'files_include' => '/\.(pdf|jpe?g)$/i', // include only file extensions pdf, jpg and jpeg (hide all other files) / case insensitive
// PHP regex to include and display only certain directories. When populated, only dirs that match the regex will display. The regex is tested on the folder path relative to the root. You can test regular expressions at phpliveregex.com.
'dirs_include' => '', // empty (default) all dirs are included
'dirs_include' => '/^(public|photos|documents)(\/|$)/', // include only public, photos and documents dirs in the root folder
// Allows editing config options and managing users directly from the interface. *This option should only be enabled for trusted admin users.
'allow_settings' => false, // true | false
// Special option that allows caching the response from index.php as index.html. This will speed up response time on load, and may be useful for static galleries that don't change often. To publish index.html, trigger index.php?create_index_cache=mypassphrase from browser every time you make a change. *Only use this option if your default gallery is public (non-login).
'index_cache' => false, // false | 'passphrase'
New Javascript Options
The following new Javascript options have been added.
// GPS map link template / Google default / optional https://www.openstreetmap.org/?#map=15/{latitude}/{longtitude}
map_link: 'https://www.google.com/maps/search/?api=1&query={latitude},{longtitude}',
// login-related options
login: {
login_button: true, // display login button in topbar if there is login and user is not already logged in
logout_button: true, // display logout button in topbar if user is logged in
ping: 60, // ping server every x seconds to check login status and trigger `on_logout` if logged out
on_logout: 'form', // show login form on logout | 'refresh', 'form', 'toast', false
}
// options related to the settings editor when `'allow_settings' => true`
settings_editor: {
show_button: true, // show settings button in topbar / if disabled, must use ?settings=1
allow_default: true, // allow editing 'default' config settings
allow_users: true, // allow managing users
allow_new: true, // allow adding new users
allow_remove: true, // allows removing users
allow_rename: true, // allows renaming existing users
select_current_user_append: ' ←', // append to current user in selection dropdown to identify current user
reload: true, // true / 'close' / false // reload browser if default or current user changes
reload_confirm: false, // false / 'Refresh required. Reload page now?' / true
// new user config template (include mostly useful options to override default config)
template: `<?php
// CONFIG / https://www.files.gallery/docs/config/
return [
//'root' => '',
//'start_path' => '',
'password' => '$PASSWORD',
//'allow_all' => false,
//'files_exclude' => '',
//'dirs_exclude' => '',
//'upload_allowed_file_types' => '',
];`,
},
How to update?
Simply download latest Files Gallery index.php
or see the update docs.