{"id":28,"date":"2007-01-22T12:46:17","date_gmt":"2007-01-22T11:46:17","guid":{"rendered":"http:\/\/technologies.kmi.open.ac.uk\/msg\/developer\/moodle-msg-block-installation-guide\/msg-moodle-block-how-it-works\/"},"modified":"2008-01-22T10:59:58","modified_gmt":"2008-01-22T09:59:58","slug":"msg-moodle-block-how-it-works","status":"publish","type":"page","link":"http:\/\/technologies.kmi.open.ac.uk\/msg\/developer\/msg-installation-guide\/msg-moodle-block-how-it-works\/","title":{"rendered":"MSG-Moodle Block - how it works"},"content":{"rendered":"

A brief video<\/a> shows how the MSG-Moodle authentication works.<\/p>\n

When a user logs in to Moodle (and they are enrolled on a course with MSG-Moodle configured), the javascript added to the Moodle theme header and footer is triggered to communicate with the MSG server. Firstly a call is made to check whether the user is already logged in to MSG (they may have the client open in another browser window), if they are logged in their presence icon is updated and another call is made to get the presences of their contacts who also have their presence icon showing on the current page (e.g. in a forum posting page).<\/p>\n

If the user is not logged in, they are automatically logged in to MSG. This happens by sending the MSG server the users current Moodle cookie. The MSG server then validates this cookie (by calling the validate.php service in MSG-Moodle block) and creates for the user an MSG session ID. A background process then starts on the MSG server to update the user and group membership information using the users.php and groups.php services in MSG-Moodle block.<\/p>\n

The javascript also triggers processes to run on the users’ browser to keep the number of online contacts up to date and to check for contacts presence changes, new messages etc. These processes are called repeatedly by making use of javascripts setTimeout() function. The processes running are:<\/p>\n