diff --git a/README.md b/README.md index 9ee73a7..59679a6 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # μlogger -This is a web application for real-time collection of geolocation data, tracks viewing and management. +This is a web application for real-time collection of geolocation data, tracks viewing and management. Together with a dedicated [μlogger mobile client](https://github.com/bfabiszewski/ulogger-android) it may be used as a complete self hosted server–client solution for logging and monitoring users' geolocation. ## Live demo: @@ -8,7 +8,7 @@ Together with a dedicated [μlogger mobile client](https://github.com/bfabiszews ## Requirements: - PHP 5.5 -- MYSQL 4.1 +- MySQL 4.1 - browser with javascript enabled, cookies for authentication and saving preferences ## Features: @@ -20,20 +20,20 @@ Together with a dedicated [μlogger mobile client](https://github.com/bfabiszews - user authentication - Google Maps API v3 - OpenLayers v2 (OpenStreet and other layers) -- ajax +- ajax - user preferences stored in cookies - simple admin menu ## Install -1. Download the zip or clone the repository on your computer -2. Move it to your web server directory -3. Import the script/ulogger.sql file into a mysql database (you can use a msql interface such as [PhpMyAdmin](https://www.phpmyadmin.net).) -4. Create a copy of config.default.php and rename it config.php. Add database credentials in it. -5. Make sure your server is running (web server, eg. Apache, PHP and MySQL) -6. Go to http://your_local_server/ulogger-server/) -7. Connect with admin/admin -8. Change admin password -9. Create other user if needed +- Download the zip or clone the repository on your computer +- Move it to your web server directory +- Use script/ulogger.sql file to create database and tables (you can use a MySQL interface such as [PhpMyAdmin](https://www.phpmyadmin.net)) +- Create a copy of config.default.php and rename it config.php. Add database credentials in it +- Make sure you have a web server running, e.g. Apache, also PHP and MySQL +- Open a browser and go to http://your_local_server/ulogger-server/ +- Connect with admin/admin +- **Change admin password** +- Create other user if needed ## Todo - install script @@ -44,4 +44,4 @@ Together with a dedicated [μlogger mobile client](https://github.com/bfabiszews ## License - GPL - μlogger is a fork of phpTrackme - tracks viewer I wrote for TrackMe app -- most icons come from iconmonstr +- most icons come from [iconmonstr](https://iconmonstr.com) diff --git a/auth.php b/auth.php index 7b69d6d..33307e2 100755 --- a/auth.php +++ b/auth.php @@ -44,7 +44,7 @@ if (!$user->isValid && ($config::$require_authentication || defined('headless')) $ssl = ((!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "" || $_SERVER['HTTPS'] == "off") ? "http" : "https"); $auth_error = (isset($_REQUEST['auth_error']) ? $_REQUEST['auth_error'] : 0); - if (!$login){ + if (!$login) { // not authenticated and username not submited // load form if (defined('headless')) { @@ -54,9 +54,9 @@ if (!$user->isValid && ($config::$require_authentication || defined('headless')) ' - '.$lang["title"].' - - + ' . $lang["title"] . ' + + '; -} -print ' + + $mysqli->close(); +?> + - ' . $lang["title"] . ' - - - + <?= $lang["title"] ?> + + + -'; -if ($config::$mapapi == "gmaps") { - print ' - -'; -} else { - print ' - -'; -} -print ' - ' . $adminScript . ' - - - + + + + + + + + isAdmin): ?> + + + + + - + + +
- +
- -'; -$mysqli->close(); -?> + + \ No newline at end of file diff --git a/logout.php b/logout.php index 46f25b0..e2c1e46 100755 --- a/logout.php +++ b/logout.php @@ -20,12 +20,12 @@ session_name('ulogger'); session_start(); $_SESSION = NULL; -if (isset($_COOKIE[session_name('ulogger')])) { - setcookie(session_name('ulogger'),'',time()-42000,'/'); +if (isset($_COOKIE[session_name('ulogger') ])) { + setcookie(session_name('ulogger'), '', time() - 42000, '/'); } session_destroy(); $ssl = ((!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "" || $_SERVER['HTTPS'] == "off") ? "http" : "https"); -$url = str_replace("//", "/", $_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME'])."/index.php"); +$url = str_replace("//", "/", $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']) . "/index.php"); header("Location: $ssl://$url"); ?> \ No newline at end of file diff --git a/main.js b/main.js index d21533b..7ce3ba2 100755 --- a/main.js +++ b/main.js @@ -174,39 +174,39 @@ function getPopupHtml(p, i, count) { var time = dateTime[1]; var provider = ''; if (p.provider == 'gps') { - provider = ' (' + lang['gps'] + ')'; + provider = ' (' + lang['gps'] + ')'; } else if (p.provider == 'network') { - provider = ' (' + lang['network'] + ')'; + provider = ' (' + lang['network'] + ')'; } var stats = ''; if (latest == 0) { stats = '
' + - '
' + - '' + lang['ttime'] + ' ' + - p.totalSeconds.toHMS() + '
' + - '' + lang['aspeed'] + ' ' + - ((p.totalSeconds > 0) ? ((p.totalMeters / p.totalSeconds).toKmH() * factor_kmh).toFixed() : 0) + ' ' + unit_kmh + '
' + - '' + lang['tdistance'] + ' ' + - (p.totalMeters.toKm() * factor_km).toFixed(2) + ' ' + unit_km + '
' + '
'; + '' + lang['track'] + '
' + + '' + lang['ttime'] + ' ' + + p.totalSeconds.toHMS() + '
' + + '' + lang['aspeed'] + ' ' + + ((p.totalSeconds > 0) ? ((p.totalMeters / p.totalSeconds).toKmH() * factor_kmh).toFixed() : 0) + ' ' + unit_kmh + '
' + + '' + lang['tdistance'] + ' ' + + (p.totalMeters.toKm() * factor_km).toFixed(2) + ' ' + unit_km + '
' + ''; } popup = '