Compare commits

...

12 commits

Author SHA1 Message Date
Marius Lindvall
6b3d8dcbec
Merge pull request #169 from tuffnerdstuff/bugfix/null-acc-session-expired
setting accuracy circle also when acc == null
2024-05-24 23:05:24 +02:00
Marius Lindvall
0bbea4fe64
Code style consistency 2024-05-24 22:59:48 +02:00
Marius Lindvall
63f901b17a
Merge pull request #183 from mansguiche/fix-assumes-ldap-on-no-htpasswd-file-found
Fix incorrectly reporting LDAP errors when cannot find HTPASSWD file
2024-05-24 22:48:50 +02:00
Marius Lindvall
7dea87aef9
Fix indentation 2024-05-24 22:28:22 +02:00
Marius Lindvall
50f93c1246
Merge pull request #196 from otbutz/patch-1
Use preferred OSM tile URL
2024-05-24 22:22:45 +02:00
Marius Lindvall
2a7e9ac0b0
Fix stable tag 2023-08-13 16:23:48 +02:00
otbutz
085ca4ee97
Use preferred OSM tile URL 2023-06-30 14:40:24 +02:00
Luke Manson
56e216375c Fixed translation key 2022-04-06 21:56:09 +01:00
Luke Manson
ec223ba4e6 Adds translations for password file missing error 2022-04-06 21:44:19 +01:00
Luke Manson
a0287e2c13 Drop out of authenticated() function when cannot find htpasswd file. 2022-04-06 21:34:30 +01:00
tuffnerdstuff
02ccb4fcd2 Checking accuracy circle !== null when setting color 2021-04-01 14:55:08 +02:00
tuffnerdstuff
9d637c5b58 setting accuracy circle also when acc == null 2021-03-29 23:16:40 +02:00
16 changed files with 36 additions and 20 deletions

View file

@ -34,7 +34,7 @@ jobs:
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.x-stable
type=semver,pattern=stable-{{major}}.x
- # Log in to Docker Hub
name: Login to Docker Hub
if: github.event_name != 'pull_request'

View file

