<% '******************************************************************************************************* 'Copyright Askia SA (c) 1994-2013 '******************************************************************************************************* dim g_strThisPageName dim g_strInternalName dim g_strBroker dim g_strDSNName dim g_strTable '******************************************************************************************************* 'Please change the parameters' values below according to the task '******************************************************************************************************* g_strThisPageName="auth.asp" g_strInternalName="***" g_strBroker="***" g_strDSNName=";DSN=***;UID=***;PWD=***" g_strTable="***" '******************************************************************************************************* 'Check functions '******************************************************************************************************* call main sub main() if request("strBrokerPanelId")<>"" then call TryToConnect else call GetLogin end if end sub '******************************************************************************************************* 'Form to enter access code '******************************************************************************************************* sub GetLogin() 'Declaration dim strError strError="" if request("Error")="1" then strError="Unknown access code. Please try again." call ShowHeader %>
<% end sub '******************************************************************************************************* 'Check password and redirect to survey '******************************************************************************************************* sub TryToConnect() 'Declaration dim db 'Database connection dim rs 'Recordset for query dim strSql 'Query dim strKey16 'Key16 for end interview dim strPass 'User Password dim strLink 'Link for start survey 'Initializing variables strKey16="" strPass="" set db=server.CreateObject("ADODB.Connection") set rs=server.CreateObject("ADODB.Recordset") db.Open g_strDSNName strPass=Request("strBrokerPanelId") strSql="Select * from " & g_strTable & " where Pass='" & replace(strPass,"'","''") & "'" rs.Open strSql,db,2,2 If rs.eof or rs.bof Then rs.Close set rs=nothing db.Close set db=nothing Response.Redirect g_strThisPageName & "?Error=1" End if strLink="/webprod/cgi-bin/askiaext.dll?Action=DoExternalPanel&SurveyName=" & g_strInternalName & "&Broker=" & g_strBroker & "&BrokerPanelId=" & Request("strBrokerPanelId") rs.close db.Close set rs=nothing set db=nothing Response.Redirect strLink end sub '******************************************************************************************************* 'Header settings '******************************************************************************************************* sub ShowHeader() %> <% end sub %>