Is there an easy way to track or store the browser user-agent? Some of my users are starting on a desktop then switching over to ipads and sometimes running into problems. I'd like to be able to identify users by their browser type without having to match sessions and pages back to the server logs.
You may want to check the core_useragent class and its methods.
Er, no? This class can tell me about the useragent, but it does nothing to record it anywhere. It doesn't look like moodle ever records information the users other than their IP.
Looks like I'll have to modify datalib's user_accesstime_log and do something like add a column to either {user} or {user_lastaccess}, and do something like:
$DB->set_field('user_lastaccess', 'useragent', $_SERVER['HTTP_USER_AGENT'], array('userid'=>$USER->id, 'courseid'=>$courseid));
seems odd that there's no detail stored on a users browsing experience. I guess people just rely on analytics and not be concerned that it's not tied to an individual session.