diff --git a/CHANGELOG.md b/CHANGELOG.md index 08db6c0..dbfc454 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v2.3.1 ++ Fixed en lang. ++ Fixed forced background with dark themes. + ## v2.3 + Improved image scaling in user gallery. + Added overlay on user gallery images. diff --git a/app/Controllers/DashboardController.php b/app/Controllers/DashboardController.php index bc3be8a..661cc40 100644 --- a/app/Controllers/DashboardController.php +++ b/app/Controllers/DashboardController.php @@ -129,6 +129,9 @@ class DashboardController extends Controller public function applyTheme(Request $request, Response $response): Response { file_put_contents('static/bootstrap/css/bootstrap.min.css', file_get_contents($request->getParam('css'))); - return redirect($response, 'system')->withAddedHeader('Cache-Control', 'no-cache, must-revalidate'); + return redirect($response, 'system') + ->withAddedHeader('Cache-Control', 'no-cache, no-store, must-revalidate') + ->withAddedHeader('Pragma', 'no-cache') + ->withAddedHeader('Expire', '0'); } } \ No newline at end of file diff --git a/app/Web/Session.php b/app/Web/Session.php index 1fd58f3..ae8497c 100644 --- a/app/Web/Session.php +++ b/app/Web/Session.php @@ -10,14 +10,18 @@ class Session * Start a session if is not already started in the current context * @param string $name * @param string $path + * @throws \Exception */ public static function init(string $name, $path = ''): void { if (session_status() === PHP_SESSION_NONE) { + if (!is_writable($path) && $path !== '') { + throw new \Exception("The given path '{$path}' is not writable."); + } session_start([ 'name' => $name, 'save_path' => $path, - 'cookie_httponly' => true + 'cookie_httponly' => true, ]); } } diff --git a/install/index.php b/install/index.php index b6330eb..00e6368 100644 --- a/install/index.php +++ b/install/index.php @@ -27,7 +27,7 @@ $container = new Container(['settings' => $config]); Session::init('xbackbone_session'); $container['view'] = function ($container) use (&$config) { - $view = new \Slim\Views\Twig(__DIR__ . '/templates', [ + $view = new \Slim\Views\Twig([__DIR__ . '/templates', __DIR__ . '/../resources/templates'], [ 'cache' => false, 'autoescape' => 'html', 'debug' => $config['displayErrorDetails'], @@ -137,9 +137,13 @@ $app->post('/', function (Request $request, Response $response) use (&$config) { $dsn = $config['db']['connection'] === 'sqlite' ? __DIR__ . '/../' . $config['db']['dsn'] : $config['db']['dsn']; - DB::setDsn($config['db']['connection'] . ':' . $dsn, $config['db']['username'], $config['db']['password']); + try { + DB::setDsn($config['db']['connection'] . ':' . $dsn, $config['db']['username'], $config['db']['password']); - migrate($config); + migrate($config); + } catch (PDOException $exception) { + + } if (!$installed) { DB::query("INSERT INTO `users` (`email`, `username`, `password`, `is_admin`, `user_code`) VALUES (?, 'admin', ?, 1, ?)", [$request->getParam('email'), password_hash($request->getParam('password'), PASSWORD_DEFAULT), substr(md5(microtime()), rand(0, 26), 5)]); diff --git a/resources/lang/en.lang.php b/resources/lang/en.lang.php index 25058db..b49fc1c 100644 --- a/resources/lang/en.lang.php +++ b/resources/lang/en.lang.php @@ -2,4 +2,86 @@ return [ + 'lang' => 'English', + + 'yes' => 'Yes', + 'no' => 'No', + 'send' => 'Send', + 'no_media' => 'No media found.', + + 'login.username' => 'Username or E-Mail', + 'password' => 'Password', + 'login' => 'Login', + 'username' => 'Username', + + 'home' => 'Home', + 'users' => 'Users', + 'system' => 'System', + 'profile' => 'Profile', + 'logout' => 'Logout', + + 'pager.next' => 'Next', + 'pager.previous' => 'Previous', + + 'copy_link' => 'Copy link', + 'public.telegram' => 'Share on Telegram', + 'public.delete_text' => 'Are you sure you want to delete this item? It will be gone forever!', + + 'preview' => 'Preview', + 'filename' => 'Filename', + 'size' => 'Size', + 'public' => 'Public', + 'owner' => 'Owner', + 'date' => 'Date', + 'raw' => 'Show raw', + 'download' => 'Download', + 'delete' => 'Delete', + 'publish' => 'Publish', + 'hide' => 'Hide', + + 'files' => 'Files', + 'orphaned_files' => 'Orphaned Files', + 'theme' => 'Theme', + 'click_to_load' => 'Click to load...', + 'apply' => 'Apply', + 'save' => 'Save', + 'used' => 'Used', + 'system_info' => 'System Information', + + 'user.create' => 'Create User', + 'user.edit' => 'Edit User', + 'is_active' => 'Is active', + 'is_admin' => 'Is administrator', + 'your_profile' => 'Your Profile', + 'token' => 'Token', + 'copy' => 'Copy', + 'update' => 'Update', + 'edit' => 'Edit', + 'client_config' => 'Client Configuration', + 'user_code' => 'User Code', + 'active' => 'Active', + 'admin' => 'Admin', + 'reg_date' => 'Registration Date', + 'none' => 'None', + 'open' => 'Open', + 'confirm' => 'Confirmation', + 'confirm_string' => 'Are you sure?', + + 'installed' => 'Installation completed successfully!', + 'bad_login' => 'Wrong credentials.', + 'account_disabled' => 'Your account is disabled.', + 'welcome' => 'Welcome, %s!', + 'goodbye' => 'Goodbye!', + 'token_not_found' => 'Token specified not found.', + 'email_required' => 'The email is required.', + 'email_taken' => 'The email is already taken.', + 'username_required' => 'The username is required.', + 'username_taken' => 'The username is already taken.', + 'password_required' => 'The password is required.', + 'user_created' => 'User "%s" created!', + 'user_updated' => 'User "%s" updated!', + 'profile_updated' => 'Profile updated successfully!', + 'user_deleted' => 'User deleted.', + 'cannot_delete' => 'You cannot delete yourself.', + 'cannot_demote' => 'You cannot demote yourself.', ]; \ No newline at end of file diff --git a/resources/templates/auth/login.twig b/resources/templates/auth/login.twig index d1d002c..437fa1c 100644 --- a/resources/templates/auth/login.twig +++ b/resources/templates/auth/login.twig @@ -38,7 +38,7 @@
- +
diff --git a/src/css/app.css b/src/css/app.css index ff25ff7..5e2e52e 100644 --- a/src/css/app.css +++ b/src/css/app.css @@ -7,7 +7,6 @@ html { body { margin-bottom: 40px; font-size: 1rem; - background-color: #f5f5f5; } .form-signin {