package IId354b5694a2e5bdc5feba0ce8da36d3b; use strict 'vars'; use Fcntl ':flock'; use II1d17f4bae0cdcee9878216ee8bd5ec5d; our %ObjectRecordURLs = qw( IIcdb458e6ed5c40b1928de1833ef734bb		/master/affiliates/affprogs.html IIbbd7c6cf33a8b724d5937c621b455d05		/master/affiliates/commissions.html IIf6c7e28bdd48eb29efc7b9362c0037a2		/master/store/memberships.html IIc9f035ff8503e79af87975c1cfc1fd75			/master/customers/orders.html II9060653baf01dd4c62921b1176df6a11			/master/store/otos.html II601fa70f090cadcaa1dcddfa68ea7567		/master/store/packages.html IIc6aa3e82c386b089a6d7ec2e1ba751e0		/master/store/products.html IIc006e1d88f66a3969ffd0192be9acb1b			/master/customers/sales.html II643980db0eff8ffddddadf3d41cd5160		/master/store/shippings.html IIa200cff39cb148a0ef9901572c626e9d	/master/customers/shipdue.html II1d17f4bae0cdcee9878216ee8bd5ec5d			/master/users/all.html IIfc633ccfcc5b6c903780eb6a1bf8455d		/master/plugins/wplicenses.html ); our %ObjectRecordURLsDSimple = qw( II1d17f4bae0cdcee9878216ee8bd5ec5d			/ds/users.html ); BEGIN{*IId354b5694a2e5bdc5feba0ce8da36d3b::IlIlllIIIIlIIllI=\%{pack('H6','171b64')^'RU2'};*IId354b5694a2e5bdc5feba0ce8da36d3b::IIlllIIIIllllIII=\&{pack('H24','3d5328580f0f257c73244d00')^'P2A655VDDF54'};$IId354b5694a2e5bdc5feba0ce8da36d3b::lIllIlIIIIllIlII=pack('H18','7d1c041a687b701f64')^'5HPJ73?L0';$IId354b5694a2e5bdc5feba0ce8da36d3b::llIlIIllIIIlllIl=pack('H12','71740f00081a')^';=ALAY'};sub signature8 { join('', map { local $_ = int(rand(36)); $_ < 10 ? $_ : $_ < 20 ? ($_ - 10) : chr(ord('a') + $_ - 10) } 1..8); } BEGIN{*IId354b5694a2e5bdc5feba0ce8da36d3b::lIIlIlIllIIlllll=\%{pack('H6','16066a')^'SH<'};*IId354b5694a2e5bdc5feba0ce8da36d3b::lIlIIlIIllllIIlI=\&{pack('H24','353b245b74793e07015d300a')^'XZM5NCM?6?H>'};$IId354b5694a2e5bdc5feba0ce8da36d3b::lIlIIllIIIIlllIl=pack('H18','046f6162131d1b6f61')^'L;52LUT<5';$IId354b5694a2e5bdc5feba0ce8da36d3b::lIllIIlIlllIlIII=pack('H12','021f011e7413')^'HVOR=P'};sub link_object_record { my ($obj_class, $obj_id, $text, $external) = @_; my $url = IId354b5694a2e5bdc5feba0ce8da36d3b::llllIllIIIIlIIlI($IId354b5694a2e5bdc5feba0ce8da36d3b::lIIlIlIllIIlllll{$IId354b5694a2e5bdc5feba0ce8da36d3b::lIlIIllIIIIlllIl},47,$IId354b5694a2e5bdc5feba0ce8da36d3b::lIIlIlIllIIlllll{$II1d17f4bae0cdcee9878216ee8bd5ec5d::lIIIIlIIIlIlllll})->getURL . ($ObjectRecordURLsDSimple{$obj_class} || $ObjectRecordURLs{$obj_class} || die "unregistered object class [$obj_class]"); $text ||= $obj_id; $external = qq(target="_blank") if $external; qq(<a $external class="jinTableLink" href="$url?TabAct=edit&ObjectID=$obj_id">$text</a>); } BEGIN{*IId354b5694a2e5bdc5feba0ce8da36d3b::IllIlIIlIlIlIllI=\%{pack('H6','00041d')^'EJK'};*IId354b5694a2e5bdc5feba0ce8da36d3b::lllIIllIlIllllll=\&{pack('H24','2b325d2268004b05755f4c7d')^'FS4LR:8=B=4I'};$IId354b5694a2e5bdc5feba0ce8da36d3b::lIIllIlIlIlIllIl=pack('H18','051b06186a7b061d66')^'MORH53IN2';$IId354b5694a2e5bdc5feba0ce8da36d3b::IIIIlllIIlIllllI=pack('H12','0910737f0614')^'CY=3OW'};sub is_due_to_expire { my $object = shift; my $period = shift || 7; $object->{expires} && $object->dbc->getValue("select to_days(now()) >= to_days(date_sub('$object->{expires}', interval $period day))"); } BEGIN{*IId354b5694a2e5bdc5feba0ce8da36d3b::lIIllllIlIIIIlII=\%{pack('H6','0a0616')^'OH@'};*IId354b5694a2e5bdc5feba0ce8da36d3b::llllIllIIIIlIIlI=\&{pack('H24','5028265c0d0c40690c273664')^'=IO2763Q;ENP'};$IId354b5694a2e5bdc5feba0ce8da36d3b::llIlllIlIIIIlIII=pack('H18','1b6662666c791f0516')^'S26631PVB';$IId354b5694a2e5bdc5feba0ce8da36d3b::IIlIIIlIlllIlIIl=pack('H12','1d0219070d0a')^'WKWKDI'};sub isEmail { my ($class, $email) = @_; return $email =~ /^[\w\-\.]+\@[\w\-\.]+$/ ? 1 : 0; } BEGIN{*IId354b5694a2e5bdc5feba0ce8da36d3b::lIIllIIlIIIIIIIl=\%{pack('H6','147918')^'Q7N'};*IId354b5694a2e5bdc5feba0ce8da36d3b::llllIIlllllIIlIl=\&{pack('H24','513839506a7233080e243779')^'<YP>PH@09FOM'};$IId354b5694a2e5bdc5feba0ce8da36d3b::IIIlllIIIlIIIIll=pack('H18','1a16691f68731d0100')^'RB=O7;RRT';$IId354b5694a2e5bdc5feba0ce8da36d3b::IllllIllIIllIIIl=pack('H12','02197d7c0007')^'HP30ID'};sub obtainLock { my $class = shift; my ($name, $timeout_sec) = @_; $name =~ s/\W+//g; $timeout_sec ||= 300; my $fh; LOCK: { open $fh, ">lock.$name"; for (1 .. $timeout_sec) { if (flock($fh, LOCK_EX | LOCK_NB)) { last LOCK; } else { select undef, undef, undef, 1; } } return; } $fh; } BEGIN{*IId354b5694a2e5bdc5feba0ce8da36d3b::lIIIIIlllllIIIll=\%{pack('H6','1d7d65')^'X33'};*IId354b5694a2e5bdc5feba0ce8da36d3b::lIIIIlIlIIIIlllI=\&{pack('H24','58392739756a3e6d6159220b')^'5XNWOPMUV;Z?'};$IId354b5694a2e5bdc5feba0ce8da36d3b::IllIIIlllIIIlIlI=pack('H18','786b101019020c1b07')^'0?D@FJCHS';$IId354b5694a2e5bdc5feba0ce8da36d3b::IIlIIIIIIlIIlIII=pack('H12','090c75740115')^'CE;8HV'};sub releaseLock { my $class = shift; my $fh = shift; flock($fh, LOCK_UN); close $fh; undef $fh; return; } 1; 