<% Sub ShowGetDataToEnrollError(ReturnValue) response.Write("") Select Case ReturnValue Case 5 response.Write("

" & CommonError_Title_Error5 & "



") response.Write("

" & CommonError_Text_Error5) Case -2 response.Write("

" & CommonError_Title_ErrorMinus2 & "



") response.Write("

" & CommonError_Text_ErrorMinus2) Case -10 response.Write("

" & CommonError_Title_ErrorMinus10 & "



") response.Write("

" & CommonError_Text_ErrorMinus10) Case -12 response.Write("

" & CommonError_Title_ErrorMinus12 & "



") response.Write("

" & CommonError_Text_ErrorMinus12) Case -13 response.Write("

" & CommonError_Title_ErrorMinus13 & "



") response.Write("

" & CommonError_Text_ErrorMinus13) Case -14 response.Write("

" & CommonError_Title_ErrorMinus14 & "



") response.Write("

" & CommonError_Text_ErrorMinus14) Case -16 response.Write("

" & CommonError_Title_ErrorMinus16 & "



") response.Write("

" & CommonError_Text_ErrorMinus16) Case -21 response.Write("

" & CommonError_Title_ErrorMinus21 & "



") response.Write("

" & CommonError_Text_ErrorMinus21) Case -29 response.Write("

" & CommonError_Title_ErrorMinus29 & "



") response.Write("

" & CommonError_Text_ErrorMinus29) Case -30 response.Write("

" & CommonError_Title_ErrorMinus30 & "



") response.Write("

" & CommonError_Text_ErrorMinus30) Case -31 response.Write("

" & CommonError_Title_ErrorMinus31 & "



") response.Write("

" & CommonError_Text_ErrorMinus31) Case -32 response.Write("

" & CommonError_Title_ErrorMinus32 & "



") response.Write("

" & CommonError_Text_ErrorMinus32) Case 1326 response.Write("

" & CommonError_Title_Error1326 & "



") response.Write("

" & CommonError_Text_Error1326) Case 1355 response.Write("

" & CommonError_Title_Error1355 & "



") response.Write("

" & CommonError_Text_Error1355) Case 8470 response.Write("

" & CommonError_Title_Error8470 & "



") response.Write("

" & CommonError_Text_Error8470) Case -2147023541 response.Write("

" & CommonError_Title_ErrorMinus2147023541 & "



") response.Write("

" & CommonError_Text_ErrorMinus2147023541) Case -2147016426 response.Write("

" & CommonError_Title_ErrorMinus2147016426 & "



") response.Write("

" & CommonError_Text_ErrorMinus2147016426) Case -2147024891 response.Write("

" & CommonError_Title_ErrorMinus2147024891 & "



") response.Write("

" & CommonError_Text_ErrorMinus2147024891) Case Else response.Write("

" & CommonError_Title_ErrorGetDataToEnrollGeneral & "



") response.Write("

" & CommonError_Text_ErrorGetDataToEnrollGeneral) End Select if(ReturnValue < -50) Then response.Write(" Error (code: 0x" & Hex(ReturnValue) & ")

") Else response.Write(" Error (code: " &ReturnValue& ")

") End if response.Write("  ") response.Write("") End Sub Sub AddAnswer(i,ProfileOptions) response.Write("") If(ProfileOptions And 128) Then response.Write("") Else response.Write("") End If call AddConfirm(i,ProfileOptions) End Sub Sub AddConfirm(i,ProfileOptions) If(ProfileOptions And 1024) Then response.Write("") If(ProfileOptions And 128) Then response.Write("") Else response.Write("") End If End If End Sub Sub ShowMandatoryQuestions(ProfileOptions,MandatoryQuestionList) MandatoryQuestionListSize = UBound(MandatoryQuestionList) + 1 For i = 1 To MandatoryQuestionListSize response.write("") response.Write("") call AddAnswer(i,ProfileOptions) response.Write("
") Next End Sub Sub ShowAdminQuestions(QuestionsAdded,ProfileOptions,AdminQuestionList,NrOfAdminQuestionsToAnswer) AdminQuestionListSize = ubound(AdminQuestionList) For i = QuestionsAdded + 1 To QuestionsAdded + NrOfAdminQuestionsToAnswer response.write("") response.write("") call AddAnswer(i,ProfileOptions) response.Write("
") Next End Sub Sub ShowUserQuestions(QuestionsAdded,ProfileOptions,NrOfUserQuestionsToAnswer) For i = QuestionsAdded + 1 To QuestionsAdded + NrOfUserQuestionsToAnswer response.write("") response.Write("") call AddAnswer(i,ProfileOptions) response.Write("
") Next End Sub %> <% Response.Buffer = True Response.ExpiresAbsolute = Now() - 1 Response.Expires = 0 Response.CacheControl = "no-cache" %>
<%=GetDataToEnrollAsp_PageTitle%>
<% response.write("
" & CommonLabel_User & ": " &Server.HTMLEncode(Session("UserName"))& ", " & CommonLabel_Domain & ": " &Server.HTMLEncode(Session("Domain"))& "
") %>
<% Set Session("SSRPM") = Server.CreateObject("SSRPMCOM.SSRPM") Set Profile = Server.CreateObject("SSRPMCOM.SSRPMProfile") Session("SSRPM").Connect SSRPMServer,SSRPMPort RetVal = Session("SSRPM").GetUserData(Session("Domain"),Session("UserName"),Session("Password"),Profile) Session("NrOfMandatoryQuestions") = Profile.GetNrOfMandatoryQuestionsNeededToEnroll() Session("NrOfAdminQuestions") = Profile.GetNrOfAdminDefinedQuestionsNeededToEnroll() Session("NrOfUserQuestions") = Profile.GetNrOfUserDefinedQuestionsNeededToEnroll() Session("ProfileOptions") = Profile.GetOptions() 'Check if user is already enrolled EnrollChoice = Request.Form("EnrollChoice") If(EnrollChoice = "" And Session("EnrollChoice") <> "NewUser") Then 'No choice, return to CheckExistingUser.asp Response.Redirect "CheckExistingUser.asp" End If 'If user exists perform extra actions If( EnrollChoice = "UnEnroll") Then 'If user wants to un-enroll, delete old data and show success message RetValUnEnroll = Session("SSRPM").UnEnroll() If(RetValUnEnroll <> 0) Then ShowGetDataToEnrollError(RetValUnEnroll) Else response.Redirect "Default.asp" End If End If 'If new user act normally If(RetVal <> 0) Then call ShowGetDataToEnrollError(RetVal) Else Dim MandatoryQuestionList Dim AdminQuestionList Profile.GetMandatoryQuestionsList QuestionLanguage,MandatoryQuestionList Profile.GetAdminDefinedQuestionsList QuestionLanguage,AdminQuestionList response.Write("

" & GetDataToEnrollAsp_InfoText & "

") response.Write("

") QuestionsAdded = 0 if(Session("NrOfMandatoryQuestions") > 0) Then call ShowMandatoryQuestions(Session("ProfileOptions"),MandatoryQuestionList) QuestionsAdded = QuestionsAdded + (UBound(MandatoryQuestionList) + 1) End If if(Session("NrOfAdminQuestions") > 0) Then call ShowAdminQuestions(QuestionsAdded,Session("ProfileOptions"),AdminQuestionList,Session("NrOfAdminQuestions")) QuestionsAdded = QuestionsAdded + Session("NrOfAdminQuestions") End If if(Session("NrOfUserQuestions") > 0) Then call ShowUserQuestions(QuestionsAdded,Session("ProfileOptions"),Session("NrOfUserQuestions")) QuestionsAdded = QuestionsAdded + Session("NrOfUserQuestions") End If response.Write("  ") response.Write("  ") response.Write("
") End if %>