diff --git a/configs/menu.conf b/configs/menu.conf index b58ab736..a83421af 100644 --- a/configs/menu.conf +++ b/configs/menu.conf @@ -27,6 +27,8 @@ url_password = edit.php?table=adminpassword url_totp = totp.php url_totp_exceptions = totp-exceptions.php url_app_passwords = app-passwords.php +# update-check +url_update_check = update-check.php # backup url_backup = backup.php # viewlog diff --git a/languages/bg.lang b/languages/bg.lang index 183f944b..f4b72de8 100644 --- a/languages/bg.lang +++ b/languages/bg.lang @@ -496,6 +496,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP is already configured for this accoun $PALANG['pApp_passwords_add'] = 'Add application-specific password'; # XXX +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/ca.lang b/languages/ca.lang index 58e1f5a2..a944bfe4 100644 --- a/languages/ca.lang +++ b/languages/ca.lang @@ -495,6 +495,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP ja està configurat per aquest compte $PALANG['pApp_passwords_add'] = 'Afegir la contrasenya específica de l\'aplicació'; +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/cn.lang b/languages/cn.lang index 45a9fdc2..ed2a70b5 100644 --- a/languages/cn.lang +++ b/languages/cn.lang @@ -496,6 +496,15 @@ $PALANG['TOTP_already_configured'] = '你是否想改变你的秘密?'; $PALANG['pApp_passwords_add'] = '添加针对具体申请的密码'; +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/cs.lang b/languages/cs.lang index 35faf240..bd4bf1c2 100644 --- a/languages/cs.lang +++ b/languages/cs.lang @@ -511,6 +511,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP je již nakonfigurován pro tento ú $PALANG['pApp_passwords_add'] = 'Přidat heslo specifické pro aplikaci'; +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/da.lang b/languages/da.lang index 20b19a47..f9a161fa 100644 --- a/languages/da.lang +++ b/languages/da.lang @@ -512,6 +512,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP er allerede konfigureret til denne ko $PALANG['pApp_passwords_add'] = 'Tilføj adgangskode'; +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/de.lang b/languages/de.lang index 3bc69f7c..53670be8 100644 --- a/languages/de.lang +++ b/languages/de.lang @@ -508,6 +508,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP ist bereits für dieses Konto konfigu $PALANG['pApp_passwords_add'] = 'Anwendungsspezifisches Passwort hinzufügen'; +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/en.lang b/languages/en.lang index 698587f1..38a06c6d 100644 --- a/languages/en.lang +++ b/languages/en.lang @@ -523,6 +523,16 @@ $PALANG['pLegal_char_warning'] = 'Illegal character'; $PALANG['TOTP_already_configured'] = 'TOTP is already configured for this account, do you want to change your secret?'; $PALANG['pApp_passwords_add'] = 'Add application-specific password'; +$PALANG['pUpdate_title'] = 'Update Check'; +$PALANG['pUpdate_current_version'] = 'Current version'; +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; +$PALANG['pUpdate_available'] = 'A newer version is available'; +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; +$PALANG['pUpdate_changelog'] = 'Changelog'; +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; + $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/es.lang b/languages/es.lang index 0e3335ab..95ecec1a 100644 --- a/languages/es.lang +++ b/languages/es.lang @@ -498,6 +498,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP ya está configurado para esta cuenta $PALANG['pApp_passwords_add'] = 'Añadir contraseña específica para aplicaciones'; +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/et.lang b/languages/et.lang index 1a815028..cb9fb2d7 100644 --- a/languages/et.lang +++ b/languages/et.lang @@ -500,6 +500,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP is already configured for this accoun $PALANG['pApp_passwords_add'] = 'Add application-specific password'; # XXX +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/eu.lang b/languages/eu.lang index 814c9f3a..7200d757 100644 --- a/languages/eu.lang +++ b/languages/eu.lang @@ -495,6 +495,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP is already configured for this accoun $PALANG['pApp_passwords_add'] = 'Add application-specific password'; # XXX +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/fi.lang b/languages/fi.lang index 5fd1e0c5..a0552520 100644 --- a/languages/fi.lang +++ b/languages/fi.lang @@ -496,6 +496,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP on jo määritetty tälle tilille, ha $PALANG['pApp_passwords_add'] = 'Lisää sovelluskohtainen salasana'; +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/fo.lang b/languages/fo.lang index 11434ed9..4544302a 100644 --- a/languages/fo.lang +++ b/languages/fo.lang @@ -501,6 +501,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP is already configured for this accoun $PALANG['pApp_passwords_add'] = 'Add application-specific password'; # XXX +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/fr.lang b/languages/fr.lang index 03e4feb1..9de9a3e8 100644 --- a/languages/fr.lang +++ b/languages/fr.lang @@ -500,6 +500,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP est déjà configuré pour ce compte, $PALANG['pApp_passwords_add'] = 'Ajouter un mot de passe spécifique à l\'application'; +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/gl.lang b/languages/gl.lang index 0d4a2b72..b4bfbfc2 100644 --- a/languages/gl.lang +++ b/languages/gl.lang @@ -496,6 +496,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP is already configured for this accoun $PALANG['pApp_passwords_add'] = 'Add application-specific password'; # XXX +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/hr.lang b/languages/hr.lang index f9712a51..fd1d62af 100644 --- a/languages/hr.lang +++ b/languages/hr.lang @@ -495,6 +495,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP is already configured for this accoun $PALANG['pApp_passwords_add'] = 'Add application-specific password'; # XXX +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/hu.lang b/languages/hu.lang index 4f041053..1e6793d8 100644 --- a/languages/hu.lang +++ b/languages/hu.lang @@ -509,6 +509,15 @@ $PALANG['TOTP_already_configured'] = 'A TOTP már ehhez a fiókhoz van konfigur $PALANG['pApp_passwords_add'] = 'Adjon alkalmazásspecifikus jelszót'; +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/is.lang b/languages/is.lang index 6bf52711..66abfbf1 100644 --- a/languages/is.lang +++ b/languages/is.lang @@ -496,6 +496,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP is already configured for this accoun $PALANG['pApp_passwords_add'] = 'Add application-specific password'; # XXX +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/it.lang b/languages/it.lang index c0aa52d1..c8bc5045 100644 --- a/languages/it.lang +++ b/languages/it.lang @@ -497,6 +497,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP è già configurato per questo accoun $PALANG['pApp_passwords_add'] = 'Aggiungere la password specifica dell\'applicazione'; +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/ja.lang b/languages/ja.lang index 0a25a952..4101d977 100644 --- a/languages/ja.lang +++ b/languages/ja.lang @@ -507,6 +507,15 @@ $PALANG['TOTP_already_configured'] = 'TOTPは既にこのアカウントで設 $PALANG['pApp_passwords_add'] = 'アプリケーション固有のパスワードを追加する'; +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/lt.lang b/languages/lt.lang index c6a208e0..ed6a7959 100644 --- a/languages/lt.lang +++ b/languages/lt.lang @@ -502,6 +502,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP is already configured for this accoun $PALANG['pApp_passwords_add'] = 'Add application-specific password'; # XXX +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/mk.lang b/languages/mk.lang index dcbb4eb3..6c3f0528 100644 --- a/languages/mk.lang +++ b/languages/mk.lang @@ -497,6 +497,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP is already configured for this accoun $PALANG['pApp_passwords_add'] = 'Add application-specific password'; # XXX +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/nb.lang b/languages/nb.lang index 5d7cbb55..86fed9c4 100644 --- a/languages/nb.lang +++ b/languages/nb.lang @@ -497,6 +497,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP is already configured for this accoun $PALANG['pApp_passwords_add'] = 'Add application-specific password'; # XXX +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/nl.lang b/languages/nl.lang index 8575eb7a..c7792d0c 100644 --- a/languages/nl.lang +++ b/languages/nl.lang @@ -500,6 +500,15 @@ $PALANG['TOTP_already_configured'] = 'ToTP is al in beslag genomen voor deze rek $PALANG['pApp_passwords_add'] = 'Voeg een toepassing toe.'; +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/nn.lang b/languages/nn.lang index 15b596e3..c82cd8c1 100644 --- a/languages/nn.lang +++ b/languages/nn.lang @@ -496,6 +496,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP is already configured for this accoun $PALANG['pApp_passwords_add'] = 'Add application-specific password'; # XXX +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/pl.lang b/languages/pl.lang index e37e8358..5619986b 100644 --- a/languages/pl.lang +++ b/languages/pl.lang @@ -502,6 +502,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP jest już skonfigurowany za to, że c $PALANG['pApp_passwords_add'] = 'Addd Application-specific password'; +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/pt-br.lang b/languages/pt-br.lang index 93854c54..1d14d89f 100644 --- a/languages/pt-br.lang +++ b/languages/pt-br.lang @@ -509,6 +509,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP já está configurado para esta conta $PALANG['pApp_passwords_add'] = 'Adicionar senha específica do aplicativo'; +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/pt-pt.lang b/languages/pt-pt.lang index 90be1770..2f26bce8 100644 --- a/languages/pt-pt.lang +++ b/languages/pt-pt.lang @@ -509,6 +509,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP já está configurado para esta conta $PALANG['pApp_passwords_add'] = 'Adicionar senha específica do aplicativo'; +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/ro.lang b/languages/ro.lang index f9f7d505..2b1b78d2 100644 --- a/languages/ro.lang +++ b/languages/ro.lang @@ -508,6 +508,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP is already configured for this accoun $PALANG['pApp_passwords_add'] = 'Add application-specific password'; # XXX +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/ru.lang b/languages/ru.lang index 70e441b6..b39b46a4 100644 --- a/languages/ru.lang +++ b/languages/ru.lang @@ -510,6 +510,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP уже настроен для это $PALANG['pApp_passwords_add'] = 'Добавить пароль для приложения'; +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/sk.lang b/languages/sk.lang index e621d47b..6ab6ac07 100644 --- a/languages/sk.lang +++ b/languages/sk.lang @@ -497,6 +497,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP je už nakonfigurovaný pre tento ú $PALANG['pApp_passwords_add'] = 'Pridať aplikačné konkrétne heslo'; +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/sl.lang b/languages/sl.lang index 7a4a2575..1721a932 100644 --- a/languages/sl.lang +++ b/languages/sl.lang @@ -496,6 +496,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP is already configured for this accoun $PALANG['pApp_passwords_add'] = 'Add application-specific password'; # XXX +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/sv.lang b/languages/sv.lang index e3c58f6d..0365a3f3 100644 --- a/languages/sv.lang +++ b/languages/sv.lang @@ -509,6 +509,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP är redan konfigurerat för detta kon $PALANG['pApp_passwords_add'] = 'Lägg till programspecifikt lösenord'; +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/tr.lang b/languages/tr.lang index a4e9379a..cb3cbb01 100644 --- a/languages/tr.lang +++ b/languages/tr.lang @@ -496,6 +496,15 @@ $PALANG['TOTP_already_configured'] = 'TOTP zaten bu hesap için yapılandırılm $PALANG['pApp_passwords_add'] = 'Uygulamaya özel şifre ekleyin'; +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/tw.lang b/languages/tw.lang index 0d833957..8813d5fc 100644 --- a/languages/tw.lang +++ b/languages/tw.lang @@ -498,6 +498,15 @@ $PALANG['TOTP_already_configured'] = '你是否想改变你的秘密?'; $PALANG['pApp_passwords_add'] = '添加针对具体申请的密码'; +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/languages/ua.lang b/languages/ua.lang index 12ef045a..5969038f 100644 --- a/languages/ua.lang +++ b/languages/ua.lang @@ -511,6 +511,15 @@ $PALANG['TOTP_already_configured'] = 'Щоб змінити секрет?'; $PALANG['pApp_passwords_add'] = 'Додавання пароля електронної пошти'; +$PALANG['pUpdate_title'] = 'Update Check'; # XXX +$PALANG['pUpdate_current_version'] = 'Current version'; # XXX +$PALANG['pUpdate_up_to_date'] = 'You are running the latest version.'; # XXX +$PALANG['pUpdate_available'] = 'A newer version is available'; # XXX +$PALANG['pUpdate_view_release'] = 'View release on GitHub'; # XXX +$PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX +$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX +$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX +$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/public/update-check.php b/public/update-check.php new file mode 100644 index 00000000..c809ac26 --- /dev/null +++ b/public/update-check.php @@ -0,0 +1,145 @@ + $headers + * @return string|false + */ +function http_fetch(string $url, int $timeout = 10, array $headers = []) +{ + if (function_exists('curl_init')) { + $ch = curl_init($url); + if ($ch === false) { + return false; + } + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); + curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); + curl_setopt($ch, CURLOPT_USERAGENT, 'PostfixAdmin-UpdateCheck'); + if (!empty($headers)) { + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + } + $response = curl_exec($ch); + $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); + curl_close($ch); + if (!is_string($response) || $http_code >= 400) { + return false; + } + return $response; + } + + // Fallback to file_get_contents (requires allow_url_fopen) + $context = stream_context_create([ + 'http' => [ + 'method' => 'GET', + 'header' => array_merge(['User-Agent: PostfixAdmin-UpdateCheck'], $headers), + 'timeout' => $timeout, + 'follow_location' => true, + ], + ]); + + /** @psalm-suppress InvalidArgument */ + return @file_get_contents($url, false, $context); +} + +/** + * Normalize a version tag to a comparable version string. + * Handles formats like "v4.0.1", "postfixadmin-3.3.16", "3.3.8". + */ +function normalize_version(string $tag): string +{ + // Note: 'postfxadmin-' (missing 'i') is intentional - there is a tag with this typo in the repo + $result = preg_replace('/^(postfixadmin-|postfxadmin-|v)/i', '', $tag); + return $result ?? $tag; +} + +// --- Main logic --- + +$error = ''; +$latest_release = null; +$newer_releases = []; +$update_available = false; + +$has_curl = function_exists('curl_init'); +$allow_url_fopen = (bool)ini_get('allow_url_fopen'); +$can_fetch = $has_curl || $allow_url_fopen; + +if (!$can_fetch) { + $error = Config::lang('pUpdate_fetch_error'); +} else { + $response = http_fetch( + 'https://api.github.com/repos/postfixadmin/postfixadmin/releases?per_page=100', + 10, + ['Accept: application/vnd.github.v3+json'] + ); + + if ($response === false) { + $error = Config::lang('pUpdate_network_error'); + } else { + $releases = json_decode($response, true); + if (!is_array($releases) || isset($releases['message'])) { + // GitHub may return {"message": "rate limit exceeded"} or similar + $error = Config::lang('pUpdate_network_error'); + } else { + foreach ($releases as $release) { + if (!empty($release['draft']) || !empty($release['prerelease'])) { + continue; + } + + $release_version = normalize_version($release['tag_name']); + + if (version_compare($release_version, $current_version, '>')) { + $release['normalized_version'] = $release_version; + $newer_releases[] = $release; + } + } + + usort($newer_releases, function ($a, $b) { + return version_compare($b['normalized_version'], $a['normalized_version']); + }); + + if (!empty($newer_releases)) { + $update_available = true; + $latest_release = $newer_releases[0]; + } + } + } +} + +$smarty->assign('current_version', $current_version); +$smarty->assign('error', $error); +$smarty->assign('update_available', $update_available); +$smarty->assign('latest_release', $latest_release); +$smarty->assign('newer_releases', $newer_releases); +$smarty->assign('smarty_template', 'update-check'); +$smarty->display('index.tpl'); +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ diff --git a/templates/index.tpl b/templates/index.tpl index 08616ddf..e3e016b0 100644 --- a/templates/index.tpl +++ b/templates/index.tpl @@ -60,10 +60,16 @@ {else} Postfix Admin {$version} + {if $authentication_has_role.global_admin} +  |  + {$PALANG.check_update} + + {else}  |  {$PALANG.check_update} + {/if} {if isset($smarty.session.sessid)} {if $smarty.session.sessid.username}    |    diff --git a/templates/menu.tpl b/templates/menu.tpl index d45d6c93..b875405e 100644 --- a/templates/menu.tpl +++ b/templates/menu.tpl @@ -210,6 +210,13 @@ {$PALANG.pMenu_password} {/if} + {* update check *} + {if $authentication_has_role.global_admin} +
  • + + {$PALANG.pUpdate_title}
  • + {/if} {* backup *} {if $authentication_has_role.global_admin && $CONF.database_type!=='pgsql' && $CONF.backup === 'YES'}
  • +
    +

    {$PALANG.pUpdate_title}

    +
    +
    +

    {$PALANG.pUpdate_current_version}: {$current_version}

    + + {if $error} +
    {$error}
    +
    + + {$PALANG.pUpdate_check_releases} + + {elseif !$update_available} +
    + + {$PALANG.pUpdate_up_to_date} +
    + {else} +
    + + {$PALANG.pUpdate_available}: + {$latest_release.normalized_version} +
    + + + + {$PALANG.pUpdate_view_release} + + {/if} +
    + + +{if $update_available && $newer_releases|@count > 0} +
    +
    +

    {$PALANG.pUpdate_changelog}

    +
    +
    + {foreach from=$newer_releases item=release} +
    +
    + + {$release.normalized_version} + + + — {$release.published_at|truncate:10:''} + +
    + {if $release.body} +
    +
    {$release.body}
    +
    + {/if} +
    + {if !$release@last}
    {/if} + {/foreach} +
    +
    +{/if}