public static function on_logout() { global $CFG, $USER, $DB; $user2plugin = helpmenow_user2plugin_gotomeeting::get_user2plugin(); # see if the user is still logged in to a different queue/office $sql = "\n SELECT 1\n WHERE EXISTS (\n SELECT 1\n FROM {block_helpmenow_helper}\n WHERE userid = {$USER->id}\n AND isloggedin <> 0\n )\n OR EXISTS (\n SELECT 1\n FROM {block_helpmenow_user}\n WHERE userid = {$USER->id}\n AND isloggedin <> 0\n )\n "; # if they aren't, delete the meeting info from user2plugin record and update the db if (!$DB->record_exists_sql($sql)) { foreach (array('join_url', 'max_participants', 'unique_meetingid', 'meetingid') as $attribute) { $user2plugin->{$attribute} = null; } return $user2plugin->update(); } return true; }