<participant>
	<insertText location="aboveHTML+81"><![CDATA[<%
// *** Validate request to log in to this site.
var MM_LoginAction = Request.ServerVariables("URL");
if (Request.QueryString != "") MM_LoginAction += "?" + Server.HTMLEncode(Request.QueryString);
var MM_valUsername = String(Request.Form("@@frmUsername@@"));
if (MM_valUsername != "undefined") {
  var MM_fldUserAuthorization = "@@fldAuthorization@@";
  var MM_redirectLoginSuccess = "@@redirectSuccess@@";
  var MM_redirectLoginFailed = "@@redirectFailed@@";

  var MM_loginSQL = "SELECT @@fldUsername@@, @@fldPassword@@";
  if (MM_fldUserAuthorization != "") MM_loginSQL += "," + MM_fldUserAuthorization;
  MM_loginSQL += " FROM @@table@@ WHERE @@fldUsername@@ = ? AND @@fldPassword@@ = ?";
  var MM_rsUser_cmd = Server.CreateObject ("ADODB.Command");
  MM_rsUser_cmd.ActiveConnection = MM_@@connection@@_STRING;
  MM_rsUser_cmd.CommandText = MM_loginSQL;
  MM_rsUser_cmd.Parameters.Append(MM_rsUser_cmd.CreateParameter("param1", @@param1Type@@, 1, @@param1Size@@, MM_valUsername)); // @@param1TypeDisplayName@@
  MM_rsUser_cmd.Parameters.Append(MM_rsUser_cmd.CreateParameter("param2", @@param2Type@@, 1, @@param2Size@@, Request.Form("@@frmPassword@@"))); // @@param2TypeDisplayName@@
  MM_rsUser_cmd.Prepared = true;
  var MM_rsUser = MM_rsUser_cmd.Execute();

  if (!MM_rsUser.EOF || !MM_rsUser.BOF) {
    // username and password match - this is a valid user
    Session("@@MM_username@@") = MM_valUsername;
    if (MM_fldUserAuthorization != "") {
      Session("@@MM_userAuthorization@@") = String(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value);
    } else {
      Session("@@MM_userAuthorization@@") = "";
    }
    if (String(Request.QueryString("accessdenied")) != "undefined" && @@redirectToReferrer@@) {
      MM_redirectLoginSuccess = Request.QueryString("accessdenied");
    }
    MM_rsUser.Close();
    Response.Redirect(MM_redirectLoginSuccess);
  }
  MM_rsUser.Close();
  Response.Redirect(MM_redirectLoginFailed);
}
%>]]></insertText>
	<searchPatterns whereToSearch="directive">
		<searchPattern paramNames="frmUsername,fldAuthorization,redirectSuccess,redirectFailed,fldUsername,fldPassword,table,connection,param1Type,param1Size,param2Type,param2Size,frmPassword,MM_username,MM_userAuthorization,redirectToReferrer" isOptional="false" limitSearch="all"><![CDATA[/\/\/ \*\*\* Validate request to log in to this site\.(?:\r\n|\r(?!\n)|\n)[ \t]*var MM_LoginAction = Request\.ServerVariables\("URL"\);(?:\r\n|\r(?!\n)|\n)[ \t]*if \(Request\.QueryString != ""\) MM_LoginAction \+= "\?" \+ Server\.HTMLEncode\(Request\.QueryString\);(?:\r\n|\r(?!\n)|\n)[ \t]*var MM_valUsername = String\(Request\.Form\("([^\r\n]*?)"\)\);(?:\r\n|\r(?!\n)|\n)[ \t]*if \(MM_valUsername != "undefined"\) \{(?:\r\n|\r(?!\n)|\n)[ \t]*var MM_fldUserAuthorization = "([^\r\n]*?)";(?:\r\n|\r(?!\n)|\n)[ \t]*var MM_redirectLoginSuccess = "([^\r\n]*?)";(?:\r\n|\r(?!\n)|\n)[ \t]*var MM_redirectLoginFailed = "([^\r\n]*?)";(?:\r\n|\r(?!\n)|\n)[ \t]*(?:\r\n|\r(?!\n)|\n)[ \t]*var MM_loginSQL = "SELECT ([^\r\n]*?), ([^\r\n]*?)";(?:\r\n|\r(?!\n)|\n)[ \t]*if \(MM_fldUserAuthorization != ""\) MM_loginSQL \+= "," \+ MM_fldUserAuthorization;(?:\r\n|\r(?!\n)|\n)[ \t]*MM_loginSQL \+= " FROM ([^\r\n]*?) WHERE [^\r\n]*? = \? AND [^\r\n]*? = \?";(?:\r\n|\r(?!\n)|\n)[ \t]*var MM_rsUser_cmd = Server\.CreateObject \("ADODB\.Command"\);(?:\r\n|\r(?!\n)|\n)[ \t]*MM_rsUser_cmd\.ActiveConnection = MM_([^\r\n]*?)_STRING;(?:\r\n|\r(?!\n)|\n)[ \t]*MM_rsUser_cmd\.CommandText = MM_loginSQL;(?:\r\n|\r(?!\n)|\n)[ \t]*MM_rsUser_cmd\.Parameters\.Append\(MM_rsUser_cmd\.CreateParameter\("param1", ([^\r\n]*?), 1, ([^\r\n]*?), MM_valUsername\)\);(?:\s*\/\/[^\r\n]*)?(?:\r\n|\r(?!\n)|\n)[ \t]*MM_rsUser_cmd\.Parameters\.Append\(MM_rsUser_cmd\.CreateParameter\("param2", ([^\r\n]*?), 1, ([^\r\n]*?), Request\.Form\("([^\r\n]*?)"\)\)\);(?:\s*\/\/[^\r\n]*)?(?:\r\n|\r(?!\n)|\n)[ \t]*MM_rsUser_cmd\.Prepared = true;(?:\r\n|\r(?!\n)|\n)[ \t]*var MM_rsUser = MM_rsUser_cmd\.Execute\(\);(?:\r\n|\r(?!\n)|\n)[ \t]*(?:\r\n|\r(?!\n)|\n)[ \t]*if \(!MM_rsUser\.EOF \|\| !MM_rsUser\.BOF\) \{(?:\r\n|\r(?!\n)|\n)[ \t]*\/\/ username and password match - this is a valid user(?:\r\n|\r(?!\n)|\n)[ \t]*Session\("([^\r\n]*?)"\) = MM_valUsername;(?:\r\n|\r(?!\n)|\n)[ \t]*if \(MM_fldUserAuthorization != ""\) \{(?:\r\n|\r(?!\n)|\n)[ \t]*Session\("([^\r\n]*?)"\) = String\(MM_rsUser\.Fields\.Item\(MM_fldUserAuthorization\)\.Value\);(?:\r\n|\r(?!\n)|\n)[ \t]*\} else \{(?:\r\n|\r(?!\n)|\n)[ \t]*Session\("[^\r\n]*?"\) = "";(?:\r\n|\r(?!\n)|\n)[ \t]*\}(?:\r\n|\r(?!\n)|\n)[ \t]*if \(String\(Request\.QueryString\("accessdenied"\)\) != "undefined" && ([^\r\n]*?)\) \{(?:\r\n|\r(?!\n)|\n)[ \t]*MM_redirectLoginSuccess = Request\.QueryString\("accessdenied"\);(?:\r\n|\r(?!\n)|\n)[ \t]*\}(?:\r\n|\r(?!\n)|\n)[ \t]*MM_rsUser\.Close\(\);(?:\r\n|\r(?!\n)|\n)[ \t]*Response\.Redirect\(MM_redirectLoginSuccess\);(?:\r\n|\r(?!\n)|\n)[ \t]*\}(?:\r\n|\r(?!\n)|\n)[ \t]*MM_rsUser\.Close\(\);(?:\r\n|\r(?!\n)|\n)[ \t]*Response\.Redirect\(MM_redirectLoginFailed\);(?:\r\n|\r(?!\n)|\n)[ \t]*\}(?=\r\n|\r|\n|%>)/i]]></searchPattern>
	</searchPatterns>
	<quickSearch>MM_rsUser_cmd.Parameters.Append(MM_rsUser_cmd.CreateParameter("param1",</quickSearch>
</participant>

<!-- participant modified by hand: we should not match the ending of the CreateParameter lines -->
