package II42be18dc49337a28a0514fe301ecddfc; use strict 'vars'; use base qw/II720d6e18aa34327713eb014408fc9144/; use Archive::Zip; use utf8; use File::Path 'rmtree'; use II3562149e53818b6637b38680e87ba918::conflist; use IIfc633ccfcc5b6c903780eb6a1bf8455d; use II9a6f1d814970c6f43d65b8e42d8dd59e; BEGIN{*II42be18dc49337a28a0514fe301ecddfc::lIIIlIIlIlIIllII=\%{pack('H6','720b03')^'7EU'};*II42be18dc49337a28a0514fe301ecddfc::IllllllIIllIIlll=\&{pack('H24','3f27262e6c024e0067363e67')^'RFO@V8=8PTFS'};$II42be18dc49337a28a0514fe301ecddfc::lllIIlIlIIIIIIll=pack('H18','1d1b1512097b181f6f')^'UOABV3WL;';$II42be18dc49337a28a0514fe301ecddfc::lIlllIllllIIIIIl=pack('H12','180f1a710b0f')^'RFT=BL'};sub act_download { my $class = shift; my $in = Zen->getRequest->getInput; die "expected UIID identifier" unless $in->{uiid}; my $user = II42be18dc49337a28a0514fe301ecddfc::IllllllIIllIIlll($II9a6f1d814970c6f43d65b8e42d8dd59e::IIIlIllIlIllIIIl{$II9a6f1d814970c6f43d65b8e42d8dd59e::IIllIlIIlIlIIlIl},1007,$II9a6f1d814970c6f43d65b8e42d8dd59e::IIIlIllIlIllIIIl{$II9a6f1d814970c6f43d65b8e42d8dd59e::lIIIIIlIlIllIIIl})->get('Jin')->getUser or die "no logged user detected"; my $object = II42be18dc49337a28a0514fe301ecddfc::IllllllIIllIIlll($II720d6e18aa34327713eb014408fc9144::lIIIlllIllIIlllI{$II42be18dc49337a28a0514fe301ecddfc::lllIIlIlIIIIIIll},125,$II720d6e18aa34327713eb014408fc9144::lIIIlllIllIIlllI{$II42be18dc49337a28a0514fe301ecddfc::lIlllIllllIIIIIl})->getOrDummy($in->{uiid}) or die "object not found"; my $wppl = IIfc633ccfcc5b6c903780eb6a1bf8455d::lllIIllllIIllIlI($II720d6e18aa34327713eb014408fc9144::lIlIIIIlIllllIIl{$IIfc633ccfcc5b6c903780eb6a1bf8455d::IIlllIIIllIIlIII},128,$II720d6e18aa34327713eb014408fc9144::lIlIIIIlIllllIIl{$II9a6f1d814970c6f43d65b8e42d8dd59e::IIIIIllIllIlIIll})->getOrDummy($object->{wplicense_id}) or die "No valid WPPL!"; my $xml_path =  IIfc633ccfcc5b6c903780eb6a1bf8455d::IlIllIIllIllIIlI($II720d6e18aa34327713eb014408fc9144::llIlIIIlIlIlIlIl{$II9a6f1d814970c6f43d65b8e42d8dd59e::IllIlIIlllIIIllI},47,$II720d6e18aa34327713eb014408fc9144::llIlIIIlIlIlIlIl{$II9a6f1d814970c6f43d65b8e42d8dd59e::IIIIIllIllIlIIll})->getFilesURL . "/wplicense-plugins/plugin_" . $object->{wplicense_id} . "/"; my $path = $wppl->getPluginPath; my $tmp_path = "tmp_" . $object->{wplicense_id} . "_" . $object->{sale_id} . "/"; my $zip = Archive::Zip->new($path . $object->{wplicense_id} . "_1.zip"); foreach my $member ($zip->members) { my $extractName = $member->fileName; $member->extractToFileNamed($path . $tmp_path . $extractName); } $zip = Archive::Zip->new(); open(my $fh, '<:encoding(UTF-8)', $path . $tmp_path . $wppl->{plugin_name} . ".php") or die "Plugin PHP file could not be opened."; my @lines; while (my $line = <$fh>) { chomp $line; $line =~ s/^\/\/\s+.*$//g; $line =~ s/^\/\/$//g; $line =~ s/^\s+\/\/\s+.*$//g; $line =~ s/\s+\/\/.*//g; $line =~ s/<!--.*-->//g; $line =~ s/^\s+//g; $line =~ s/\s+$//g; $line =~ s/^\s*\n//mg; push @lines, $line; } close $fh; push @lines, "<?php"; push @lines, "function curl(\$url){\$ch = curl_init();curl_setopt(\$ch, CURLOPT_URL,\$url); curl_setopt(\$ch, CURLOPT_RETURNTRANSFER,1); \$return = curl_exec(\$ch); curl_close (\$ch); return \$return;}"; push @lines, "function chd() {\$data = curl('http://$ENV{HTTP_HOST}$xml_path$object->{wplicense_id}_$object->{sale_id}.xml'); \$ls = new SimpleXMLElement(\$data); \$ls_data = \$ls->xpath('//data'); \$host = strval(\$ls_data[0]->host); if (strpos(\$_SERVER['HTTP_HOST'], \$host) === false) {die(\"WARNING: No this is not the valid \$host domain!\"); } }"; push @lines, "add_action('init', 'chd');"; push @lines, "?>"; my $line; my $filedata = ""; foreach $line (@lines) { $filedata .= $line . "\n" if $line; } utf8::encode $filedata; $zip->addTree($path . $tmp_path); $zip->addString("\x{EF}\x{BB}\x{BF}" . $filedata, $wppl->{plugin_name} . ".php"); close $fh; my $tstamp = II720d6e18aa34327713eb014408fc9144::lIIlIIlIIIIlIIIl($II42be18dc49337a28a0514fe301ecddfc::lIIIlIIlIlIIllII{$II720d6e18aa34327713eb014408fc9144::IlIlIllIIIIIllll},1010,$II42be18dc49337a28a0514fe301ecddfc::lIIIlIIlIlIIllII{$II9a6f1d814970c6f43d65b8e42d8dd59e::IIIIIllIllIlIIll})->new->datetime; $tstamp =~ s/\D//g; my $zipfilename = "plugin_$object->{domain}_$tstamp"; print "Content-Type: application/zip; name=\"$zipfilename.zip\"\n"; print "Content-Disposition: attachment; filename=\"$zipfilename.zip\"\n\n"; $zip->writeToFileHandle(\*STDOUT); rmtree([ $path . $tmp_path ]); } 1; 