#!/usr/bin/perl

# ---------------------------------------------------------------------------
#     CIWWEB.PL
#
#      Ver: 9_5_3
# ---------------------------------------------------------------------------
# Lighthouse Studio - Web Surveying System
# Copyright Sawtooth Software, Inc. 1998-2017. All rights reserved.
# Orem, UT  USA  (801) 477-4700
#
# Any modification of this script will be considered violation of
# copyright (with the exception of the first line which can be
# modified to reflect the correct path to the Perl interpreter)
# Any use of this script or its code for purposes outside of
# the systems created by Sawtooth Software is prohibited.
 use strict; package ssiwebciw9_5_3; if (exists($ENV{'MOD_PERL'}) && defined($ENV{'MOD_PERL'})) { ssiwebciw9_5_3::_bji(); } else { $SIG{"ALRM"} = \&ssiwebciw9_5_3::_bjj; eval { alarm (180); ssiwebciw9_5_3::_bji(); alarm (0); }; if($@) { my $error_msg = $@; eval { if ($error_msg =~ m/Sawtooth Software process time out/i) { my $long_msg = "Process timed out."; authlib9_5_3::_bsn(312, $long_msg, $long_msg, $@, 0); } else { authlib9_5_3::_bsn(313, "", "", $error_msg, 0); } }; if($@) { die("Sawtooth Software Error."); } } } sub _bji { my $__a = 0; my $__b = ""; my $__c = ""; my $__d = 0; my $__e = 0; my $__f = 0; my $__g = 0; my $__h = 0; my $__i = ""; my $__j = ""; my $__k = ""; my $__l = 1; my $__m = ""; my $__n = 1; my $__o = 0; my $__p = ""; my $__q = 0; my $__r = 0; my $__s = 0; my $__t = 0; my $__u = 0; my $__v = ""; my $__w = 0; my $__x =0; my $__y = 0; if ($ENV{'PERLXS'} =~ m/PerlIS/i) { print "HTTP/1.1 200 OK\n"; } if ((exists($ENV{'SCRIPT_FILENAME'}) || (defined ($ENV{'SCRIPT_FILENAME'})))) { $__k = $ENV{'SCRIPT_FILENAME'}; } if ($__k eq "") { $__k = $ENV{'PATH_TRANSLATED'}; $__k =~ tr[\\][/]; } $__k =~ s/(.+)\/.+$/$1/; if ((exists($ENV{'SSI_UTF16'}) || (defined ($ENV{'SSI_UTF16'})))) { require Win32; utf8::decode($__k); $__k = Win32::GetShortPathName($__k); $__k =~ tr/\\/\//; } unshift @INC, $__k; _bjm("authlib9_5_3.pl", $__k); authlib9_5_3::_bpd(0); $authlib9_5_3::_cbh = $__k; _bjm("ciwlib9_5_3.pl", $__k); ciwlib9_5_3::_bjn(); authlib9_5_3::_bpu(); authlib9_5_3::_brg(); if(exists $authlib9_5_3::_ccv{"hid_preview"}) { $authlib9_5_3::_cek = $authlib9_5_3::_ccv{"hid_preview"}; if(authlib9_5_3::_bxj()) { $__d = 1; $authlib9_5_3::_ccv{"hid_respnum"} = $__d; $ciwlib9_5_3::_bmy{'_dkx'} = $__d; } if(exists $authlib9_5_3::_ccv{"hid_preview_page"} && $authlib9_5_3::_ccv{"hid_preview_page"} > 1) { $__e = 1; } } if(!$authlib9_5_3::_cek) { if ($authlib9_5_3::_ccv{"hid_previous"} == 1) { $authlib9_5_3::_cby = 1; } elsif(exists $authlib9_5_3::_ccv{"sys_previous_button"} && $authlib9_5_3::_ccv{"sys_previous_button"} ne "") { $authlib9_5_3::_cby = 1; } } if (keys(%authlib9_5_3::_ccv) == 1 || exists $authlib9_5_3::_ccv{"hid_url_restore"}) { if (exists $authlib9_5_3::_ccv{"hid_s"}) { my $__z = $authlib9_5_3::_ccv{"hid_s"}; if ($__z ne "") { my $__aa = 0; my $__ab = 0; my $__ac = 0; ($__v, $__s, $__i, $__t, $__aa, $__w, $__x, $__ab, $__ac) = authlib9_5_3::_bqb($__z); $authlib9_5_3::_ccv{"hid_studyname"} = $__i; if($__aa) { $authlib9_5_3::_ccv{"hid_test_mode"} = $__aa; } if($__ac) { $authlib9_5_3::_ccv{"hid_test_db"} = $__ac; } $__q = 1; } } } $__j = authlib9_5_3::_bqh(0); if ((exists $authlib9_5_3::_ccv{"hid_pagenum"}) && (defined $authlib9_5_3::_ccv{"hid_pagenum"})) { $__e = $authlib9_5_3::_ccv{"hid_pagenum"}; } if ($__e == 1 || $__e == 0) { my $__ad = ""; foreach $__ad (keys %authlib9_5_3::_ccv) { $authlib9_5_3::_cac{uc($__ad)} = $authlib9_5_3::_ccv{$__ad}; } } if ((exists $authlib9_5_3::_ccv{"hid_studyname"}) && (defined $authlib9_5_3::_ccv{"hid_studyname"})) { $__i = $authlib9_5_3::_ccv{"hid_studyname"}; } elsif (exists $authlib9_5_3::_cac{"STUDYNAME"}) { $__y = 1; $authlib9_5_3::_ccv{"hid_studyname"} = $authlib9_5_3::_cac{"STUDYNAME"}; $__i = $authlib9_5_3::_ccv{"hid_studyname"}; } else { if ($__i eq "") { $__i = authlib9_5_3::_bvj("hid_studyname"); if ($__i eq "") { $__i = authlib9_5_3::_bsp(); if ($__i eq "") { authlib9_5_3::_bsn(102, "", "Study name passed in is empty. Cannot find study name.", "", 1); } } } } if ($__i =~ m/\W/g) { authlib9_5_3::_bsn(327, "Access error.", "The studyname passed in contains invalid characters.", "", 0); } authlib9_5_3::_bpx($__i); authlib9_5_3::_bsi($__k); $authlib9_5_3::_cce = authlib9_5_3::_bqq(); my($__ce, $__cf, $__cg) = authlib9_5_3::_bpe($authlib9_5_3::_cce); if (!$__ce) { authlib9_5_3::_bsn(199, "Database error.", $__cf, $__cg); } my $__ae = 0; ($__ce, $__cf, $__cg, $__ae) = authlib9_5_3::_bqp(0); if (!$__ce) { authlib9_5_3::_bsn(204, "Database error.", $__cf, $@); } if (!exists $authlib9_5_3::_ccv{"hid_javascript"} && !$authlib9_5_3::_cek && !$__q && !exists $authlib9_5_3::_ccv{"sys_input"} && !exists $authlib9_5_3::_ccv{"sys_acbc_byo_request"}) { if($__y == 1) { $__e = 1; } else { $__e = authlib9_5_3::_bvj("hid_pagenum"); if ($__e eq "") { $__e = 0; } } ciwlib9_5_3::_bjo($__e, $__i); } if($__q) { if($__s) { my $__af = ciwlib9_5_3::_blf($__s); if(exists $__af->{"resp_num"}) { $authlib9_5_3::_ccv{"hid_respnum"} = $__af->{"resp_num"}; } if(exists $__af->{"last_question"}) { $__m = $__af->{"last_question"}; } else { $__m = authlib9_5_3::_bpr("sys_LastQuestion"); } if ($__t) { $authlib9_5_3::_ccv{"hid_checksum"} = $__t; } else { $authlib9_5_3::_ccv{"hid_checksum"} = authlib9_5_3::_bpr("sys_CheckSum"); } if (!exists $authlib9_5_3::_ccv{"hid_test_mode_settings"} && exists $__af->{"test_mode_settings"}) { $authlib9_5_3::_ccv{"hid_test_mode_settings"} = $__af->{"test_mode_settings"}; } if (exists $__af->{"preview"}) { $authlib9_5_3::_ccv{"hid_preview"} = $__af->{"preview"}; $authlib9_5_3::_cek = $__af->{"preview"}; } if ($__v == 0xFF01) { if ($__t != $__af->{"checksum"} || $__w != $__af->{"timestamp"} || $__x != $__af->{"resp_num"} || $authlib9_5_3::_ccp != $__af->{"study_name"} || $authlib9_5_3::_ccv{"hid_test_mode"} != $__af->{"test_mode"}) { my $__ag = "Expected_checksum=" . $__af->{"checksum"} . ", actual_checksum=$__t"; $__ag .= ", expected_timestamp=" . $__af->{"timestamp"} . ", actual_timestamp=$__w"; $__ag .= ", expected_respnum=" . $__af->{"resp_num"} . ", actual_respnum=$__x"; $__ag .= ", expected_studyname=" . $__af->{"study_name"} . ", actual_studyname=$__i"; $__ag .= ", version=$__v, id=$__s"; authlib9_5_3::_bsn(310, "URL values do not match expected values.", $__ag, ""); } } elsif ($__v == 0xFF02) { if ($__t != $__af->{"checksum"} || $__w != $__af->{"timestamp"} || $__x != $__af->{"resp_num"} || $authlib9_5_3::_ccp != $__af->{"study_name"} || $authlib9_5_3::_ccv{"hid_test_mode"} != $__af->{"test_mode"}) { my $__ag = "Expected_checksum=" . $__af->{"checksum"} . ", actual_checksum=$__t"; $__ag .= ", expected_timestamp=" . $__af->{"timestamp"} . ", actual_timestamp=$__w"; $__ag .= ", expected_respnum=" . $__af->{"resp_num"} . ", actual_respnum=$__x"; $__ag .= ", expected_studyname=" . $__af->{"study_name"} . ", actual_studyname=$__i"; $__ag .= ", version=$__v, id=$__s"; authlib9_5_3::_bsn(326, "URL values do not match expected values.", $__ag, ""); } } } $__n = 0; $__l = 0; $__e = -1; $__d = $authlib9_5_3::_ccv{"hid_respnum"}; } if ($__j ne "") { authlib9_5_3::_buy(&authlib9_5_3::_CGW, 0, $__j); } if (exists $authlib9_5_3::_ccv{"hid_test_mode"} && exists $authlib9_5_3::_ccv{"hid_test_mode_settings"}) { if ($authlib9_5_3::_ccv{"hid_test_mode_settings"} eq "") { ciwlib9_5_3::_bmd(); } if ($authlib9_5_3::_ccv{"hid_test_mode_settings"} ne "") { ciwlib9_5_3::_bme(); } } if (exists $authlib9_5_3::_ccv{"hid_loadtest_mode"}) { $authlib9_5_3::_cbo = $authlib9_5_3::_ccv{"hid_loadtest_mode"}; } authlib9_5_3::_brh(0, 1, ""); if ($authlib9_5_3::_ccu->{"survey_paused"} == 1) { ciwlib9_5_3::_bkq('_fn', 1); } if ($authlib9_5_3::_cby) { $__d = ciwlib9_5_3::_bkl(); my @__ah = (); foreach my $__ai (grep(/hid_prev_/, (keys %authlib9_5_3::_ccv))) { my ($__ch,$__ci, $__cb, $__cj) = split(",", $authlib9_5_3::_ccv{$__ai}); push(@__ah, [ $__ci, $__ch ]); delete $authlib9_5_3::_ccv{$__ai}; } @__ah = sort {$a->[1] <=> $b->[1]} @__ah; my @__aj = reverse @{authlib9_5_3::_bqu($__d)}; my @__ak = grep { $_->{"quest_version"} ne "0" } @__aj; @__aj = grep { $_->{"limbo"} == 0 } @__aj; if ($__e > 1 && exists $authlib9_5_3::_ccv{"hid_pagetime"} && !$authlib9_5_3::_cek) { my @__al = (); ciwlib9_5_3::_bkn(\@__al, $__d, $__e, $authlib9_5_3::_ccv{"hid_pagetime"}); authlib9_5_3::_bqr(\@__al, $__d, 1, 1); authlib9_5_3::_bqi(\@__al, $__d, 0); } if (@__aj == 0 || @__ak == 0) { $__e = 0; } else { my $__am = -1; my $__an = 0; if ($__ak[0]->{"hop"} < $__ah[0]->[1]) { $__an = $__ak[0]; $__am = 0; } else { for (my $__ao = 0; $__ao < @__ak; $__ao++) { if ($__ak[$__ao]->{"hop"} <= $__ah[0]->[1]) { if ($__ao + 1 < @__ak) { $__an = $__ak[$__ao + 1]; $__am = $__ao + 1; last; } } } } if ($__an) { my $__ap = 0; if (exists $__an->{"hop"}) { $__ap = $__an->{"hop"}; } else { authlib9_5_3::_bsn(260, "Backup Error.", "Error occured while backing up.", $@); } $__e = $__an->{"page_num"}; $__u = $authlib9_5_3::_ccw->[$__e - 1]; my @__aq = (); my $__ar = ""; if ($__e > 1) { while (1) { eval { $__ar = "SELECT `hop`,`quest_name` FROM `" . $authlib9_5_3::_ccr . "_history` WHERE `sys_RespNum`=" . $__d . " AND `page_num`=" . $__e . " AND `quest_version`!='0' AND `limbo`=0 AND `hop` <= $__ap ORDER BY `hop` ASC"; @__aq = @{$authlib9_5_3::_ccm->selectall_arrayref(authlib9_5_3::_bpm($__ar, 0), { Slice => {} })}; }; if ($@) { authlib9_5_3::_bsn(234, "Database error.", "Unable to read history data. " . $authlib9_5_3::_ccm->errstr, $@); } if (@__aq == 0) { if ($__am < @__ak) { $__an = $__ak[++$__am]; if (exists $__an->{"hop"}) { $__ap = $__an->{"hop"}; $__e = $__an->{"page_num"}; $__u = $authlib9_5_3::_ccw->[$__e - 1]; } else { authlib9_5_3::_bsn(260, "Backup Error.", "Error occured while backing up.", $@); } } else { last; } } else { last; } } if (@__aq == 0) { $__e = 0; } else { my $__as = 0; my $__at = $__u->{'_g'}; my $__au = @{$__at}; my %__av = (); my $__aw = 2147483648; my $__ax = $__aw; for (my $__ay = 0; $__ay < $__au; $__ay++) { my $__az = $__at->[$__ay]; $__av{$__az->{'_bjf'}} = $__aw; } $__as = @__aq - 1; for (my $__ao = @__aq - 1; $__ao >= 0; $__ao--) { my $__ba = ""; if ($__aq[$__ao]->{"quest_name"} =~ m/^(.*?)\..*$/o) { $__ba = $1; } else { $__ba = $__aq[$__ao]->{"quest_name"}; } if (exists $__av{$__ba}) { if ($__av{$__ba} == $__aw) { $__av{$__ba} = $__aq[$__ao]->{"hop"}; } else { last; } if ($__aq[$__ao]->{"hop"} < $__ax) { $__ax = $__aq[$__ao]->{"hop"}; } } } for (my $__ao = 0; $__ao < $__au; $__ao++) { my $__bb = $__at->[$__ao]->{'_bjf'}; if (exists $__av{$__bb} && $__av{$__bb} != $__aw) { $__m = $__bb; last; } } $authlib9_5_3::_ccv{"sys_prev_low_hop"} = $__ax; my @__bc = (); for (my $__ao = 0; $__ao < @__aj; $__ao++) { if ($__aj[$__ao]->{"hop"} eq $__ax) { @__bc = (@__bc, (0..$__ao)); last; } } foreach my $__ao (@__bc) { foreach my $__bd (keys %{$__aj[$__ao]->{"data"}}) { $authlib9_5_3::_cae->{$__bd} = 1; } } my $__be = 0; eval { my $__ar = "SELECT * FROM `" . $authlib9_5_3::_ccr . "_history` WHERE `sys_RespNum`=" . $__d . " AND `page_num`=" . $__e . " AND `quest_name`='hid_page_vars_history' AND `limbo`=0 AND `hop`>= " . $__ap . " ORDER BY `hop` ASC"; my @__bf = @{$authlib9_5_3::_ccm->selectall_arrayref(authlib9_5_3::_bpm($__ar, 0), { Slice => {} })}; if (@__bf > 0) { $__be = $__bf[0]; } }; if ($@) { authlib9_5_3::_bsn(279, "Database error.", "Unable to connect retrieve history data. " . $authlib9_5_3::_ccm->errstr, $@); } delete $authlib9_5_3::_ccv{"hid_loops"}; delete $authlib9_5_3::_ccv{"hid_page_rand"}; if ($__be) { eval { $__be->{"data"} = eval(authlib9_5_3::_bph($__be->{"data"})); }; if ($@) { authlib9_5_3::_bsn(280, "Database error.", "Database error while evaluating history.", $@); } if (exists $__be->{"data"}->{"hid_SavedListNames"}) { my @__bg = split(",", $__be->{"data"}->{"hid_SavedListNames"}); delete $__be->{"data"}->{"hid_SavedListNames"}; my $__bh = ""; foreach $__bh (@__bg) { $authlib9_5_3::_cbb{$__bh} = $__be->{"data"}->{$__bh}; delete $authlib9_5_3::_cae->{$__bh}; delete $__be->{"data"}->{$__bh}; } } %authlib9_5_3::_cbv = (%authlib9_5_3::_cbv, %{$__be->{"data"}}); if (exists $authlib9_5_3::_cbv{"hid_loops"}) { $authlib9_5_3::_ccv{"hid_loops"} = $authlib9_5_3::_cbv{"hid_loops"}; } if (exists $authlib9_5_3::_cbv{"hid_page_rand"}) { $authlib9_5_3::_ccv{"hid_page_rand"} = $authlib9_5_3::_cbv{"hid_page_rand"}; } } } } else { $__e = 0; } } else { $__e = 0; } } } if (exists $authlib9_5_3::_ccv{"sys_acbc_byo_request"}) { my $__bi = $authlib9_5_3::_ccv{"sys_acbc_name"}; $__d = ciwlib9_5_3::_bkl(); my $__bj = authlib9_5_3::_btl($__bi); print acbclib9_5_3::_czm($__bj); exit(); } if (exists $authlib9_5_3::_ccv{"sys_input"}) { print authlib9_5_3::_brz(); print authlib9_5_3::_brm(); exit(); } if ((exists $authlib9_5_3::_ccv{"hid_javascript"}) && (defined $authlib9_5_3::_ccv{"hid_javascript"})) { $__g = $authlib9_5_3::_ccv{"hid_javascript"}; } elsif($authlib9_5_3::_cek) { $__g = 1; } else { $__g = authlib9_5_3::_bvj("hid_javascript"); if ($__g eq "") { $__g = 0; } } if(($__e == 0 || $__e == 1) && $authlib9_5_3::_cbo != 1) { if($__g == 0) { authlib9_5_3::_buy(&authlib9_5_3::_CGW, 0, "Respondent denied survey access because their browser did not have JavaScript enabled (" . authlib9_5_3::_bsw() . ")."); ciwlib9_5_3::_bkq('_fo', 0); } if(exists $authlib9_5_3::_ccv{"unsupported_browser"} && !exists $authlib9_5_3::_ccx->{'_bc'}) { authlib9_5_3::_buy(&authlib9_5_3::_CGW, 0, "Respondent denied survey access because they were using an unsupported browser (" . authlib9_5_3::_bsw() . ")."); ciwlib9_5_3::_bkq('_fp', 0); } } $authlib9_5_3::_ccv{"hid_javascript"} = $__g; if ($__e > 1 && $authlib9_5_3::_cby == 0) { $__d = ciwlib9_5_3::_bkl(); } elsif ($__e == 1) { my $__bk = ""; authlib9_5_3::_brd("enterlib9_5_3.pl"); if ($authlib9_5_3::_ccu->{"close_survey"} == 1) { enterlib9_5_3::_chi($__g); } authlib9_5_3::_brk(); if ($authlib9_5_3::_cdb && !$authlib9_5_3::_cek) { if (exists $authlib9_5_3::_cdb->{'_bij'}) { my $__bl = 0; my $__bm = 0; ($__bl, $__bm, $__d, $__bk) = enterlib9_5_3::_chc($authlib9_5_3::_cdb->{'_bij'}); if (!$__bl) { authlib9_5_3::_buy(&authlib9_5_3::_CGW, 0, "Respondent denied survey access because their password was wrong."); ciwlib9_5_3::_bkq('_fe', 0); } elsif (!$__bm) { if ($__d) { $authlib9_5_3::_ccv{"hid_respnum"} = $__d; } authlib9_5_3::_buy(&authlib9_5_3::_CGW, 0, "Respondent denied survey access because the password had reached the maximum number of respondents allowed."); ciwlib9_5_3::_bkq('_fc', 0); } } if ($__d == 0 && exists $authlib9_5_3::_cdb->{'_bjh'}) { if (!exists $authlib9_5_3::_ccv{"hid_test_mode"}) { $__d = enterlib9_5_3::_chd($__k); } } } if (exists($authlib9_5_3::_ccx->{'_dp'}) && !exists($authlib9_5_3::_ccv{"hid_skip_simple_browser_transition"}) && $__g) { ciwlib9_5_3::_bmj($authlib9_5_3::_ccx->{'_dp'}); authlib9_5_3::_bvl(); } my $__bn = 0; if (exists $ciwlib9_5_3::_bmy{'_dkx'}) { $__bn = 1; } elsif ($__d) { $authlib9_5_3::_ccv{"hid_respnum"} = $__d; $__f = 1; } elsif (exists $authlib9_5_3::_ccv{"hid_respnum"}) { $__d = ciwlib9_5_3::_bkl(); } else { $__bn = 1; } if ($__f) { $__m = authlib9_5_3::_bpr("sys_LastQuestion"); if (exists $authlib9_5_3::_cac{"SYS_SKIPTO"}) { $__m = $authlib9_5_3::_cac{"SYS_SKIPTO"}; $__m = ciwlib9_5_3::_blq($__m); $__n = 0; $__o = 1; } $__m = ciwlib9_5_3::_blo($__d, $__m); } elsif($__bn) { if (exists $ciwlib9_5_3::_bmy{'_dkx'}) { $__d = $ciwlib9_5_3::_bmy{'_dkx'}; } ($__d, $__r) = enterlib9_5_3::_chg($__d, $__bk, $__g); if ($authlib9_5_3::_cdb) { if (exists $authlib9_5_3::_cdb->{'_bjh'} && $__a != 1) { if (!exists $authlib9_5_3::_ccv{"hid_test_mode"}) { enterlib9_5_3::_che($__d, $__r, $__k); } } } } if ($__d) { $authlib9_5_3::_ccv{"hid_respnum"} = $__d; } else { authlib9_5_3::_bsn(271, "", "Respondent number is empty.", ""); } } elsif ($__e == 0) { $authlib9_5_3::_ccv{"hid_javascript"} = 1; ciwlib9_5_3::_bkt(1, "", 0, 1, $authlib9_5_3::_ccp, 0, 0); authlib9_5_3::_bvl(); } if ($__e == 1 && $__f) { $authlib9_5_3::_ccv{"hid_checksum"} = authlib9_5_3::_bpr("sys_CheckSum"); } if ($__q) { my $__bo = ""; my $__bp = ""; if (exists $authlib9_5_3::_ccx->{'_bd'}) { $__bo = authlib9_5_3::_bsy(); $__bp = authlib9_5_3::_bpr("sys_UserAgent"); } my $__bq = ""; my $__br = ""; if (exists $authlib9_5_3::_ccx->{'_be'}) { $__bq = authlib9_5_3::_bsz(); $__br = authlib9_5_3::_bpr("sys_IPAddress"); } if (!$authlib9_5_3::_cek && ($__bo ne $__bp || $__bq ne $__br)) { authlib9_5_3::_bsn(302, "The link to the survey that you are using will not work. Please enter the survey again using the original link that was given to you.", "A respondent attempted to use the survey page url with a different browser or IP address than they used originally. They were instructed to enter the survey using the original link that was sent to them.", "", 1); } if ($__m) { $__m = ciwlib9_5_3::_blo($__d, $__m); } } my $__bs = authlib9_5_3::_bpr("sys_RespStatus"); if ($__bs == &authlib9_5_3::_CGJ || $__bs == &authlib9_5_3::_CGI) { ciwlib9_5_3::_bkq('_fd', 0); } if ($__g == 0) { if (authlib9_5_3::_bpr("sys_UserJavaScript") == 1) { $__g = 1; $authlib9_5_3::_ccv{"hid_javascript"} = $__g; } } if ($__e > 0 && $authlib9_5_3::_cby == 0 && !$authlib9_5_3::_cek) { authlib9_5_3::_brd("pverlib9_5_3.pl"); my $__bt = authlib9_5_3::_bvm(\%authlib9_5_3::_cbb); my $__bu = authlib9_5_3::_bvm($authlib9_5_3::_cco); my $__bv = authlib9_5_3::_bvm(\%authlib9_5_3::_cbv); pverlib9_5_3::_cig($__e, $__d); %authlib9_5_3::_cbb = %{$__bt}; $authlib9_5_3::_cco = $__bu; %authlib9_5_3::_cbv = %{$__bv}; $authlib9_5_3::_cbq = ""; $authlib9_5_3::_cbf = 0; } my $__bw = []; my $__bx = []; if ($ciwlib9_5_3::_bna && $authlib9_5_3::_cby) { if ($__f) { $__m = ""; } if ($authlib9_5_3::_ccv{"hid_destination"}) { $__m = $authlib9_5_3::_ccv{"hid_destination"}; } } else { if ($__f) { if ($authlib9_5_3::_cbi) { my $__by = 0; my $__bz = ""; ($__by, $__bz) = authlib9_5_3::_bru(); if ($__by) { $__m = $__bz; delete $authlib9_5_3::_ccv{"hid_page_rand"}; } } if (!$__o) { $__h = _bjk(); if ($__h) { $__m = ""; delete $authlib9_5_3::_ccv{"hid_page_rand"}; $__f = 0; } else { $__l = 0; } } } if ($__l && $authlib9_5_3::_cby == 0 && $ciwlib9_5_3::_bna eq "" && !$authlib9_5_3::_cek) { ($__bw, $__bx) = ciwlib9_5_3::_bkm($__e, $__f); } } my $__ca = 0; if($authlib9_5_3::_cek) { if ($authlib9_5_3::_ccv{"hid_previous"} == 1) { $__e--; } else { $__e++; } } else { if ($ciwlib9_5_3::_bna eq "" && $__n && $authlib9_5_3::_cby == 0) { ($__m, $__e, $__ca) = ciwlib9_5_3::_bjp($__bw, $__bx, $__d, $__m, $__e, $__f); } } if(exists($ciwlib9_5_3::_bmy{'skip'})) { if ($ciwlib9_5_3::_bna eq "") { $__m = $ciwlib9_5_3::_bmy{'skip'}; $__m = ciwlib9_5_3::_blo($__d, $__m); $authlib9_5_3::_ccv{"hid_test_mode_settings"} =~ s/(.*?),/,/; } } if ($authlib9_5_3::_cby) { $authlib9_5_3::_cdi = 0; $authlib9_5_3::_cdj = 0; ($__e, $__m, $__ca) = ciwlib9_5_3::_bkt($__e, $__m, $__d, $__g, $authlib9_5_3::_ccp, 0, 0); if ($__e || $__m) { authlib9_5_3::_bsn(308, "Backing up error.", "Backing up error. A destination was set while backing up. PageNum:" . $__e . " Destination:" . $__m, ""); } } else { my $__cb = $authlib9_5_3::_ccv{'hid_pagenum'}; while ($__e > 0 || $__m ne "") { $authlib9_5_3::_cdj = 0; $authlib9_5_3::_cdi = 0; if (!$authlib9_5_3::_cek && !$__f && $ciwlib9_5_3::_bna eq "") { ($__e, $__m) = ciwlib9_5_3::_bks($__e, $__cb, $__m, $__d, $__ca); } elsif($authlib9_5_3::_cek == &authlib9_5_3::_CGX && exists $authlib9_5_3::_ccv{"hid_preview_page"}) { $__e = $authlib9_5_3::_ccv{"hid_preview_page"}; } $__cb = $__e; ($__e, $__m, $__ca) = ciwlib9_5_3::_bkt($__e, $__m, $__d, $__g, $authlib9_5_3::_ccp, 0, 0); if (exists $authlib9_5_3::_ccv{'sys_autocompletes'}) { my $__cc = ciwlib9_5_3::_bkj($__cb); foreach my $__cd (@{$__cc}) { ($__bw, $__bx) = ciwlib9_5_3::_bkm($__cd, 0); ($__m, $__e, $__ca) = ciwlib9_5_3::_bjp($__bw, $__bx, $__d, $__m, $__cd, 0); } } elsif (($__e > 0 || $__m ne "") && (keys %authlib9_5_3::_cbv || keys %authlib9_5_3::_cbb)) { my $__cc = ciwlib9_5_3::_bkj($__cb); foreach my $__cd (@{$__cc}) { ciwlib9_5_3::_bkm($__cd, 0); } } } } authlib9_5_3::_bvl(); } sub _bjj { my $__ck = ""; my $__cl = "Sawtooth Software process time out."; eval { if(!$authlib9_5_3::_cek) { $__ck = $__cl; } }; if ($@) { $__ck = $__cl; } if($__ck) { die($__ck); } } sub _bjk { my $__cm = 0; my $__cn = ""; my $__co = ""; my $__cp = ""; my $__cq = ""; my %__cr = (); my $__cs = $authlib9_5_3::_ccw->[0]; my $__ct = $__cs->{'_g'}; my $__cu = @{$__ct}; my $__cv = 0; my $__cw = 0; for($__cv = 0; $__cv < $__cu; $__cv++) { $__cw = $__ct->[$__cv]; if ($__cw->{'_bjg'} != 21) { $__cr{$__cw->{'_bjf'}} = 1; } } if ($authlib9_5_3::_cdb) { if (exists $authlib9_5_3::_cdb->{'_bjc'}) { my $__cx = $authlib9_5_3::_cdb->{'_bjc'}; my $__cy = 0; my $__cz = ""; foreach $__cy (@{$__cx}) { $__cz = $__cy->{'_bjf'}; $__cr{$__cz} = 1; } } if (exists $authlib9_5_3::_cdb->{'_bij'}) { my $__da = $authlib9_5_3::_cdb->{'_bij'}; if (exists $__da->{'_biv'}) { my @__db = @{$__da->{'_biv'}}; my $__dc = 0; my $__dd = ""; foreach $__dc (@__db) { $__dd = $__dc->{'_bjf'}; $__cr{$__dd} = 1; } } } } foreach $__cn (sort keys %authlib9_5_3::_ccv) { if ($__cn =~ m/^(.*?)_(.*?)$/) { $__co = $1; } else { $__co = $__cn; } if (exists $__cr{$__co}) { $__cp = ""; $__cq = authlib9_5_3::_bpr($__cn); if (exists $authlib9_5_3::_ccv{$__cn}) { $__cp = $authlib9_5_3::_ccv{$__cn}; } my $__de = authlib9_5_3::_bsl(uc($__cp)); my $__df = authlib9_5_3::_bsl(uc($__cq)); if ($__de ne $__df) { $__cm = 1; if (authlib9_5_3::_bwm($__de) && authlib9_5_3::_bwm($__df)) { $__de = _bjl($__de); $__df = _bjl($__df); if ($__de eq $__df) { $__cm = 0; } } if ($__cm) { last; } } } } return $__cm; } sub _bjl { my($__dg) = @_; if($__dg =~ m/(\d*)(\.)(\d*?)(0+)$/) { if($3 eq "") { $__dg = $1; } else { $__dg = $1 . $2 . $3; } } return $__dg; } sub _bjm { my ($__di, $__dj) = @_; my $__dh = ""; if (!(-e $__dj . "/" . $__di)) { $__dh = "Cannot find library in " . $__dj; } eval { require $__di; }; if ($@) { $__dh = $@; } if ($__dh ne "") { print "Content-type: text/html\r\n\r\n"; print "<html><body style=\"font-family: arial; margin: 20px;\">"; print "<span style=\"color: red; font-weight: bold; padding-right: 10px\">Error:</span>"; print "Cannot load library: <span style=\"color: blue;\">" . $__di . "</span>"; print "</body></html>"; exit(); } } END { if($authlib9_5_3::_cbu) { close $authlib9_5_3::_cbu; } } return 1; 1;
