package II8dacc0e8302b4ca99cad4aa84670b633; use strict 'vars'; use base qw/II674e2407e107271bcc76478050bc636a/; use IIcdb458e6ed5c40b1928de1833ef734bb; use II601fa70f090cadcaa1dcddfa68ea7567; BEGIN{*II8dacc0e8302b4ca99cad4aa84670b633::IlIllIlllIIIlIIl=\%{pack('H6','73086b')^'6F='};*II8dacc0e8302b4ca99cad4aa84670b633::lIlIIlIIIIIIllIl=\&{pack('H24','55565954727b387767344971')^'870:HAKOPV1E'};$II8dacc0e8302b4ca99cad4aa84670b633::lllllIIlllIlIIIl=pack('H18','796b6965077e1d1c0c')^'1?=5X6ROX';$II8dacc0e8302b4ca99cad4aa84670b633::lIlIIIIlIllIIIIl=pack('H12','130b01711d13')^'YBO=TP'};sub dbTable     { 'jin_affinb_cfg' } BEGIN{*II8dacc0e8302b4ca99cad4aa84670b633::llllIIIIllIIlIll=\%{pack('H6','7a0f02')^'?AT'};*II8dacc0e8302b4ca99cad4aa84670b633::IllIlIlIlIlIIIlI=\&{pack('H24','213b3153777c416278283572')^'LZX=MF2ZOJMF'};$II8dacc0e8302b4ca99cad4aa84670b633::llIlIlllIlIlIlII=pack('H18','0c021a6318097a6c68')^'DVN3GA5?<';$II8dacc0e8302b4ca99cad4aa84670b633::llIlllIIIlIllIlI=pack('H12','061a7f157070')^'LS1Y93'};sub dbFields    { qw/ owner_id affprogs / } BEGIN{*II8dacc0e8302b4ca99cad4aa84670b633::IllIlllIlIIIlIlI=\%{pack('H6','1d0868')^'XF>'};*II8dacc0e8302b4ca99cad4aa84670b633::lllllIlIIIIIIIIl=\&{pack('H24','29213a3c0471296809554d63')^'D@SR>KZP>75W'};$II8dacc0e8302b4ca99cad4aa84670b633::IllIllIllIIllIII=pack('H18','71691f056b0116631b')^'9=KU4IY0O';$II8dacc0e8302b4ca99cad4aa84670b633::lIllIIIIIllllIIl=pack('H12','0d040e1e7a1b')^'GM@R3X'};sub defaultViewClass { II674e2407e107271bcc76478050bc636a::IIlllIllIIIIllIl($IIcdb458e6ed5c40b1928de1833ef734bb::llIllIIllIIIlIII{$II674e2407e107271bcc76478050bc636a::IlIIIllIIlIIllII},826,$IIcdb458e6ed5c40b1928de1833ef734bb::llIllIIllIIIlIII{$II8dacc0e8302b4ca99cad4aa84670b633::llIlllIIIlIllIlI}) } BEGIN{*II8dacc0e8302b4ca99cad4aa84670b633::lIIllllllIIlIIII=\%{pack('H6','0a1e65')^'OP3'};*II8dacc0e8302b4ca99cad4aa84670b633::llIIIIIlIlIIIlII=\&{pack('H24','26232c54016d20707f3a4a62')^'KBE:;WSHHX2V'};$II8dacc0e8302b4ca99cad4aa84670b633::llIIIIIllIllIIIl=pack('H18','091107020504796266')^'AESRZL612';$II8dacc0e8302b4ca99cad4aa84670b633::IIIIllIIlllIllIl=pack('H12','727e1e020203')^'87PNK@'};sub isAvailableForAffiliate { my ($class, $affuser) = @_; die unless $affuser; my $cfg = $class->getAdminRecord; return 0 unless $cfg->{affprogs}; my $user_affprogs = $class->userAffprogsHashCached($affuser); return 0 unless grep { $user_affprogs->{$_} } split(',', $cfg->{affprogs}); return 1; } BEGIN{*II8dacc0e8302b4ca99cad4aa84670b633::lIlllIIIIIIlIllI=\%{pack('H6','730d13')^'6CE'};*II8dacc0e8302b4ca99cad4aa84670b633::IllllIIIIIIlllll=\&{pack('H24','2b5e2f2f06783a08665e3501')^'F?FA<BI0Q<M5'};$II8dacc0e8302b4ca99cad4aa84670b633::IIIlIIllIlllIlll=pack('H18','041f0716141c0d661c')^'LKSFKTB5H';$II8dacc0e8302b4ca99cad4aa84670b633::IlIIlIlIlIlIlllI=pack('H12','0202760b7d7d')^'HK8G4>'};sub getPackagesWithBonusesForAffiliate { my ($class, $affuser) = @_; return unless $class->isAvailableForAffiliate($affuser); my $user_affprogs = $class->userAffprogsHashCached($affuser); my @all_packs = IIcdb458e6ed5c40b1928de1833ef734bb::lIllIllIIIIIlIlI($IIcdb458e6ed5c40b1928de1833ef734bb::IIIIIIllIllllIIl{$IIcdb458e6ed5c40b1928de1833ef734bb::IlIIllIIIIIIllIl},33,$IIcdb458e6ed5c40b1928de1833ef734bb::IIIIIIllIllllIIl{$IIcdb458e6ed5c40b1928de1833ef734bb::lIlllllIIIIIIIII})->search( WHERE => sprintf("(type=%s or type=%s)", $class->typeNormal, $class->typeMinisite), WHERE => '(' . (join ' or ', map { "find_in_set('$_',affprogs)" } keys %$user_affprogs) . ')', ORDER => "title asc", ); my %bonus_packs = map { $_ => 1 } IIcdb458e6ed5c40b1928de1833ef734bb::llIlIIIlIlllIIII($II674e2407e107271bcc76478050bc636a::IlllIIIIlIIlIllI{$IIcdb458e6ed5c40b1928de1833ef734bb::lllIIIlllIIllllI},45,$II674e2407e107271bcc76478050bc636a::IlllIIIIlIIlIllI{$II8dacc0e8302b4ca99cad4aa84670b633::lIlIIIIlIllIIIIl})->getColumn('pack_id', aff_id => $affuser->{id}, active => 1); grep { $bonus_packs{$_->{id}} } @all_packs; } BEGIN{*II8dacc0e8302b4ca99cad4aa84670b633::lIllIllIIlIlIlIl=\%{pack('H6','707f0f')^'51Y'};*II8dacc0e8302b4ca99cad4aa84670b633::llIIIllIlIIIlIIl=\&{pack('H24','595b2e347f0831706d373163')^'4:GZE2BHZUIW'};$II8dacc0e8302b4ca99cad4aa84670b633::IlIllllIIIlllllI=pack('H18','0801646f0908740600')^'@U0?V@;UT';$II8dacc0e8302b4ca99cad4aa84670b633::IllIllllIIIIIlll=pack('H12','70707b797b1a')^':9552Y'};sub userAffprogsHashCached { my $class = shift; my $user = shift; Zen->getRequest->getRequestCache->{UserAffprogsHash} ||= do { my %h = map { $_ => 1 } II8dacc0e8302b4ca99cad4aa84670b633::lllllIlIIIIIIIIl($II674e2407e107271bcc76478050bc636a::IlllIllIIIIlIlIl{$II601fa70f090cadcaa1dcddfa68ea7567::IIllIIIIIIIIlIIl},77,$II674e2407e107271bcc76478050bc636a::IlllIllIIIIlIlIl{$II674e2407e107271bcc76478050bc636a::IIlIIlIIIIIlIIll})->enum( validForUser => $user->{id}, ); \%h; }; } 1; 