Thursday 24 August 06
Here’s a brief(ish) update and overview of how I’m getting on with the MSG-Moodle integration. Firstly, what I have got working….
- Got the presences showing on the forum postings (though this is not a ‘live’ display – only the point at which the page was generated)
- Connecting up to the ‘global’ user and storing their session id (and ensuring that it’s expired and regenerated at the correct time)
- MSG block – shows number of users online (though again not ‘live’ display)
- MSG block shows status and allows users to login/out and change status – what I’ve done for this so far is really only temporary, quite a few changes will need to be made before I would say it’s really working!
There are a few problems with what I’ve done so far:
- If the user is already logged in to MSG (eg via desktop or other browser window), I can pick up the fact that they are logged in, but I can’t ‘attach’ to their session as I can’t find out their jsessionid – so the only way the block currently works properly is if the user logs in to MSG via the block. A couple of potential solutions to this would be:
- Have another service on the BuddyXML server which provides the jsessionid for a given user – not sure how secure this would be, probably not very – as potentially people could get other users session ids…
- Just pass the Moodle session id with the request (the BuddyXML server can verify this using the validate page I’ve written in my block). This means the block wouldn’t need to try and keep track of the jsessionid at all. Not totally sure this would work well as probably will raise other problems – but can’t think exactly what just now!
Anyway, a way around this, providing we’re happy for people’s sessions to go offline if they visit another page for 5 mins and they’ve not got either the MSG desktop or another chat browser window open, would be to maintain a timestamp in Moodle of when jsessionid was last passed to the BuddyXML server. If it’s over 5mins (current default timeout on BuddyXML server?) then jsessionid is wiped.
Some of the solutions feel a bit ‘hacky’ to me, so maybe I’ll think of better ways to do some of these!
Still to do, apart from getting the above problems resolved!!
- Encryption/decryption of the user’s jabber id
- Verifying the Moodle session cookie – at the moment relying on user typing in password, but that’s just for my testing purposes
- Enabling the ‘Launch MSG window button’
- Enabling the click to chat function – so when user see’s someone is online in the forums in one click they can open a chat window to that user.
- Switch to using a simple service for getting a particular users presence – at the moment I get a list of all the current logged in users, and need to iterate though to find the particular user I’m looking for – this is ok for a short list but it there are many users this could get very time consuming (and a lot of redundant data being passed). So a simple service which just provided the presence for an individual user would be much better
There are still things to do after this (obviously!), for example checking that it’s all working using the new version of Moodle – with updated roles & permissions functionality, ensuring that the jabber id is correctly generated when the user registers, checking they have the opt in/out function etc etc etc!










