Moodle block – online users map
I’ve just finished writing a new Moodle block, which is a variation on the standard online users block, but rather than showing a list of users, it uses the location information from users profiles to display online users on a Google map:

You can download this block from Moodle.org – or it’s in the Moodle contrib CVS
All feedback welcome – please post any comments/feedback etc below











Well i guess there is no more support for the block. Oh well, it looked nice.
hmmm… it’s not that I don’t want to continue to support the block-but now that I’m based in Ethiopia, I generally don’t have a good enough internet connection to be able to support it (Google Maps barely runs at all on the speed of connection we have).
I’m sure that most of the problems people are currently having are due to either (1) a problem with the server getting access to the geonames site or (2) the locations being looked up not being in the geonames database. However I don’t really have the time to look at each individual problem.
Also, the block code is in Moodle CVS so if anyone else is interested in maintaining or developing the block, then I’m quite happy for them to do so.
Sorry I can’t be of much more help.
Alex
Hello Alex,
Ethiopia ! oh boy, that’s a remote location alright ! No wonder, i guess i would like to continue the coding,
i really use it a lot as it is very important in our community.
I have some programming experience in php, perl, and C++, where do you recommend i start ?
Regards,
Uddhava dasa
Hello Alex,
in cron say :
————————————-
Processing cron function for online_users_map….
SimpleXML extension is loaded
Updating location for Ahmed Chabli (looking up: Dar El Beida Alger,DZ )…
Bad Gateway!
*/–>
Bad Gateway!
The proxy server received an invalid
response from an upstream server.
If you think this is a server error, please contact
the webmaster.
Error 502
ws.geonames.org
Mon Sep 28 20:28:41 2009
Apache/2.2.10 (Linux/SUSE)
——————————————————-
How can i do ????
Thanks
I keep seeing this problem with the bad gateway message too, but as far as I can tell it’s a problem with the geonames site rather than the block – if anyone knows any different then I’m happy to change the block to fix this problem. So unfortunately not much I can do about this – also difficult for me to currently test, but will look into it further when I have chance.
HI Alex
I have installed online_users_map block on a moodle 1.9 site.
The block see very nice but not present the users on the map
Cron jobs are run on this site every 5 minutes.
I ran a cron job from my computer and this gave the following result:
——————————————————–
Server Time: Wed, 14 Oct 2009 11:22:59 -0300
Starting activity modules
Processing module function assignment_cron …done.
Processing module function chat_cron …done.
Processing module function forum_cron …Starting digest processing…
Cleaned old digest records
done.
Processing module function scorm_cron …done.
Processing module function dimdim_cron …done.
Finished activity modules
Starting blocks
Processing cron function for rss_client….
0 feeds refreshed (took 0.00857 seconds)
done.
Processing cron function for search….Global searching is not enabled. Nothing performed by search.
done.
Processing cron function for email_list….done.
Processing cron function for online_users_map….
SimpleXML extension is loaded
Updating location for Admin User (looking up: Buenos Aires,AR )…
Bad Gateway!
*/–>
Bad Gateway!
The proxy server received an invalid
response from an upstream server.
If you think this is a server error, please contact
the webmaster.
Error 502
ws.geonames.org
Wed Oct 14 16:23:00 2009
Apache/2.2.10 (Linux/SUSE)
location not found in Geonames database
Updating location for Ricardo Piegari (looking up: Buenos Aires,AR )…
Bad Gateway!
*/–>
Bad Gateway!
The proxy server received an invalid
response from an upstream server.
If you think this is a server error, please contact
the webmaster.
Error 502
ws.geonames.org
Wed Oct 14 16:23:01 2009
Apache/2.2.10 (Linux/SUSE)
———————————————————————-
and the rest ….
Can you help me ?
Congratulations for the block
Ricardo
Hi Ricardo – I’ve seen this problem a few times now – there are some other messages above about it. As far as I can tell it’s a problem with the connection to geonames webservice – so I don’t know if there’s much I can do about it. It’s rather difficult for me at the moment to look into a solution as I’m currently based in Ethiopia and our network connection doesn’t allow for testing services like this very well
Sorry I can’t help out much now – hope to be able to get it sorted properly when I return to UK. Alex
Just want to pile on and say that I’m seeing the same error with the whole bad gateway thing.
Hi, nobody found a solution to this Bad Gateway Error yet?
Thanks a lot!
Hi Raul,
I don’t think so yet. I’ll be back in UK in April so will be easier for me to try and figure the problem out when I’m there – still in Ethiopia until then and connection isn’t great for testing.
Apologies for the inconvenience – I would really like to get it sorted too! Alex
I think I’ve got the ‘bad gateway’ issue resolved now. Turned out that I wasn’t constructing the calls to the Geonames service correctly. It may take a day or so for the download packages (from the Moodle Modules and Plugins page: http://moodle.org/mod/data/view.php?rid=890&page=448) to be recreated with the fix- or go to CVS to get the fixed version now.
I’ve not yet been able to test when the Moodle server requires a proxy to access the internet – if anyone could give this a go and let me know if it works ok that would be good.
Sorry it’s taken so long to get fixed
Cheers,
Alex
security issue:
everybody can grab the usernames of the 50 last users are publicly visible on the internet
solution : add change the code (twice) in getusers.php
$puser->username = “”; //LINE ADDED TO PREVENT USERNAMES VISABILITY
$puser->lastname = “”;
$puser->firstname = “”;
Renaat
Thanks for the feedback Renaat. I’ve updated the code now (& checked into Moodle contrib CVS) – so it won’t display the username (or the id number) of the user.
Cheers,
Alex
Hi from Spain,
I’m tring tu use your module en moodle 2.2 but it seems there is a problem with api of google in chrome browers. Do you recomend no to use it in moodle 2.x?
Thanks
Juan
Hi,
I’ve not tested this on the chrome browser, but it should be working on Moodle 2.x (once I get the other issues fixed that I mentioned in my other comment; http://alexlittle.net/blog/2010/12/29/updates-to-online-users-map/comment-page-1/#comment-8704),
Cheers, Alex
Hi, It should be working now again on my Moodle site, see: http://moodle.alexlittle.net. I’ve also released an updated version of the block (download from: http://moodle.org/plugins/view.php?plugin=block_online_users_map), This now uses Google Maps API v3. Cheers, Alex.