diff --git a/Dockerfile.test b/Dockerfile.test deleted file mode 100644 index 3729f6ac9..000000000 --- a/Dockerfile.test +++ /dev/null @@ -1,3 +0,0 @@ -FROM php:8.4-cli -RUN apt-get update && apt-get install -y libicu-dev && docker-php-ext-install intl -WORKDIR /app \ No newline at end of file diff --git a/app/Config/Filters.php b/app/Config/Filters.php index efb99dfd8..d8c097059 100644 --- a/app/Config/Filters.php +++ b/app/Config/Filters.php @@ -70,7 +70,7 @@ class Filters extends BaseFilters public array $globals = [ 'before' => [ 'honeypot', - 'csrf' => ['except' => 'login'], + 'csrf' => ['except' => 'login|migrate'], 'invalidchars', ], 'after' => [ diff --git a/app/Config/OSPOS.php b/app/Config/OSPOS.php index 6d4efbb22..d8b5b99d4 100644 --- a/app/Config/OSPOS.php +++ b/app/Config/OSPOS.php @@ -5,6 +5,7 @@ namespace Config; use App\Models\Appconfig; use CodeIgniter\Cache\CacheInterface; use CodeIgniter\Config\BaseConfig; +use CodeIgniter\Database\Exceptions\DatabaseException; /** * This class holds the configuration options stored from the database so that on launch those settings can be cached @@ -34,11 +35,21 @@ class OSPOS extends BaseConfig if ($cache) { $this->settings = decode_array($cache); } else { - $appconfig = model(Appconfig::class); - foreach ($appconfig->get_all()->getResult() as $app_config) { - $this->settings[$app_config->key] = $app_config->value; + try { + $appconfig = model(Appconfig::class); + foreach ($appconfig->get_all()->getResult() as $app_config) { + $this->settings[$app_config->key] = $app_config->value; + } + $this->cache->save('settings', encode_array($this->settings)); + } catch (DatabaseException $e) { + // Database table doesn't exist yet (migrations haven't run) + // Return empty settings to allow migration page to display + $this->settings = [ + 'language' => 'english', + 'language_code' => 'en', + 'company' => 'Home' + ]; } - $this->cache->save('settings', encode_array($this->settings)); } } @@ -50,4 +61,4 @@ class OSPOS extends BaseConfig $this->cache->delete('settings'); $this->set_settings(); } -} +} \ No newline at end of file diff --git a/app/Config/Routes.php b/app/Config/Routes.php index b4fbf3221..b1cc0a484 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -10,6 +10,7 @@ $routes->setDefaultController('Login'); $routes->get('/', 'Login::index'); $routes->get('login', 'Login::index'); $routes->post('login', 'Login::index'); +$routes->post('migrate', 'Login::migrate'); $routes->add('no_access/index/(:segment)', 'No_access::index/$1'); $routes->add('no_access/index/(:segment)/(:segment)', 'No_access::index/$1/$2'); diff --git a/app/Config/Session.php b/app/Config/Session.php index 662422a20..d749b2ff3 100644 --- a/app/Config/Session.php +++ b/app/Config/Session.php @@ -5,6 +5,8 @@ namespace Config; use CodeIgniter\Config\BaseConfig; use CodeIgniter\Session\Handlers\BaseHandler; use CodeIgniter\Session\Handlers\DatabaseHandler; +use CodeIgniter\Session\Handlers\FileHandler; +use Config\Database; class Session extends BaseConfig { @@ -124,4 +126,23 @@ class Session extends BaseConfig * seconds. */ public int $lockMaxRetries = 300; + + public function __construct() + { + parent::__construct(); + + if ($this->driver === DatabaseHandler::class) { + try { + $db = Database::connect(); + + if (!$db->tableExists($this->savePath)) { + $this->driver = FileHandler::class; + $this->savePath = WRITEPATH . 'session'; + } + } catch (\CodeIgniter\Database\Exceptions\DatabaseException $e) { + $this->driver = FileHandler::class; + $this->savePath = WRITEPATH . 'session'; + } + } + } } diff --git a/app/Controllers/Home.php b/app/Controllers/Home.php index 97d270ffd..50793597a 100644 --- a/app/Controllers/Home.php +++ b/app/Controllers/Home.php @@ -2,6 +2,7 @@ namespace App\Controllers; +use App\Libraries\MY_Migration; use CodeIgniter\HTTP\RedirectResponse; use CodeIgniter\HTTP\ResponseInterface; @@ -81,7 +82,7 @@ class Home extends Secure_Controller if ($this->employee->check_password($this->request->getPost('username', FILTER_SANITIZE_FULL_SPECIAL_CHARS), $this->request->getPost('current_password'))) { // Validate password length BEFORE hashing $new_password = $this->request->getPost('password'); - + if (strlen($new_password) < 8) { return $this->response->setJSON([ 'success' => false, @@ -89,7 +90,7 @@ class Home extends Secure_Controller 'id' => NEW_ENTRY ]); } - + $employee_data = [ 'username' => $this->request->getPost('username', FILTER_SANITIZE_FULL_SPECIAL_CHARS), 'password' => password_hash($new_password, PASSWORD_DEFAULT), @@ -124,4 +125,4 @@ class Home extends Secure_Controller ]); } } -} \ No newline at end of file +} diff --git a/app/Controllers/Login.php b/app/Controllers/Login.php index 48f723144..ee56e7c0b 100644 --- a/app/Controllers/Login.php +++ b/app/Controllers/Login.php @@ -5,6 +5,7 @@ namespace App\Controllers; use App\Libraries\MY_Migration; use App\Models\Employee; use CodeIgniter\HTTP\RedirectResponse; +use CodeIgniter\HTTP\ResponseInterface; use CodeIgniter\Model; use Config\OSPOS; use Config\Services; @@ -36,6 +37,7 @@ class Login extends BaseController $data = [ 'has_errors' => false, + 'is_new_install' => !(MY_Migration::get_current_version()), 'is_latest' => $migration->is_latest(), 'latest_version' => $migration->get_latest_migration(), 'gcaptcha_enabled' => $gcaptcha_enabled, @@ -71,4 +73,28 @@ class Login extends BaseController return redirect()->to('home'); } + + public function migrate(): ResponseInterface + { + try { + $migration = new MY_Migration(config('Migrations')); + $migration->migrate_to_ci4(); + + set_time_limit(3600); + $migration->setNamespace('App')->latest(); + + return $this->response->setJSON([ + 'success' => true, + 'message' => 'Migration completed successfully' + ]); + + } catch (\Exception $e) { + log_message('error', 'Migration failed: ' . $e->getMessage()); + + return $this->response->setJSON([ + 'success' => false, + 'message' => 'Migration failed: ' . $e->getMessage() + ])->setStatusCode(500); + } + } } diff --git a/app/Events/Load_config.php b/app/Events/Load_config.php index c08bfa857..39dce62c4 100644 --- a/app/Events/Load_config.php +++ b/app/Events/Load_config.php @@ -21,63 +21,47 @@ class Load_config { public Session $session; - /** - * Loads configuration from database into App CI config and then applies those settings - */ public function load_config(): void { - // Migrations $migration_config = config('Migrations'); $migration = new MY_Migration($migration_config); - // Use file-based session until database is migrated - $this->session = $this->createSession($migration->is_latest()); + $this->session = session(); - // Database Configuration $config = config(OSPOS::class); if (!$migration->is_latest()) { $this->session->destroy(); } - // Language - $language_exists = file_exists('../app/Language/' . current_language_code()); - - if (current_language_code() == null || current_language() == null || !$language_exists) { // TODO: current_language() is undefined - $config->settings['language'] = 'english'; - $config->settings['language_code'] = 'en'; - } + $this->setDefaultLanguage($config); $language = Services::language(); - $language->setLocale($config->settings['language_code']); + $language->setLocale(current_language_code()); - // Time Zone date_default_timezone_set($config->settings['timezone'] ?? ini_get('date.timezone')); bcscale(max(2, totals_decimals() + tax_decimals())); } - /** - * Creates session with appropriate handler. - * Uses file-based session until database is migrated, then switches to database session. - * - * This prevents a circular dependency where login requires session, but the sessions - * database table doesn't exist yet because migrations run after login. - */ - private function createSession(bool $isDbMigrated): Session + private function setDefaultLanguage(OSPOS $config): void { - $sessionConfig = config('Session'); - - // If database is not migrated and we're configured to use database sessions, - // temporarily fall back to file-based sessions to allow migrations to complete. - // Once migrations run, the user must re-authenticate (session is destroyed in - // load_config() when migrations are pending). - if (!$isDbMigrated && $sessionConfig->driver === DatabaseHandler::class) { - $sessionConfig = clone $sessionConfig; - $sessionConfig->driver = FileHandler::class; - $sessionConfig->savePath = WRITEPATH . 'session'; + $languageCode = $config->settings['language_code'] ?? null; + + if (empty($config->settings) || $languageCode === null) { + $config->settings['language'] = 'english'; + $config->settings['language_code'] = 'en'; + return; } - - return Services::session($sessionConfig); + + if (!$this->languageExists($languageCode)) { + $config->settings['language'] = 'english'; + $config->settings['language_code'] = 'en'; + } + } + + private function languageExists(string $languageCode): bool + { + return file_exists(APPPATH . 'Language/' . $languageCode); } } diff --git a/app/Helpers/locale_helper.php b/app/Helpers/locale_helper.php index b5d04e460..ed21c9fa9 100644 --- a/app/Helpers/locale_helper.php +++ b/app/Helpers/locale_helper.php @@ -22,9 +22,7 @@ function current_language_code(bool $load_system_language = false): string } } - $language_code = $config['language_code']; - - return empty($language_code) ? DEFAULT_LANGUAGE_CODE : $language_code; + return $config->language_code ?? DEFAULT_LANGUAGE_CODE; } /** @@ -45,9 +43,7 @@ function current_language(bool $load_system_language = false): string } } - $language = $config['language']; - - return empty($language) ? DEFAULT_LANGUAGE : $language; + return $config->language ?? DEFAULT_LANGUAGE_CODE; } /** diff --git a/app/Helpers/security_helper.php b/app/Helpers/security_helper.php index cc13796f8..927980e66 100644 --- a/app/Helpers/security_helper.php +++ b/app/Helpers/security_helper.php @@ -11,56 +11,54 @@ function check_encryption(): bool $old_key = config('Encryption')->key; if ((empty($old_key)) || (strlen($old_key) < 64)) { - // Create Key $encryption = new Encryption(); $key = bin2hex($encryption->createKey()); config('Encryption')->key = $key; - // Write to .env $config_path = ROOTPATH . '.env'; - $new_config_path = WRITEPATH . '/backup/.env'; $backup_path = WRITEPATH . '/backup/.env.bak'; - $backup_folder = WRITEPATH . '/backup'; - if (!file_exists($backup_folder) && !mkdir($backup_folder)) { - log_message('error', 'Could not create backup folder'); - return false; + if (!file_exists($backup_folder)) { + @mkdir($backup_folder, 0750, true); } - if (!copy($config_path, $backup_path)) { - log_message('error', "Unable to copy $config_path to $backup_path"); + if (!file_exists($config_path)) { + $example_path = ROOTPATH . '.env.example'; + if (file_exists($example_path)) { + @copy($example_path, $config_path); + } else { + @file_put_contents($config_path, "# OSPOS Configuration\n\n"); + } + @chmod($config_path, 0640); } - // Copy to backup - @chmod($config_path, 0660); - @chmod($backup_path, 0660); + if (file_exists($config_path)) { + @copy($config_path, $backup_path); + @chmod($backup_path, 0640); + @chmod($config_path, 0640); - $config_file = file_get_contents($config_path); - $config_file = preg_replace("/(encryption\.key.*=.*)('.*')/", "$1'$key'", $config_file); + $config_file = file_get_contents($config_path); - if (!empty($old_key)) { - $old_line = "# encryption.key = '$old_key' REMOVE IF UNNEEDED\r\n"; - $insertion_point = stripos($config_file, 'encryption.key'); - $config_file = substr_replace($config_file, $old_line, $insertion_point, 0); + if (strpos($config_file, 'encryption.key') !== false) { + $config_file = preg_replace("/(encryption\.key.*=.*)('.*')/", "$1'$key'", $config_file); + } else { + $config_file .= "\nencryption.key = '$key'\n"; + } + + if (!empty($old_key)) { + $old_line = "# encryption.key = '$old_key' REMOVE IF UNNEEDED\r\n"; + $insertion_point = stripos($config_file, 'encryption.key'); + if ($insertion_point !== false) { + $config_file = substr_replace($config_file, $old_line, $insertion_point, 0); + } + } + + @file_put_contents($config_path, $config_file); + @chmod($config_path, 0640); + + log_message('info', "Updated encryption key in $config_path"); } - - $handle = @fopen($config_path, 'w+'); - - if (empty($handle)) { - log_message('error', "Unable to open $config_path for updating"); - return false; - } - - @chmod($config_path, 0660); - $write_failed = !fwrite($handle, $config_file); - fclose($handle); - - if ($write_failed) { - log_message('error', "Unable to write to $config_path for updating."); - return false; - } - log_message('info', "File $config_path has been updated."); } return true; @@ -74,23 +72,14 @@ function abort_encryption_conversion(): void $config_path = ROOTPATH . '.env'; $backup_path = WRITEPATH . '/backup/.env.bak'; - $config_file = file_get_contents($backup_path); - - $handle = @fopen($config_path, 'w+'); - - if (empty($handle)) { - log_message('error', "Unable to open $config_path to undo encryption conversion"); - } else { - @chmod($config_path, 0660); - $write_failed = !fwrite($handle, $config_file); - fclose($handle); - - if ($write_failed) { - log_message('error', "Unable to write to $config_path to undo encryption conversion."); - return; - } - log_message('info', "File $config_path has been updated to undo encryption conversion"); + if (!file_exists($backup_path)) { + return; } + + @chmod($config_path, 0640); + $config_file = file_get_contents($backup_path); + @file_put_contents($config_path, $config_file); + log_message('info', "Restored $config_path from backup"); } /** @@ -99,13 +88,10 @@ function abort_encryption_conversion(): void function remove_backup(): void { $backup_path = WRITEPATH . '/backup/.env.bak'; - if (! file_exists($backup_path)) { + if (!file_exists($backup_path)) { return; } - if (!unlink($backup_path)) { - log_message('error', "Unable to remove $backup_path."); - return; - } - log_message('info', "File $backup_path has been removed"); + @unlink($backup_path); + log_message('info', "Removed $backup_path"); } diff --git a/app/Language/ar-EG/Login.php b/app/Language/ar-EG/Login.php index 9ca33871f..88a0c849d 100644 --- a/app/Language/ar-EG/Login.php +++ b/app/Language/ar-EG/Login.php @@ -9,6 +9,15 @@ return [ "login" => "دخول", "logout" => "تسجيل خروج", "migration_needed" => "سيبدأ ترحيل قاعدة البيانات إلى{0} بعد تسجيل الدخول.", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "كلمة السر", "required_username" => "", "username" => "اسم المستخدم", diff --git a/app/Language/ar-LB/Login.php b/app/Language/ar-LB/Login.php index f98db7855..9bccf4d73 100644 --- a/app/Language/ar-LB/Login.php +++ b/app/Language/ar-LB/Login.php @@ -9,6 +9,15 @@ return [ "login" => "دخول", "logout" => "تسجيل خروج", "migration_needed" => "سيبدأ ترحيل قاعدة البيانات إلى{0} بعد تسجيل الدخول.", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "كلمة السر", "required_username" => "خانة أسم المستخدم مطلوبة.", "username" => "اسم المستخدم", diff --git a/app/Language/az/Login.php b/app/Language/az/Login.php index 0f43adac9..7f5913520 100644 --- a/app/Language/az/Login.php +++ b/app/Language/az/Login.php @@ -9,6 +9,15 @@ return [ "login" => "Giriş", "logout" => "Çıxış", "migration_needed" => "{0} -ə daxil olandan sonra verilənlər bazası miqrasiyası başlayacaq.", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "Şifrə", "required_username" => "", "username" => "İstifadəçi", diff --git a/app/Language/bg/Login.php b/app/Language/bg/Login.php index 7c1d4ee26..29d7dfea3 100644 --- a/app/Language/bg/Login.php +++ b/app/Language/bg/Login.php @@ -9,6 +9,15 @@ return [ "login" => "Login", "logout" => "", "migration_needed" => "", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "Password", "required_username" => "", "username" => "Username", diff --git a/app/Language/bs/Login.php b/app/Language/bs/Login.php index 467964cce..f65ae5809 100644 --- a/app/Language/bs/Login.php +++ b/app/Language/bs/Login.php @@ -9,6 +9,15 @@ return [ "login" => "Prijava", "logout" => "Odjava", "migration_needed" => "Migracija baze podataka na {0} će početi nakon prijavljivanja.", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "Lozinka", "required_username" => "", "username" => "Korisničko ime", diff --git a/app/Language/ckb/Login.php b/app/Language/ckb/Login.php index 985c9351c..9141fecfd 100644 --- a/app/Language/ckb/Login.php +++ b/app/Language/ckb/Login.php @@ -9,6 +9,15 @@ return [ 'login' => "چوونەژوورەوە", 'logout' => "چوونەدەرەوە", 'migration_needed' => "گواستنەوەی داتابەیس بۆ {0} دوای چوونەژوورەوە دەست پێدەکات.", + 'migration_required' => "", + 'migration_auth_message' => "", + 'migration_initializing' => "", + 'migration_running' => "", + 'migration_complete' => "", + 'migration_complete_login' => "", + 'migration_failed' => "", + 'migration_error_connection' => "", + 'migration_complete_redirect' => "", 'password' => "وشەی نهێنی", 'required_username' => "خانەی ناوی بەکارهێنەر پێویستە.", 'username' => "ناوی بەکارهێنەر", diff --git a/app/Language/cs/Login.php b/app/Language/cs/Login.php index 0ecd8cdfa..308401be6 100644 --- a/app/Language/cs/Login.php +++ b/app/Language/cs/Login.php @@ -9,6 +9,15 @@ return [ "login" => "Login", "logout" => "", "migration_needed" => "", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "Heslo", "required_username" => "", "username" => "Uživatelské jméno", diff --git a/app/Language/da/Login.php b/app/Language/da/Login.php index d443ab5b5..652c3f22c 100644 --- a/app/Language/da/Login.php +++ b/app/Language/da/Login.php @@ -9,6 +9,15 @@ return [ "login" => "", "logout" => "", "migration_needed" => "", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "", "required_username" => "", "username" => "", diff --git a/app/Language/de-CH/Login.php b/app/Language/de-CH/Login.php index 78c7e5c58..15b565a62 100644 --- a/app/Language/de-CH/Login.php +++ b/app/Language/de-CH/Login.php @@ -7,10 +7,19 @@ return [ "invalid_installation" => "", "invalid_username_and_password" => "Ungültiger Benutzername/Passwort", "login" => "Login", - "logout" => "", - "migration_needed" => "", + "logout" => "Abmelden", + "migration_needed" => "Eine Datenbank-Migration auf {0} wird nach der Anmeldung gestartet.", + "migration_required" => "Datenbank-Migration erforderlich", + "migration_auth_message" => "Administrator-Anmeldedaten sind erforderlich, um die Datenbank-Migration auf Version {0} zu autorisieren. Bitte melden Sie sich an, um fortzufahren.", + "migration_initializing" => "Datenbank wird initialisiert", + "migration_running" => "Datenbank-Migrationen werden ausgeführt...", + "migration_complete" => "Datenbank erfolgreich initialisiert!", + "migration_complete_login" => "Sie können sich jetzt anmelden.", + "migration_failed" => "Migration fehlgeschlagen", + "migration_error_connection" => "Verbindungsfehler. Bitte versuchen Sie es erneut.", + "migration_complete_redirect" => "Migration abgeschlossen. Weiterleitung zur Anmeldung...", "password" => "Passwort", - "required_username" => "", + "required_username" => "Das Feld Benutzername ist erforderlich.", "username" => "Benutzername", - "welcome" => "", + "welcome" => "Willkommen bei {0}!", ]; diff --git a/app/Language/de-DE/Login.php b/app/Language/de-DE/Login.php index 6b6bd14a7..723ab9a60 100644 --- a/app/Language/de-DE/Login.php +++ b/app/Language/de-DE/Login.php @@ -7,10 +7,19 @@ return [ "invalid_installation" => "Die Installation ist nicht korrekt, überprüfen Sie Ihre php.ini-Datei.", "invalid_username_and_password" => "Ungültiger Benutzername oder Passwort.", "login" => "Login", - "logout" => "", - "migration_needed" => "", + "logout" => "Abmelden", + "migration_needed" => "Eine Datenbank-Migration auf {0} wird nach der Anmeldung gestartet.", + "migration_required" => "Datenbank-Migration erforderlich", + "migration_auth_message" => "Administrator-Anmeldedaten sind erforderlich, um die Datenbank-Migration auf Version {0} zu autorisieren. Bitte melden Sie sich an, um fortzufahren.", + "migration_initializing" => "Datenbank wird initialisiert", + "migration_running" => "Datenbank-Migrationen werden ausgeführt...", + "migration_complete" => "Datenbank erfolgreich initialisiert!", + "migration_complete_login" => "Sie können sich jetzt anmelden.", + "migration_failed" => "Migration fehlgeschlagen", + "migration_error_connection" => "Verbindungsfehler. Bitte versuchen Sie es erneut.", + "migration_complete_redirect" => "Migration abgeschlossen. Weiterleitung zur Anmeldung...", "password" => "Passwort", - "required_username" => "", + "required_username" => "Das Feld Benutzername ist erforderlich.", "username" => "Benutzername", - "welcome" => "", + "welcome" => "Willkommen bei {0}!", ]; diff --git a/app/Language/el/Login.php b/app/Language/el/Login.php index d443ab5b5..652c3f22c 100644 --- a/app/Language/el/Login.php +++ b/app/Language/el/Login.php @@ -9,6 +9,15 @@ return [ "login" => "", "logout" => "", "migration_needed" => "", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "", "required_username" => "", "username" => "", diff --git a/app/Language/en-GB/Login.php b/app/Language/en-GB/Login.php index 0eb94004e..928806a44 100644 --- a/app/Language/en-GB/Login.php +++ b/app/Language/en-GB/Login.php @@ -9,6 +9,15 @@ return [ "login" => "Login", "logout" => "Logout", "migration_needed" => "A database migration to {0} will start after login.", + "migration_required" => "Database Migration Required", + "migration_auth_message" => "Administrator credentials are required to authorize the database migration to version {0}. Please login to proceed.", + "migration_initializing" => "Initializing Database", + "migration_running" => "Running database migrations...", + "migration_complete" => "Database initialized successfully!", + "migration_complete_login" => "You can now log in.", + "migration_failed" => "Migration failed", + "migration_error_connection" => "Connection error. Please try again.", + "migration_complete_redirect" => "Migration complete. Redirecting to login...", "password" => "Password", "required_username" => "The username field is required.", "username" => "Username", diff --git a/app/Language/en/Login.php b/app/Language/en/Login.php index 000360dea..928806a44 100644 --- a/app/Language/en/Login.php +++ b/app/Language/en/Login.php @@ -11,6 +11,12 @@ return [ "migration_needed" => "A database migration to {0} will start after login.", "migration_required" => "Database Migration Required", "migration_auth_message" => "Administrator credentials are required to authorize the database migration to version {0}. Please login to proceed.", + "migration_initializing" => "Initializing Database", + "migration_running" => "Running database migrations...", + "migration_complete" => "Database initialized successfully!", + "migration_complete_login" => "You can now log in.", + "migration_failed" => "Migration failed", + "migration_error_connection" => "Connection error. Please try again.", "migration_complete_redirect" => "Migration complete. Redirecting to login...", "password" => "Password", "required_username" => "The username field is required.", diff --git a/app/Language/es-ES/Login.php b/app/Language/es-ES/Login.php index 03868bd06..65f0b2287 100644 --- a/app/Language/es-ES/Login.php +++ b/app/Language/es-ES/Login.php @@ -9,6 +9,15 @@ return [ "login" => "Iniciar Sesión", "logout" => "Cerrar sesión", "migration_needed" => "La migración de la base de datos a {0} se iniciará después del inicio de sesión.", + "migration_required" => "Migración de base de datos requerida", + "migration_auth_message" => "Se requieren credenciales de administrador para autorizar la migración de la base de datos a la versión {0}. Inicie sesión para continuar.", + "migration_initializing" => "Inicializando base de datos", + "migration_running" => "Ejecutando migraciones de base de datos...", + "migration_complete" => "¡Base de datos inicializada correctamente!", + "migration_complete_login" => "Ahora puede iniciar sesión.", + "migration_failed" => "Migración fallida", + "migration_error_connection" => "Error de conexión. Por favor, inténtelo de nuevo.", + "migration_complete_redirect" => "Migración completada. Redirigiendo al inicio de sesión...", "password" => "Contraseña", "required_username" => "El campo de nombre de usuario es obligatorio.", "username" => "Usuario", diff --git a/app/Language/es-MX/Login.php b/app/Language/es-MX/Login.php index f76c33cb2..bdcac3a7d 100644 --- a/app/Language/es-MX/Login.php +++ b/app/Language/es-MX/Login.php @@ -9,6 +9,15 @@ return [ "login" => "Login", "logout" => "Salir", "migration_needed" => "Una migración de base de datos a {0} empezara después de entrar.", + "migration_required" => "Migración de base de datos requerida", + "migration_auth_message" => "Se requieren credenciales de administrador para autorizar la migración de la base de datos a la versión {0}. Inicie sesión para continuar.", + "migration_initializing" => "Inicializando base de datos", + "migration_running" => "Ejecutando migraciones de base de datos...", + "migration_complete" => "¡Base de datos inicializada correctamente!", + "migration_complete_login" => "Ahora puede iniciar sesión.", + "migration_failed" => "Migración fallida", + "migration_error_connection" => "Error de conexión. Por favor, inténtelo de nuevo.", + "migration_complete_redirect" => "Migración completada. Redirigiendo al inicio de sesión...", "password" => "Contraseña", "required_username" => "El nombre de usuario es obligatorio.", "username" => "Usuario", diff --git a/app/Language/fa/Login.php b/app/Language/fa/Login.php index 512f64b0e..4513d74f2 100644 --- a/app/Language/fa/Login.php +++ b/app/Language/fa/Login.php @@ -9,6 +9,15 @@ return [ "login" => "وارد شدن", "logout" => "", "migration_needed" => "", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "کلمه عبور", "required_username" => "", "username" => "نام کاربری", diff --git a/app/Language/fr/Login.php b/app/Language/fr/Login.php index 5eb13d5c2..9ee6b7a08 100644 --- a/app/Language/fr/Login.php +++ b/app/Language/fr/Login.php @@ -9,6 +9,15 @@ return [ "login" => "Login", "logout" => "Déconnexion", "migration_needed" => "Une migration de base de données vers {0} débutera après l'ouverture de session.", + "migration_required" => "Migration de base de données requise", + "migration_auth_message" => "Les identifiants administrateur sont requis pour autoriser la migration de la base de données vers la version {0}. Veuillez vous connecter pour continuer.", + "migration_initializing" => "Initialisation de la base de données", + "migration_running" => "Exécution des migrations de la base de données...", + "migration_complete" => "Base de données initialisée avec succès !", + "migration_complete_login" => "Vous pouvez maintenant vous connecter.", + "migration_failed" => "Échec de la migration", + "migration_error_connection" => "Erreur de connexion. Veuillez réessayer.", + "migration_complete_redirect" => "Migration terminée. Redirection vers la connexion...", "password" => "Mot de passe", "required_username" => "Le champ nom utilisateur est obligatoire.", "username" => "Nom d'utilisateur", diff --git a/app/Language/he/Login.php b/app/Language/he/Login.php index c1809b79d..aa1ef1cea 100644 --- a/app/Language/he/Login.php +++ b/app/Language/he/Login.php @@ -9,6 +9,15 @@ return [ "login" => "כניסה", "logout" => "", "migration_needed" => "", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "סיסמה", "required_username" => "", "username" => "שם משתמש", diff --git a/app/Language/hr-HR/Login.php b/app/Language/hr-HR/Login.php index 8bb5cac4a..559465600 100644 --- a/app/Language/hr-HR/Login.php +++ b/app/Language/hr-HR/Login.php @@ -9,6 +9,15 @@ return [ "login" => "Prijava", "logout" => "", "migration_needed" => "", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "Lozinka", "required_username" => "", "username" => "Korisničko ime", diff --git a/app/Language/hu/Login.php b/app/Language/hu/Login.php index 0a2e55dfc..74854cbbe 100644 --- a/app/Language/hu/Login.php +++ b/app/Language/hu/Login.php @@ -9,6 +9,15 @@ return [ "login" => "Belépés", "logout" => "", "migration_needed" => "", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "Jelszó", "required_username" => "", "username" => "Felhasználó név", diff --git a/app/Language/hy/Login.php b/app/Language/hy/Login.php index d443ab5b5..652c3f22c 100644 --- a/app/Language/hy/Login.php +++ b/app/Language/hy/Login.php @@ -9,6 +9,15 @@ return [ "login" => "", "logout" => "", "migration_needed" => "", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "", "required_username" => "", "username" => "", diff --git a/app/Language/id/Login.php b/app/Language/id/Login.php index f1a1c4dd9..a3b57ccd5 100644 --- a/app/Language/id/Login.php +++ b/app/Language/id/Login.php @@ -9,6 +9,15 @@ return [ "login" => "Masuk", "logout" => "Keluar", "migration_needed" => "Migrasi basis data untuk {0} akan mulai setelah masuk.", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "Kata kunci", "required_username" => "Kolom nama pengguna wajib diisi.", "username" => "Nama Anda", diff --git a/app/Language/it/Login.php b/app/Language/it/Login.php index d5cd91867..b353ac821 100644 --- a/app/Language/it/Login.php +++ b/app/Language/it/Login.php @@ -9,8 +9,17 @@ return [ "login" => "Login", "logout" => "Uscita", "migration_needed" => "Dopo l'accesso verrà avviata una migrazione del database a {0}.", + "migration_required" => "Migratione del database richiesta", + "migration_auth_message" => "Le credenziali di amministratore sono richieste per autorizzare la migrazione del database alla versione {0}. Effettua il login per continuare.", + "migration_initializing" => "Inizializzazione database", + "migration_running" => "Esecuzione migrazioni database...", + "migration_complete" => "Database inizializzato con successo!", + "migration_complete_login" => "È ora possibile effettuare il login.", + "migration_failed" => "Migrazione fallita", + "migration_error_connection" => "Errore di connessione. Riprova.", + "migration_complete_redirect" => "Migrazione completata. Reindirizzamento al login...", "password" => "Password", - "required_username" => "", + "required_username" => "Il campo nome utente è obbligatorio.", "username" => "Username", "welcome" => "Benvenuto in {0}!", ]; diff --git a/app/Language/km/Login.php b/app/Language/km/Login.php index 5ce999603..ea92cd2de 100644 --- a/app/Language/km/Login.php +++ b/app/Language/km/Login.php @@ -9,6 +9,15 @@ return [ "login" => "ចូល", "logout" => "", "migration_needed" => "", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "ពាក្យសំងាត់", "required_username" => "", "username" => "ឈ្មោះ", diff --git a/app/Language/lo/Login.php b/app/Language/lo/Login.php index 610a1a35f..89e65f643 100644 --- a/app/Language/lo/Login.php +++ b/app/Language/lo/Login.php @@ -9,6 +9,15 @@ return [ "login" => "ເຂົ້າລະບົບ", "logout" => "", "migration_needed" => "", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "Password", "required_username" => "", "username" => "Username", diff --git a/app/Language/ml/Login.php b/app/Language/ml/Login.php index d443ab5b5..652c3f22c 100644 --- a/app/Language/ml/Login.php +++ b/app/Language/ml/Login.php @@ -9,6 +9,15 @@ return [ "login" => "", "logout" => "", "migration_needed" => "", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "", "required_username" => "", "username" => "", diff --git a/app/Language/nb/Login.php b/app/Language/nb/Login.php index d443ab5b5..652c3f22c 100644 --- a/app/Language/nb/Login.php +++ b/app/Language/nb/Login.php @@ -9,6 +9,15 @@ return [ "login" => "", "logout" => "", "migration_needed" => "", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "", "required_username" => "", "username" => "", diff --git a/app/Language/nl-BE/Login.php b/app/Language/nl-BE/Login.php index cb3527d33..7b4e68ffe 100644 --- a/app/Language/nl-BE/Login.php +++ b/app/Language/nl-BE/Login.php @@ -9,6 +9,15 @@ return [ "login" => "Login", "logout" => "Log-uit", "migration_needed" => "Een database migratie naar {0} zal starten na het inloggen.", + "migration_required" => "Database migratie vereist", + "migration_auth_message" => "Beheerdersreferenties zijn vereist om de databasemigratie naar versie {0} te autoriseren. Log in om verder te gaan.", + "migration_initializing" => "Database initialiseren", + "migration_running" => "Databasemigraties uitvoeren...", + "migration_complete" => "Database succesvol geïnitialiseerd!", + "migration_complete_login" => "U kunt nu inloggen.", + "migration_failed" => "Migratie mislukt", + "migration_error_connection" => "Verbindingsfout. Probeer het opnieuw.", + "migration_complete_redirect" => "Migratie voltooid. Doorsturen naar login...", "password" => "Paswoord", "required_username" => "", "username" => "Gebruiker", diff --git a/app/Language/nl-NL/Login.php b/app/Language/nl-NL/Login.php index 9dfde1688..0f1117123 100644 --- a/app/Language/nl-NL/Login.php +++ b/app/Language/nl-NL/Login.php @@ -9,6 +9,15 @@ return [ "login" => "Aanmelden", "logout" => "Afmelden", "migration_needed" => "Een databasemigratie naar {0} zal starten na aanmelding.", + "migration_required" => "Database migratie vereist", + "migration_auth_message" => "Beheerdersreferenties zijn vereist om de databasemigratie naar versie {0} te autoriseren. Log in om verder te gaan.", + "migration_initializing" => "Database initialiseren", + "migration_running" => "Databasemigraties uitvoeren...", + "migration_complete" => "Database succesvol geïnitialiseerd!", + "migration_complete_login" => "U kunt nu inloggen.", + "migration_failed" => "Migratie mislukt", + "migration_error_connection" => "Verbindingsfout. Probeer het opnieuw.", + "migration_complete_redirect" => "Migratie voltooid. Doorsturen naar login...", "password" => "Wachtwoord", "required_username" => "Het gebruikersnaam veld is verplicht.", "username" => "Gebruikersnaam", diff --git a/app/Language/pl/Login.php b/app/Language/pl/Login.php index 399a94a22..99b359e9a 100644 --- a/app/Language/pl/Login.php +++ b/app/Language/pl/Login.php @@ -9,6 +9,15 @@ return [ "login" => "Zaloguj", "logout" => "Wyloguj", "migration_needed" => "Migracja bazy danych do {0} zacznie się po zalogowaniu.", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "Hasło", "required_username" => "", "username" => "Nazwa użytkownika", diff --git a/app/Language/pt-BR/Login.php b/app/Language/pt-BR/Login.php index 92504e3c2..f54b518a7 100644 --- a/app/Language/pt-BR/Login.php +++ b/app/Language/pt-BR/Login.php @@ -9,8 +9,17 @@ return [ 'login' => "Autenticação", 'logout' => "Sair", 'migration_needed' => "Uma migração do banco de dados para {0} será iniciada após o login.", + 'migration_required' => "Migração de banco de dados necessária", + 'migration_auth_message' => "Credenciais de administrador são necessárias para autorizar a migração do banco de dados para a versão {0}. Faça login para continuar.", + 'migration_initializing' => "Inicializando banco de dados", + 'migration_running' => "Executando migrações do banco de dados...", + 'migration_complete' => "Banco de dados inicializado com sucesso!", + 'migration_complete_login' => "Agora você pode fazer login.", + 'migration_failed' => "Migração falhou", + 'migration_error_connection' => "Erro de conexão. Por favor, tente novamente.", + 'migration_complete_redirect' => "Migração concluída. Redirecionando para login...", 'password' => "Senha", 'required_username' => "O campo nome de usuário é obrigatório.", 'username' => "Usuário", - 'welcome' => "Bem-vindo!", + 'welcome' => "Bem-vindo ao {0}!", ]; diff --git a/app/Language/ro/Login.php b/app/Language/ro/Login.php index d443ab5b5..652c3f22c 100644 --- a/app/Language/ro/Login.php +++ b/app/Language/ro/Login.php @@ -9,6 +9,15 @@ return [ "login" => "", "logout" => "", "migration_needed" => "", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "", "required_username" => "", "username" => "", diff --git a/app/Language/ru/Login.php b/app/Language/ru/Login.php index 9390a626c..257362295 100644 --- a/app/Language/ru/Login.php +++ b/app/Language/ru/Login.php @@ -9,6 +9,15 @@ return [ "login" => "Вход", "logout" => "Выход", "migration_needed" => "Миграция базы данных в {0} начнется после входа в систему.", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "Пароль", "required_username" => "", "username" => "Имя пользователя", diff --git a/app/Language/sv/Login.php b/app/Language/sv/Login.php index 32b49ebc7..3cb286958 100644 --- a/app/Language/sv/Login.php +++ b/app/Language/sv/Login.php @@ -9,6 +9,15 @@ return [ "login" => "Login", "logout" => "Logga ut", "migration_needed" => "En migration av databasen till {0} kommer att påbörjas efter inloggningen.", + "migration_required" => "Databasmigration krävs", + "migration_auth_message" => "Admin-uppgifter krävs för att godkänna databasmigrationen till version {0}. Logga in för att fortsätta.", + "migration_initializing" => "Initierar databas", + "migration_running" => "Kör databasmigrationer...", + "migration_complete" => "Databas initierad framgångsrikt!", + "migration_complete_login" => "Du kan nu logga in.", + "migration_failed" => "Migration misslyckades", + "migration_error_connection" => "Anslutningsfel. Försök igen.", + "migration_complete_redirect" => "Migration klar. Omdirigerar till login...", "password" => "Lösenord", "required_username" => "Fältet för användarnamn krävs.", "username" => "Användarnamn", diff --git a/app/Language/sw-KE/Login.php b/app/Language/sw-KE/Login.php index 4ec8895af..15d9468d4 100644 --- a/app/Language/sw-KE/Login.php +++ b/app/Language/sw-KE/Login.php @@ -9,6 +9,15 @@ return [ "login" => "Ingia", "logout" => "Toka", "migration_needed" => "Uhamishaji wa kanzidata hadi {0} utaanza baada ya kuingia.", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "Nenosiri", "required_username" => "Jina la mtumiaji ni lazima.", "username" => "Jina la Mtumiaji", diff --git a/app/Language/sw-TZ/Login.php b/app/Language/sw-TZ/Login.php index 4ec8895af..15d9468d4 100644 --- a/app/Language/sw-TZ/Login.php +++ b/app/Language/sw-TZ/Login.php @@ -9,6 +9,15 @@ return [ "login" => "Ingia", "logout" => "Toka", "migration_needed" => "Uhamishaji wa kanzidata hadi {0} utaanza baada ya kuingia.", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "Nenosiri", "required_username" => "Jina la mtumiaji ni lazima.", "username" => "Jina la Mtumiaji", diff --git a/app/Language/ta/Login.php b/app/Language/ta/Login.php index 549b3baa1..02a07a776 100644 --- a/app/Language/ta/Login.php +++ b/app/Language/ta/Login.php @@ -9,6 +9,15 @@ return [ "login" => "உள்நுழைய", "logout" => "விடுபதிகை", "migration_needed" => "{0} க்கு தரவுத்தள இடம்பெயர்வு உள்நுழைந்த பிறகு தொடங்கும்.", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "கடவுச்சொல்", "required_username" => "", "username" => "பயனர்பெயர்", diff --git a/app/Language/th/Login.php b/app/Language/th/Login.php index 484045b1e..e9b7b7cd1 100644 --- a/app/Language/th/Login.php +++ b/app/Language/th/Login.php @@ -9,6 +9,15 @@ return [ "login" => "ลงชื่อเข้าใช้", "logout" => "ออกจากระบบ", "migration_needed" => "การย้ายฐานข้อมูลไปยัง {0} จะเริ่มต้นหลังจากเข้าสู่ระบบ", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "รหัสผ่าน", "required_username" => "จำเป็นต้องระบุชื่อผู้ใช้งาน", "username" => "ชื่อผู้ใช้", diff --git a/app/Language/tl/Login.php b/app/Language/tl/Login.php index b8436ee75..bbf0052a2 100644 --- a/app/Language/tl/Login.php +++ b/app/Language/tl/Login.php @@ -9,6 +9,15 @@ return [ "login" => "Login", "logout" => "", "migration_needed" => "", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "Password", "required_username" => "", "username" => "Username", diff --git a/app/Language/tr/Login.php b/app/Language/tr/Login.php index 1174251db..d0a469d91 100644 --- a/app/Language/tr/Login.php +++ b/app/Language/tr/Login.php @@ -9,8 +9,17 @@ return [ "login" => "Giriş", "logout" => "Çıkış", "migration_needed" => "Girişten sonra {0} veri tabanına göç başlayacak.", + "migration_required" => "Veritabanı Göçü Gerekli", + "migration_auth_message" => "Veritabanı göçünün {0} versiyonuna yetkilendirilmesi için yönetici kimlik bilgileri gereklidir. Devam etmek için giriş yapın.", + "migration_initializing" => "Veritabanı başlatılıyor", + "migration_running" => "Veritabanı göçleri çalışıyor...", + "migration_complete" => "Veritabanı başarıyla başlatıldı!", + "migration_complete_login" => "Artık giriş yapabilirsiniz.", + "migration_failed" => "Göç başarısız oldu", + "migration_error_connection" => "Bağlantı hatası. Lütfen tekrar deneyin.", + "migration_complete_redirect" => "Göç tamamlandı. Girişe yönlendiriliyor...", "password" => "Parola", - "required_username" => "", + "required_username" => "Kullanıcı adı alanı gereklidir.", "username" => "Kullanıcı Adı", "welcome" => "{0}'e Hoş Geldiniz!", ]; diff --git a/app/Language/uk/Login.php b/app/Language/uk/Login.php index d63460602..dc30eb1bd 100644 --- a/app/Language/uk/Login.php +++ b/app/Language/uk/Login.php @@ -9,6 +9,15 @@ return [ "login" => "Логін", "logout" => "", "migration_needed" => "", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "Пароль", "required_username" => "", "username" => "Ім'я користувача", diff --git a/app/Language/ur/Login.php b/app/Language/ur/Login.php index d443ab5b5..652c3f22c 100644 --- a/app/Language/ur/Login.php +++ b/app/Language/ur/Login.php @@ -9,6 +9,15 @@ return [ "login" => "", "logout" => "", "migration_needed" => "", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "", "required_username" => "", "username" => "", diff --git a/app/Language/vi/Login.php b/app/Language/vi/Login.php index 12bedf6a7..140537698 100644 --- a/app/Language/vi/Login.php +++ b/app/Language/vi/Login.php @@ -9,6 +9,15 @@ return [ "login" => "Đăng nhập", "logout" => "Đăng xuất", "migration_needed" => "Di chuyển cơ sở dữ liệu sang {0} sẽ được bắt đầu sau khi đăng nhập.", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "Mật khẩu", "required_username" => "", "username" => "Tài khoản", diff --git a/app/Language/zh-Hans/Login.php b/app/Language/zh-Hans/Login.php index 12d7f538e..c7802344e 100644 --- a/app/Language/zh-Hans/Login.php +++ b/app/Language/zh-Hans/Login.php @@ -9,6 +9,15 @@ return [ "login" => "登入", "logout" => "退出", "migration_needed" => "", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "密码", "username" => "用户名", "welcome" => "欢迎来到 {0}!", diff --git a/app/Language/zh-Hant/Login.php b/app/Language/zh-Hant/Login.php index eb0264ca0..22b500516 100644 --- a/app/Language/zh-Hant/Login.php +++ b/app/Language/zh-Hant/Login.php @@ -9,6 +9,15 @@ return [ "login" => "登入", "logout" => "登出", "migration_needed" => "登錄後將開始向 {0} 的數據庫遷移。", + "migration_required" => "", + "migration_auth_message" => "", + "migration_initializing" => "", + "migration_running" => "", + "migration_complete" => "", + "migration_complete_login" => "", + "migration_failed" => "", + "migration_error_connection" => "", + "migration_complete_redirect" => "", "password" => "密碼", "required_username" => "", "username" => "帳號", diff --git a/app/Libraries/MY_Migration.php b/app/Libraries/MY_Migration.php index 951b50a14..b0187eb0a 100644 --- a/app/Libraries/MY_Migration.php +++ b/app/Libraries/MY_Migration.php @@ -2,6 +2,7 @@ namespace App\Libraries; +use CodeIgniter\Database\Exceptions\DatabaseException; use CodeIgniter\Database\MigrationRunner; use Config\Database; use stdClass; @@ -35,11 +36,16 @@ class MY_Migration extends MigrationRunner */ public static function get_current_version(): int { - $db = Database::connect(); - if ($db->tableExists('migrations')) { - $builder = $db->table('migrations'); - $builder->select('version')->orderBy('version', 'DESC')->limit(1); - return $builder->get()->getRow()->version; + try { + $db = Database::connect(); + if ($db->tableExists('migrations')) { + $builder = $db->table('migrations'); + $builder->select('version')->orderBy('version', 'DESC')->limit(1); + $result = $builder->get()->getRow(); + return $result ? $result->version : 0; + } + } catch (DatabaseException $e) { + return 0; } return 0; @@ -63,10 +69,15 @@ class MY_Migration extends MigrationRunner */ private function ci3_migrations_exists(): bool|string { - if ($this->db->tableExists('migrations') && !$this->db->fieldExists('id', 'migrations')) { - $builder = $this->db->table('migrations'); - $builder->select('version'); - return $builder->get()->getRow()->version; + try { + if ($this->db->tableExists('migrations') && !$this->db->fieldExists('id', 'migrations')) { + $builder = $this->db->table('migrations'); + $builder->select('version'); + $result = $builder->get()->getRow(); + return $result ? $result->version : false; + } + } catch (DatabaseException $e) { + // Database doesn't exist yet or connection failed } return false; @@ -143,4 +154,5 @@ class MY_Migration extends MigrationRunner $this->ensureTable(); } + } diff --git a/app/Views/login.php b/app/Views/login.php index b79e8c89f..51487c44e 100644 --- a/app/Views/login.php +++ b/app/Views/login.php @@ -2,6 +2,7 @@ /** * @var bool $has_errors * @var bool $is_latest + * @var bool $is_new_install * @var string $latest_version * @var bool $gcaptcha_enabled * @var array $config @@ -46,15 +47,20 @@
- - -

-
- -
- -

- + 'login-form']) ?> + +