@ -136,7 +136,7 @@ const DEFAULTS = array(
"reserved_links" => [],
"reserve_whitelist" => false,
"link_style" => LINK_4_PLUS_4_UPPER_CASE,
"map_tile_uri" => 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
"map_tile_uri" => 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
"map_attribution" => 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
"default_zoom" => 14,
"max_zoom" => 19,
@ -807,18 +807,18 @@ function authenticated() {
global $LANG;
if (!isset($_POST["usr"])) die($LANG["username_required"]);
requirePOST("pwd", "usr");
if (file_exists(getConfig("htpasswd_path"))) {
$file = fopen(getConfig("htpasswd_path"), "r");
$authed = false;
while (($line = fgets($file)) !== false && !$authed) {
$creds = explode(":", trim($line));
if ($creds[0] == $_POST["usr"]) {
$authed = password_verify($_POST["pwd"], $creds[1]);
}
// Jump out if we cannot find the htpasswd file.
if (!file_exists(getConfig("htpasswd_path"))) die($LANG["cannot_find_password_file"]);
$file = fopen(getConfig("htpasswd_path"), "r");
$authed = false;
while (($line = fgets($file)) !== false && !$authed) {
$creds = explode(":", trim($line));
if ($creds[0] == $_POST["usr"]) {
$authed = password_verify($_POST["pwd"], $creds[1]);
}
fclose($file);
return $authed;
}
fclose($file);
return $authed;
case LDAP:
// LDAP-based authentication.

View file

@ -18,3 +18,4 @@ $LANG['invalid_storage'] = 'Heu establert un storage_backend d\'emmagatzematge n
$LANG['no_redis_ext'] = 'No hi ha habilitada cap extensió redis compatible (redis) a la vostra configuració PHP!';
$LANG['no_memcached_ext'] = 'No hi ha habilitada cap extensió confidencial (memcache o memcached) a la configuració de PHP!';
$LANG['config_missing'] = 'No es pot trobar config.php!';
$LANG['cannot_find_password_file'] = 'No es troba el fitxer de contrasenya!';

View file

@ -24,3 +24,4 @@ $LANG['ldap_search_failed'] = 'Benutzer konnte am LDAP Server nicht gefunden wer
$LANG['ldap_connection_failed'] = 'Fehler beim Verbinden zum LDAP Server!';
$LANG['ldap_config_error'] = 'LDAP-Verbindungsparameter konnten nicht eingestellt werden!';
$LANG['ldap_extension_missing'] = 'Die LDAP Erweiterung ist in der PHP config nicht aktiviert!';
$LANG['cannot_find_password_file'] = 'Kennwortdatei kann nicht gefunden werden!';

View file

@ -24,3 +24,4 @@ $LANG['ldap_connection_failed'] = 'Failed to connect to the LDAP server!';
$LANG['ldap_search_failed'] = 'Failed to look up user on the LDAP server!';
$LANG['ldap_user_unauthorized'] = 'User not found, not authorized, or incorrect password!';
$LANG['ldap_search_ambiguous'] = 'Matched multiple users - the LDAP filter is too broad!';
$LANG['cannot_find_password_file'] = 'Cannot find password file!';

View file

@ -15,3 +15,4 @@ $LANG['share_mode_unsupported'] = 'Euskarririk gabeko parekatze modua!';
$LANG['group_pin_invalid'] = 'Baliogabeko talde PIN-a!';
$LANG['session_invalid'] = 'Saio baliogabea!';
$LANG['location_invalid'] = 'Kokaleku baliogabea!';
$LANG['cannot_find_password_file'] = 'Ezin da pasahitz fitxategia aurkitu!';

View file

@ -24,3 +24,4 @@ $LANG['ldap_extension_missing'] = 'L\'extension LDAP n\'est pas activée dans vo
$LANG['e2e_adoption_not_allowed'] = 'Ce partage est protégé par un mot de passe et ne peut pas être adopté !';
$LANG['group_e2e_unsupported'] = 'Les partages de groupe ne peuvent pas être protégés par un mot de passe !';
$LANG['username_required'] = 'Nom d\'utilisateur requis !';
$LANG['cannot_find_password_file'] = 'Impossible de trouver le fichier de mot de passe !';

View file

@ -24,3 +24,4 @@ $LANG['invalid_storage'] = 'storage_backend non è impostata correttamente in Ha
$LANG['no_redis_ext'] = 'Nessuna estensione compatibile con redi (redi) è attiva nella tua configurazione PHP!';
$LANG['no_memcached_ext'] = 'Nessuna estensione compatibile con memcached (memecache o memecached) è attiva nella tua configurazione PHP!';
$LANG['config_missing'] = 'Impossibile trovare config.php!';
$LANG['cannot_find_password_file'] = 'Impossibile trovare il file della password!';

View file

@ -24,3 +24,4 @@ $LANG['ldap_search_failed'] = 'Fout tijdens het opzoeken van de gebruiker op de
$LANG['ldap_connection_failed'] = 'Kan geen verbinding maken met de LDAP server!';
$LANG['ldap_config_error'] = 'Niet gelukt om LDAP connectieparameters in te stellen!';
$LANG['ldap_extension_missing'] = 'De LDAP extensie is niet actief in uw PHP configuratie!';
$LANG['cannot_find_password_file'] = 'Kan geen wachtwoordbestand vinden!';

View file

@ -24,3 +24,4 @@ $LANG['ldap_search_failed'] = 'Kunne ikkje slå opp brukaren på LDAP-serveren!'
$LANG['ldap_connection_failed'] = 'Kunne ikkje kopla til LDAP-serveren!';
$LANG['ldap_config_error'] = 'Kunne ikkje setja LDAP-tilkoplingsparametrar!';
$LANG['ldap_extension_missing'] = 'ldap-utvidinga er ikkje aktivert i PHP-konfigurasjonen din!';
$LANG['cannot_find_password_file'] = 'Kan ikke finne passordfil!';

View file

@ -24,3 +24,4 @@ $LANG['share_not_found'] = 'Ta sesja nie istnieje!';
$LANG['session_expired'] = 'Sesja wygasła!';
$LANG['invalid_storage'] = 'Ustawiłeś niepoprawny storage_backend w Hauk!';
$LANG['config_missing'] = 'Nie można odnaleźć pliku config.php!';
$LANG['cannot_find_password_file'] = 'Nie można znaleźć pliku hasła!';

View file

@ -24,3 +24,4 @@ $LANG['ldap_search_failed'] = 'Nu s-a putut găsi utilizatorul pe serverul LDAP!
$LANG['ldap_connection_failed'] = 'Nu s-a putut face conexiunea cu serverul LDAP!';
$LANG['ldap_config_error'] = 'Nu s-au putut seta parametrii conexiunii LDAP!';
$LANG['ldap_extension_missing'] = 'Extensia ldap nu este activată în configurația PHP!';
$LANG['cannot_find_password_file'] = 'Nu pot găsi fișierul de parolă!';

View file

@ -15,3 +15,4 @@ $LANG['invalid_storage'] = 'У вас неверный storage_backend для Ha
$LANG['no_redis_ext'] = 'Нет включенных совместимых расширений redis в вашей конфигурации PHP!';
$LANG['no_memcached_ext'] = 'Нет включенных совместимых расширений в вашей конфигурации PHP (memcache or memcached)!';
$LANG['config_missing'] = 'Не могу найти config.php!';
$LANG['cannot_find_password_file'] = 'Не удается найти файл пароля';

View file

@ -24,3 +24,4 @@ $LANG['username_required'] = 'Kullanıcı adı gerekli!';
$LANG['incorrect_password'] = 'Hatalı parola!';
$LANG['session_expired'] = 'Oturum süresi doldu!';
$LANG['config_missing'] = 'config.php bulunamıyor!';
$LANG['cannot_find_password_file'] = 'Şifre dosyasını bulamıyor';

View file

@ -15,3 +15,4 @@ $LANG['group_pin_invalid'] = 'Невірний груповий PIN!';
$LANG['session_invalid'] = 'Недійсний сеанс!';
$LANG['location_invalid'] = 'Недійсне місцезнаходження!';
$LANG['config_missing'] = 'Не можу знайти config.php!';
$LANG['cannot_find_password_file'] = 'Не вдається знайти файл пароля';

View file

@ -872,19 +872,13 @@ function processUpdate(data, init) {
}
eLastSeen.textContent = unit.split("{{time}}").join(time);
}
shares[user].circle.setStyle({
fillColor: STATE_DEAD_COLOR,
color: STATE_DEAD_COLOR
})
setAccuracyCircleColor(shares[user].circle, STATE_DEAD_COLOR);
} else {
eArrow.className = eArrow.className.split("dead").join(shares[user].state);
if (eLabel !== null) eLabel.className = shares[user].state;
var iconColor = STATE_LIVE_COLOR;
if (shares[user].state == "rough") iconColor = STATE_ROUGH_COLOR;
shares[user].circle.setStyle({
fillColor: iconColor,
color: iconColor
});
setAccuracyCircleColor(shares[user].circle, iconColor);
}
}
}
@ -906,6 +900,15 @@ function processUpdate(data, init) {
}
}
function setAccuracyCircleColor(circle, color) {
if (circle) {
circle.setStyle({
fillColor: color,
color: color
});
}
}
// Calculates the distance between two points on a sphere using the Haversine
// algorithm.
function distance(from, to) {