User = $Request->item("Login")->item(); $Site = $Request->item("Site")->item(); $topic= $Request->item("Topic")->item(); my $Referer = $Request->ServerVariables("HTTP_REFERER")->item(); my $string=$Request->ServerVariables("QUERY_STRING")->item(); use CGI; use OLE; $query= new CGI; %ttopics = ( home => 'C1.html', listingmgr => 'C2.html', cma => 'C3.html', ) if (!defined($topic)) { # ...handle error... next; } $nightmare = $ttopics{$topic}; @_=$nightmare; print "@_ is "; if (!defined($target)) { # ...handle error... next; } $Response->Write("Topic is $topic\n"); $Response->Write("my target is $nightmare\n"); if ($Session->{'isAuthenticated'} = 1) { $Response->Redirect($Session->{'this'}); #this is the index file of help website. } #### $User = $Request->item("Login")->item(); $Site = $Request->item("Site")->item(); $topic= $Request->item("Topic")->item(); my $Referer = $Request->ServerVariables("HTTP_REFERER")->item(); my $string=$Request->ServerVariables("QUERY_STRING")->item(); use CGI; use OLE; $query= new CGI; %ttopics = ( home => 'c1.htm', listingmgr => 'c2.htm', ); if (!defined($topic)) { $Response->write("hey we don't have a topic its undefined\n"); # ...handle error... } $nightmare = $ttopics{$topic}; @_=$nightmare; print "@_ is "; if (!defined($nightmare)) { $Response->write("no startpoint specified\n"); # ...handle error... } $Response->Write("Topic is $topic\n"); $Response->Write("my startpoint is $nightmare\n"); #commented out testing values in hash worked #while (my ($topic, $ttopics)=each(%ttopics)){ #$Response->Write("$topic=>$ttopics\n"); #} ### TEMPORARY ALIAS WORKAROUND - Set Site Alias to correct Site Code if ($Site eq "BAY") { $Site = "BRB" } ### END ALIAS WORKAROUND #### SESSION ISSUE WORKAROUND - if already authed or never logged out undef the session variables #### if ($Session->{'isAuthenticated'} = 1) { $Session->{'isAuthenticated'} = -1; $Session->{'acrobatVersion'} = undef; $Session->{'screenX'} = undef; $Session->{'screenY'} = undef; $Session->{'usrID'} = undef; $Session->{'usrName'} = undef; $Session->{'usrSystem'} = undef; $Session->{'usrAccount'} = undef; $Session->{'usrPassword'} = undef; $Session->{'usrLevel'} = undef; $Session->{'usrEveningContact'} = undef; $Response->Redirect($Session->{'this'.$nightmare}); # this may need to be commented out as this is global!# } # if ($Referer =~ m/mlxchange.com/i) # { my $sql = "SELECT Name1, Name2, Name3, Email, SystemID, AccountID, AccessLvl, MLXChange, PhoneNum, AltNum, Password, ContactEmail, ContactNum FROM ARAdmin.MLSUser WHERE Username = '$User' AND SystemID = '$Site'"; my $MLSUser = ARSselect($sql); if ($MLSUser->{numMatches} == 1) { $Session->{'isAuthenticated'} = 1; $Session->{'acrobatVersion'} = $Request->item("acrobatVersion")->item(); $Session->{'screenX'} = $Request->item("screenX")->item(); $Session->{'screenY'} = $Request->item("screenY")->item(); $Session->{'usrID'} = $User; $Session->{'usrName'} = @{@{$MLSUser->{rows}}[0]}[0]." ".@{@{$MLSUser->{rows}}[0]}[2]; $Session->{'usrSystem'} = @{@{$MLSUser->{rows}}[0]}[4]; $Session->{'usrAccount'} = @{@{$MLSUser->{rows}}[0]}[5]; $Session->{'usrPassword'} = @{@{$MLSUser->{rows}}[0]}[10]; $Session->{'usrLevel'} = @{@{$MLSUser->{rows}}[0]}[6]; $Session->{'usrEveningContact'} = @{@{$MLSUser->{rows}}[0]}[9]; if (@{@{$MLSUser->{rows}}[0]}[11]) { $Session->{'usrEmail'} = @{@{$MLSUser->{rows}}[0]}[11]; } else { $Session->{'usrEmail'} = @{@{$MLSUser->{rows}}[0]}[3]; } if (@{@{$MLSUser->{rows}}[0]}[7] == 2) { $Session->{'usrType'} = "Pro"; } else { $Session->{'usrType'} = "Std"; } if (uc($User) eq "NAT") { $Session->{'usrClass'} = "8"; } else { $Session->{'usrClass'} = "0"; } if (@{@{$MLSUser->{rows}}[0]}[12]) { $Session->{'usrDayContact'} = @{@{$MLSUser->{rows}}[0]}[12]; } else { $Session->{'usrDayContact'} = @{@{$MLSUser->{rows}}[0]}[8]; } } else { #$Response->Redirect($Session->{'this'}); } # } if ($Session->{'isAuthenticated'} && $Session->{'trackSession'} && !$Session->{'SessionTracked'}) { use OLE; my $Conn = CreateObject OLE "ADODB.Connection"; $Conn->Open("PROVIDER=SQLOLEDB;DATA SOURCE=$Session->{'sqlServer'};UID=$Session->{'sqlUser'};PWD=$Session->{'sqlPass'};DATABASE=$Session->{'dbName'}"); my $RS = $Server->CreateObject("ADODB.Recordset"); my $RS2 = $Server->CreateObject("ADODB.Recordset"); my $sql = "INSERT into t_Sessions (Site, SessionDate, SessionID, System, Account, UserLevel, UserType, UserID, Name, UserClass, UserIP, UserAgent, UserResolution, UserAcrobatVer, UserTimeSpent, Referrer) values ('". substr($Request->ServerVariables("SERVER_NAME")->item(),0,50). "','". MSSQLDate($Session->{'timeStart'}). "','". $Session->{'SessionID'}. "','". substr(uc($Session->{'usrSystem'}),0,3). "','". substr(uc($Session->{'usrAccount'}),0,3). "','". substr($Session->{'usrLevel'},0,5). "','". substr($Session->{'usrType'},0,3). "','". substr($Session->{'usrID'},0,15). "','". substr($Session->{'usrName'},0,50). "','". substr($Session->{'usrClass'},0,10). "','". substr($Request->ServerVariables("REMOTE_ADDR")->item(),0,15). "','". substr($Request->ServerVariables("HTTP_USER_AGENT")->item(),0,255). "','". substr($Session->{'screenX'}."x".$Session->{'screenY'},0,10). "','". $Session->{'acrobatVersion'}. "','0','". substr($Request->ServerVariables("HTTP_REFERER")->item(),0,255). "');"; if ($Session->{'trackDB'}){lg("DB","$sql");} $RS = $Conn->Execute($sql); my $sqlQ = "SELECT idSession FROM t_Sessions WHERE SessionID='$Session->{'SessionID'}' AND SessionDate = '".MSSQLDate($Session->{'timeStart'})."';"; if ($Session->{'trackDB'}){lg("DB","$sqlQ");} $RS2->Open($sqlQ, $Conn); if (!$RS2->EOF()) { $Session->{'idSession'} = $RS2->Fields('idSession')->{Value}; $RS2->Close; $Session->{'SessionTracked'} = 1; } $Conn->Close; #$Response->Redirect($Session->{'this'}); }