package IIf36e12b41a7a84d25fce0419eb850e82::mod_setusermembership; use strict; use base qw/II720d6e18aa34327713eb014408fc9144/; use IIf6c7e28bdd48eb29efc7b9362c0037a2; use IIb02f8d3064e235967de5c537b3e7ce9b; use II1d17f4bae0cdcee9878216ee8bd5ec5d; sub call { my ($class, $api, $in) = @_; my $user = IIb39071a48a82a07eeb9256f406abebc5::IIllIIIIIIlIIlII($II720d6e18aa34327713eb014408fc9144::lIIllllIllIlIIlI{$IIb39071a48a82a07eeb9256f406abebc5::lIlIlllIIlIllIII},114,$II720d6e18aa34327713eb014408fc9144::lIIllllIllIlIIlI{$IIb39071a48a82a07eeb9256f406abebc5::IIllllIIllIlIlll})->search(id => $in->{user_id})->[0] or return (undef, 'INCORRECT_USER', "Incorrect User ID"); my $mem = II982446f8950cc3dc59e487adba22df54::IlIlllIlIIlIllll($II8dae0e141ee45f5daba6a74e4a7c3b6f::lIlllIIIlIlIlIII{$IIb39071a48a82a07eeb9256f406abebc5::lIlIlllIIlIllIII},162,$II8dae0e141ee45f5daba6a74e4a7c3b6f::lIlllIIIlIlIlIII{$II720d6e18aa34327713eb014408fc9144::IllIllIIlIIIIlIl})->search(id => $in->{membership_id})->[0] or return (undef, 'INCORRECT_MEMBERSHIP', "Incorrect Membership ID"); my $user_mem = II8dae0e141ee45f5daba6a74e4a7c3b6f::IIlIlIlIIIlIIlll($II982446f8950cc3dc59e487adba22df54::IllIIIlllllIIlll{$II720d6e18aa34327713eb014408fc9144::llIlIlIIIIIlIIlI},7,$II982446f8950cc3dc59e487adba22df54::IllIIIlllllIIlll{$II720d6e18aa34327713eb014408fc9144::IIIIIlllIllIIlII})->search( type => 'membership', user_id => $user->{id}, obj_id => $mem->{id}, )->[0]; if ($user_mem) { $user_mem->{expires} = $in->{expires} || undef; } else { $user_mem = II982446f8950cc3dc59e487adba22df54::lllllIllIlIllllI($II982446f8950cc3dc59e487adba22df54::lIlIIlIIllIlIIIl{$IIb39071a48a82a07eeb9256f406abebc5::IllIlIIllIlIIIll},7,$II982446f8950cc3dc59e487adba22df54::lIlIIlIIllIlIIIl{$II8dae0e141ee45f5daba6a74e4a7c3b6f::IllIlllllllIlIll})->get->set( type => 'membership', user_id => $user->{id}, obj_id => $mem->{id}, obj_title => $mem->{url}, expires => ($in->{expires} || undef), ); } $user_mem->save; return +{ ID => $user_mem->id }; } 1; 