+ + + + + +

+ +
+ +
+ getErrors() as $error): ?>
@@ -62,44 +68,72 @@
- -
- > - + +
+ +
+ +
+

+
+
+
-
- > - -
- -
- - - - - - - > -
-
- - - - - - - > -
- - '; - echo '
'; - } - ?> +

+ +

+
+ + + +
+ +
+ > + +
+
+ > + +
+ +
+ + + + + + + > +
+
+ + + + + + + > +
+ + + + +
+ +
+
-
@@ -119,6 +153,141 @@
+ + + + getGet('debug') == 'true') : ?> + + + + + + + diff --git a/gulpfile.js b/gulpfile.js index 38388de33..679230508 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -190,6 +190,22 @@ gulp.task('prod-js', function() { }); +// Inject jQuery into login.php (debug mode) - reuse the jQuery file already created by debug-js +gulp.task('debug-login-js', function() { + // Match only core jQuery (jquery-HASH.js), exclude jquery plugins (jquery-HASH.form.js, etc) and jquery-ui (jquery-ui-HASH.js) + // Pattern: jquery-[hash].js where hash is alphanumeric - core jQuery only + var loginDebugJs = gulp.src(['./public/resources/js/jquery-*.js', '!./public/resources/js/jquery-*.form.js', '!./public/resources/js/jquery-*.validate.js', '!./public/resources/js/jquery-ui-*.js']); + return gulp.src('./app/Views/login.php').pipe(inject(loginDebugJs, {addRootSlash: false, ignorePath: '/public/', starttag: ''})).pipe(gulp.dest('./app/Views')); +}); + +// Inject jQuery into login.php (production mode) - reuse the jQuery file already created by prod-js +gulp.task('prod-login-js', function() { + // jQuery prod file is already in resources/jquery-*.min.js from prod-js task + var loginProdJs = gulp.src('./public/resources/jquery-*.min.js'); + return gulp.src('./app/Views/login.php').pipe(inject(loginProdJs, {addRootSlash: false, ignorePath: '/public/', starttag: ''})).pipe(gulp.dest('./app/Views')); +}); + + gulp.task('debug-css', function() { var debugcss = gulp.src(['./node_modules/jquery-ui-dist/jquery-ui.css', @@ -289,6 +305,8 @@ gulp.task('default', 'copy-bootstrap', 'debug-js', 'prod-js', + 'debug-login-js', + 'prod-login-js', 'debug-css', 'prod-css', 'copy-fonts', diff --git a/public/resources/.gitkeep b/public/resources/.gitkeep new file mode 100644 index 000000000..e69de29bb