dsoares / roundcube-lastlogin

Roundcube plugin to save and show user login information and login history.
GNU General Public License v3.0
16 stars 12 forks source link

Improvements on Geolocation information #15

Closed xptp228 closed 8 years ago

xptp228 commented 8 years ago

Hi,

I noticed that the on geolocation information, the city and region variables, for some reason are not obtained, and in the BD we will have ", , country", the commas that separate the city and region are always placed. Later, i will also have a look on why the geolocation function is not retrieving the 3 variables...

But for now, I suggest a small change in line 385 of file lastlogin.php

To replace... $geo = sprintf ("% s% s% s", $geo [ 'city'], $geo [ 'region'], $geo [ 'country']);

for... $geo = array_map('trim', $geo); $geo = array_filter($geo); $geo = implode (", ", $geo);

If there is no city or region variables from geolocation, the final string is always be clean, the string will only contain the value of the variables obtained. If geolocation only obtain the country value, the string will only have "country", if we obtain the others values, the string will be "city, region, country".

Congratulations and keep up with the good work.

dsoares commented 8 years ago

Hi, That's a good suggestion, i'll change the code accordingly.

Later, i will also have a look on why the geolocation function is not retrieving the 3 variables...

If you're using the system method, check the output of the command line geoiplookup <the_ip> and that you have the Maxmind databases correctly installed.

xptp228 commented 8 years ago

Hi,

It seems that geolocation only give me the country and the gps coordinates

I will try to see if this information is somehow collected by geolocation somewhere or if it's him that converts GPS coordinates into it . For some reason, in my case this is not happening.

A 04-08-2016 12:56, dsoares escreveu:

Hi, That's a good suggestion, i'll change the code accordingly.

Later, i will also have a look on why the geolocation function is not retrieving the 3 variables...

If you're using the system method, check the output of the command line geoiplookup and that you have the Maxmind databases [1] correctly installed.

You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub [2], or mute the thread [3].

Atenciosamente Paulo Pereira

Links:

[1] http://dev.maxmind.com/geoip/ [2] https://github.com/dsoares/Roundcube-Plugin-Lastlogin/issues/15#issuecomment-237532074 [3] https://github.com/notifications/unsubscribe-auth/AEsY3SFuPG7SaisZnqZwFQafow1ih25Bks5qcdNogaJpZM4Jcl7D

dsoares commented 8 years ago

Implemented in release 0.1.6.

If you need some help configuring the geolocation information, please open a new issue. Thank you for the suggestion.

xptp228 commented 8 years ago

Hi,

I got it... the problem is in the source... if you use the system or geoplugin.net drivers, the problem occurs, because they are not delivering the city and region info, in the other way the geoiptool is, and with it all works fine.

Once again... thanks and keep up the good work

A 04-08-2016 16:00, dsoares escreveu:

Implemented in release 0.1.6 [1].

If you need some help configuring the geolocation information, please open a new issue. Thank you for the suggestion.

You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub [2], or mute the thread [3].

Atenciosamente Paulo Pereira

Links:

[1] https://github.com/dsoares/Roundcube-Plugin-Lastlogin/releases/tag/0.1.6 [2] https://github.com/dsoares/Roundcube-Plugin-Lastlogin/issues/15#issuecomment-237580131 [3] https://github.com/notifications/unsubscribe-auth/AEsY3XCmeLKjpGVCDdlvQjMSvOYmDn0eks5qcf56gaJpZM4Jcl7D