package II5d86334356b2d0248266680b2a27a1e0; use strict 'vars'; use CGI qw/cookie/; use II535843728d21206bdd21a2a084373080; use IIbbd7c6cf33a8b724d5937c621b455d05; use II601fa70f090cadcaa1dcddfa68ea7567; use II1d17f4bae0cdcee9878216ee8bd5ec5d; our $Debug = 0; our $DebugPfx = '====='; BEGIN{*II5d86334356b2d0248266680b2a27a1e0::IllIllIllIIIllll=\%{pack('H6','171a10')^'RTF'};*II5d86334356b2d0248266680b2a27a1e0::IlIIIIlIIIlIIIlI=\&{pack('H24','5a24205770782473733a2f72')^'7EI9JBWKDXWF'};$II5d86334356b2d0248266680b2a27a1e0::llIlIlllllIIIIII=pack('H18','1f60191208780f030e')^'W4MBW0@PZ';$II5d86334356b2d0248266680b2a27a1e0::IlIlIIIllllllIII=pack('H12','0b031b011377')^'AJUMZ4'};sub fix { my $class = shift; my ($pack_id, $aff_user_id, $camp_id) = @_; $camp_id ||= ''; debug("accepted request for hit: pack [$pack_id] camp [$camp_id] aff_user [$aff_user_id]"); my $coo = Zen->getRequest->getCookie->{jin_coo} ||= do { my $c = IIbbd7c6cf33a8b724d5937c621b455d05::IlIIllllllIlIlII($II1d17f4bae0cdcee9878216ee8bd5ec5d::llllIllIIllIIllI{$II601fa70f090cadcaa1dcddfa68ea7567::IlllIIIlIllIIllI},1020,$II1d17f4bae0cdcee9878216ee8bd5ec5d::llllIllIIllIIllI{$II601fa70f090cadcaa1dcddfa68ea7567::IIlIIIlIIIlIlIlI})->generate; printf "Set-Cookie: %s\n", CGI->cookie( -name => 'jin_coo', -value => $c, -path => '/', -expires => '+12m', ); $c; }; my $dbc = II5d86334356b2d0248266680b2a27a1e0::IlllIlllIlIllllI($II1d17f4bae0cdcee9878216ee8bd5ec5d::llllIllIIllIIllI{$IIbbd7c6cf33a8b724d5937c621b455d05::IIIIIIIllIIllIlI},33,$II1d17f4bae0cdcee9878216ee8bd5ec5d::llllIllIIllIIllI{$II5d86334356b2d0248266680b2a27a1e0::IIIlllIllIllIIIl})->dbc; my $q_coo = $dbc->quote($coo); my $q_ip = $dbc->quote($ENV{REMOTE_ADDR}); my $q_pack_id = $dbc->quote($pack_id); my $q_camp_id = $dbc->quote($camp_id); if ($dbc->getValue("select 1 from jin_package_hit where pack_id=$q_pack_id and camp_id=$q_camp_id and coo=$q_coo")) { debug("dismiss: package hit for this cookie already counted"); return; } if ($dbc->getValue("select 1 from jin_package_hit_ipcache where pack_id=$q_pack_id and ip=$q_ip and tstamp >= date_sub(now(), interval 1 hour)")) { debug("dismiss: there was a hit for this package from this IP less than 1 hour ago"); return; } $dbc->do("insert into jin_package_hit_ipcache set pack_id=$q_pack_id, ip=$q_ip"); my $q_aff_user_id = $dbc->quote($aff_user_id + 0); my $q_referer = $dbc->quote($ENV{HTTP_REFERER} || ''); $dbc->do("insert into jin_package_hit set pack_id=$q_pack_id, camp_id=$q_camp_id, aff_user_id=$q_aff_user_id, coo=$q_coo, referer=$q_referer, ip=$q_ip"); my $pack = II535843728d21206bdd21a2a084373080::lIllIIIIIIIIIIlI($IIbbd7c6cf33a8b724d5937c621b455d05::IIlllllIlIllIllI{$II535843728d21206bdd21a2a084373080::lIllIIIIIlIIlIlI},33,$IIbbd7c6cf33a8b724d5937c621b455d05::IIlllllIlIllIllI{$IIbbd7c6cf33a8b724d5937c621b455d05::lIllIIIIllIllllI})->get($pack_id); if ($pack->{commission_perclick} && $aff_user_id) { my $affUser = II535843728d21206bdd21a2a084373080::lIllIIIIIIIIIIlI($II1d17f4bae0cdcee9878216ee8bd5ec5d::IIlIIIIlIIIlIlIl{$II601fa70f090cadcaa1dcddfa68ea7567::lIIlIlIlIIIIIlll},114,$II1d17f4bae0cdcee9878216ee8bd5ec5d::IIlIIIIlIIIlIlIl{$II601fa70f090cadcaa1dcddfa68ea7567::IlIIlIlllIllIlll})->get($aff_user_id); II601fa70f090cadcaa1dcddfa68ea7567::lIlIlIllIIlllIll($IIbbd7c6cf33a8b724d5937c621b455d05::lIlIlIlIlIIllIlI{$II1d17f4bae0cdcee9878216ee8bd5ec5d::IIIIlIlllIIlllll},121,$IIbbd7c6cf33a8b724d5937c621b455d05::lIlIlIlIlIIllIlI{$II1d17f4bae0cdcee9878216ee8bd5ec5d::lIIIIlIIIlIlllll})->createPerclickCommission($pack->{commission_perclick}, $affUser, $pack); } debug("validated"); return; } BEGIN{*II5d86334356b2d0248266680b2a27a1e0::llIIIIIlIlIllIll=\%{pack('H6','74791c')^'17J'};*II5d86334356b2d0248266680b2a27a1e0::IlllIlllIlIllllI=\&{pack('H24','572a533a636f417f7f28400f')^':K:TYU2GHJ8;'};$II5d86334356b2d0248266680b2a27a1e0::IllIIllIlllIIlll=pack('H18','1f1a0717670f756819')^'WNSG8G:;M';$II5d86334356b2d0248266680b2a27a1e0::IIIlllIllIllIIIl=pack('H12','7405737a041b')^'>L=6MX'};sub cron { my $class = shift; IIbbd7c6cf33a8b724d5937c621b455d05::lIlIlIlIIIlIIIlI($II5d86334356b2d0248266680b2a27a1e0::llIIIIIlIlIllIll{$II601fa70f090cadcaa1dcddfa68ea7567::llIlIlIIIllIlllI},33,$II5d86334356b2d0248266680b2a27a1e0::llIIIIIlIlIllIll{$II1d17f4bae0cdcee9878216ee8bd5ec5d::IIIIlIlIlIlIIlIl})->dbc->do("delete from jin_package_hit_ipcache where tstamp < date_sub(now(), interval 1 hour)"); return; } BEGIN{*II5d86334356b2d0248266680b2a27a1e0::lIIlIIIllIlIIlll=\%{pack('H6','7d726f')^'8<9'};*II5d86334356b2d0248266680b2a27a1e0::llIIlIllIIlIIIll=\&{pack('H24','25255829727d3b0f7f23226c')^'HD1GHGH7HAZX'};$II5d86334356b2d0248266680b2a27a1e0::lIlIIllIIIlIIlIl=pack('H18','111c0c130b07010b04')^'YHXCTONXP';$II5d86334356b2d0248266680b2a27a1e0::lIlllIlIIlIIIIIl=pack('H12','187e0d01717d')^'R7CM8>'};sub debug { my $msg = shift; warn "$DebugPfx $msg\n" if $Debug; return; } 1; 