<participant>
     <quickSearch><![CDATA[MM_Logoutnow]]></quickSearch>
     <insertText location="aboveHTML+8">
<![CDATA[
<%
// *** Logout the current user.
String MM_Logout = request.getRequestURI() + "?MM_Logoutnow=1";
if (request.getParameter("MM_Logoutnow") != null && request.getParameter("MM_Logoutnow").equals("1")) {
  session.putValue("@@MM_username@@", "");
  session.putValue("@@MM_userAuthorization@@", "");
  String MM_logoutRedirectPage = "@@redirectPage@@";
  // redirect with URL parameters (remove the "MM_Logoutnow" query param).
  if (MM_logoutRedirectPage.equals("")) MM_logoutRedirectPage = request.getRequestURI();
  if (MM_logoutRedirectPage.indexOf("?") == -1 && request.getQueryString() != null) {
    String MM_newQS = request.getQueryString();
    String URsearch = "MM_Logoutnow=1";
    int URStart = MM_newQS.indexOf(URsearch);
    if (URStart >= 0) {
      MM_newQS = MM_newQS.substring(0,URStart) + MM_newQS.substring(URStart + URsearch.length());
    }
    if (MM_newQS.length() > 0) MM_logoutRedirectPage += "?" + MM_newQS;
  }
  response.sendRedirect(response.encodeRedirectURL(MM_logoutRedirectPage));
  return;
}
%>
]]>
     </insertText>
     <searchPatterns whereToSearch="directive">
       <searchPattern paramNames="" limitSearch="all"><![CDATA[/request\.getParameter\s*\(\s*"MM_Logoutnow"\s*\)/]]></searchPattern>
       <searchPattern paramNames="redirectPage" limitSearch="all"><![CDATA[/String\s+MM_logoutRedirectPage\s*=\s*"([^\r\n]*)"/]]></searchPattern>
       <searchPattern paramNames="redirectPage_url" limitSearch="all"><![CDATA[/String\s+MM_logoutRedirectPage\s*=\s*"([^\r\n]*)"/]]></searchPattern>
     </searchPatterns>
</participant>
