package IIf36e12b41a7a84d25fce0419eb850e82::mod_getuser; use strict; use base qw/II720d6e18aa34327713eb014408fc9144/; use IIc006e1d88f66a3969ffd0192be9acb1b; use II371757f50bba70b0f2acd445b94a6d95; use II1d17f4bae0cdcee9878216ee8bd5ec5d; use II4599daf4f7c9e8dcf3409f19788cfc0e; use IIb02f8d3064e235967de5c537b3e7ce9b; use II8cd87797a2b7926f5332e1055f4fc090; use IIbbd7c6cf33a8b724d5937c621b455d05; sub call { my ($class, $api, $in) = @_; return (undef, 'MISSING_USER_ID_OR_EMAIL', 'Please specify user e-mail or ID') unless $in->{email} || $in->{id}; my $user = $in->{email} ? IIb39071a48a82a07eeb9256f406abebc5::lllllIIIlIIlIlII($II8dae0e141ee45f5daba6a74e4a7c3b6f::lIlllIlIlIlIlIll{$II8dae0e141ee45f5daba6a74e4a7c3b6f::IIIlIIlllIIlIlII},114,$II8dae0e141ee45f5daba6a74e4a7c3b6f::lIlllIlIlIlIlIll{$IIb39071a48a82a07eeb9256f406abebc5::llIIllIlIIlIllII})->search(email => $in->{email})->[0] : $in->{id} ? II8dae0e141ee45f5daba6a74e4a7c3b6f::IlIIIIIIIlllIlII($IIb39071a48a82a07eeb9256f406abebc5::lllIlIIlIIIlIlll{$II720d6e18aa34327713eb014408fc9144::lIIIIIlIIIlIIIII},114,$IIb39071a48a82a07eeb9256f406abebc5::lllIlIIlIIIlIlll{$IIb39071a48a82a07eeb9256f406abebc5::llIIllIlIIlIllII})->search(id => $in->{id})->[0] : undef; return (undef, 'USER_NOT_FOUND', 'User not found') unless $user; if ($api->{specusers}) { my $su = II8dae0e141ee45f5daba6a74e4a7c3b6f::IIlIlIlIIIlIIlll($IIb39071a48a82a07eeb9256f406abebc5::IIIIIIIlllIlIIlI{$IIb39071a48a82a07eeb9256f406abebc5::IllIlIIllIlIIIll},28,$IIb39071a48a82a07eeb9256f406abebc5::IIIIIIIlllIlIIlI{$II8dae0e141ee45f5daba6a74e4a7c3b6f::IlllIllIIIIIllIl})->getOrEmpty($api->{specusers}); return (undef, 'USER_NOT_AVAILABLE', 'User is not available through this API gate') unless $su && $su->isInByEmail($user->{email}); } my %disable = map { $_ => 1 } split(',', $in->{disable}); my $data = { User => $user }; $data->{Sales} = IIb39071a48a82a07eeb9256f406abebc5::lllllIlIIIIlIIlI($II720d6e18aa34327713eb014408fc9144::lIIllIIIlIlIlIIl{$II720d6e18aa34327713eb014408fc9144::IIIllIIlIlllIIll},100,$II720d6e18aa34327713eb014408fc9144::lIIllIIIlIlIlIIl{$IIb39071a48a82a07eeb9256f406abebc5::llIlIIIIllIIIlII})->search(user_id => $user->id, ORDER => 'ctime') unless $disable{sales}; $data->{Memberships} = IIb39071a48a82a07eeb9256f406abebc5::IIIIIIIllIlIIlll($IIb39071a48a82a07eeb9256f406abebc5::IIIIIIIlllIlIIlI{$II720d6e18aa34327713eb014408fc9144::lIIIIIlIIIlIIIII},7,$IIb39071a48a82a07eeb9256f406abebc5::IIIIIIIlllIlIIlI{$II720d6e18aa34327713eb014408fc9144::llIIIIIlllllIlIl})->search(type => 'membership', user_id => $user->id) unless $disable{memberships}; $data->{Roles} = IIb39071a48a82a07eeb9256f406abebc5::lllllIlIIIIlIIlI($II720d6e18aa34327713eb014408fc9144::lIIllllIllIlIIlI{$II8dae0e141ee45f5daba6a74e4a7c3b6f::IlIllIIlIllIlIIl},107,$II720d6e18aa34327713eb014408fc9144::lIIllllIllIlIIlI{$II720d6e18aa34327713eb014408fc9144::IlIIllIlllllIIll})->search(user_id => $user->id) unless $disable{roles}; $data->{Affprogs} = II982446f8950cc3dc59e487adba22df54::lIlIllIlllllIlll($II982446f8950cc3dc59e487adba22df54::lllllllIIlllIIIl{$II720d6e18aa34327713eb014408fc9144::IlIlllIIllllllll},157,$II982446f8950cc3dc59e487adba22df54::lllllllIIlllIIIl{$II720d6e18aa34327713eb014408fc9144::llIIIIIIIlllIIII})->search(user_id => $user->id) unless $disable{affprogs}; my @sea = ( FETCH => 'jin_commission.id id, jin_commission.ctime ctime, jin_commission.descr descr, jin_commission.amount amount, jin_commission.paid paid, jin_sale.amount_prod price', JOIN => 'LEFT JOIN jin_sale ON jin_sale.id = jin_commission.sale_id', WHERE => "jin_commission.ben_user_id=" . $user->id, ORDER => 'ctime DESC', ); $data->{Commissions} = II982446f8950cc3dc59e487adba22df54::lllIllIIIlllIIIl($II8dae0e141ee45f5daba6a74e4a7c3b6f::IIllllIllllllIll{$II8dae0e141ee45f5daba6a74e4a7c3b6f::IIIlIIlllIIlIlII},121,$II8dae0e141ee45f5daba6a74e4a7c3b6f::IIllllIllllllIll{$IIb39071a48a82a07eeb9256f406abebc5::llIIIllIIlIIIIIl})->search(@sea); $data->{UserFields} = ['id', II720d6e18aa34327713eb014408fc9144::lIIlIIIIllIllIIl($II982446f8950cc3dc59e487adba22df54::IIllllIlIIIIIlll{$II8dae0e141ee45f5daba6a74e4a7c3b6f::IIIIlIIlIIIIIIIl},114,$II982446f8950cc3dc59e487adba22df54::IIllllIlIIIIIlll{$II720d6e18aa34327713eb014408fc9144::IIIIIIllIIlllIIl})->fieldsWithExtObjects]; $data->{SaleFields} = [IIb39071a48a82a07eeb9256f406abebc5::lllllIIIlIIlIlII($II720d6e18aa34327713eb014408fc9144::lIlIIIIlIllllIIl{$IIb39071a48a82a07eeb9256f406abebc5::llllIIllIIIIIIIl},100,$II720d6e18aa34327713eb014408fc9144::lIlIIIIlIllllIIl{$II982446f8950cc3dc59e487adba22df54::IllIIIlIllllIlll})->fields]; $data->{MembershipFields} = [qw/ ctime obj_id obj_title sale_id expires expired /]; $data->{RoleFields} = [qw/ role_id role_title sale_id expires expired notapproved /]; $data->{AffprogFields} = [qw/ ctime affprog_id affprog_title sale_id expires expired notapproved /]; $data->{CommissionFields} = [qw/ ctime descr amount paid price /]; $data; } 1; 