package IIf36e12b41a7a84d25fce0419eb850e82::mod_updateuser; use strict; use base qw/II720d6e18aa34327713eb014408fc9144/; use IIa67e09caf104f2e50322b7bc59b766fb; use IIcdb458e6ed5c40b1928de1833ef734bb; use IIf6c7e28bdd48eb29efc7b9362c0037a2; use II7f67ad53d58f9d59124105b4105c9e5b; use II1d17f4bae0cdcee9878216ee8bd5ec5d; use II4599daf4f7c9e8dcf3409f19788cfc0e; use IIb02f8d3064e235967de5c537b3e7ce9b; use II8cd87797a2b7926f5332e1055f4fc090; sub call { my ($class, $api, $in) = @_; return (undef, 'MISSING_ID', "User ID must be specified") unless $in->{id}; my $user = II720d6e18aa34327713eb014408fc9144::IIllIIIlIIllllII($II720d6e18aa34327713eb014408fc9144::llIlIIIlIlIlIlIl{$II720d6e18aa34327713eb014408fc9144::IllIIlIIIIllllII},114,$II720d6e18aa34327713eb014408fc9144::llIlIIIlIlIlIlIl{$II8dae0e141ee45f5daba6a74e4a7c3b6f::IlllIllIIIIIllIl})->search(id => $in->{id})->[0] or return (undef, 'USER_NOT_FOUND', "User not found"); for my $f ($user->fieldsWithExtObjects) { $user->{$f} = $in->{$f} if exists $in->{$f}; } $user->save; while (my ($k, $v) = each %$in) { if ($k =~ /^assign_membership_(\d+)/) { if (my $mem = II982446f8950cc3dc59e487adba22df54::IIlllIlIIllIIlll($IIb39071a48a82a07eeb9256f406abebc5::IIllIIIIIIIIlllI{$IIb39071a48a82a07eeb9256f406abebc5::IllIlIIllIlIIIll},162,$IIb39071a48a82a07eeb9256f406abebc5::IIllIIIIIIIIlllI{$IIb39071a48a82a07eeb9256f406abebc5::lllllIllIllIIllI})->search(id => $1)->[0]) { my $obj = II720d6e18aa34327713eb014408fc9144::lIIlIIlIIIIlIIIl($IIb39071a48a82a07eeb9256f406abebc5::IIllIIIIIIIIlllI{$IIb39071a48a82a07eeb9256f406abebc5::lllllllIlIllIlIl},7,$IIb39071a48a82a07eeb9256f406abebc5::IIllIIIIIIIIlllI{$II720d6e18aa34327713eb014408fc9144::IllIllIIlIIIIlIl})->search( type => 'membership', user_id => $user->{id}, obj_id => $mem->{id}, )->[0] || IIb39071a48a82a07eeb9256f406abebc5::IIlIIIlIIlIIIlIl($IIb39071a48a82a07eeb9256f406abebc5::IIIIIIIlllIlIIlI{$II720d6e18aa34327713eb014408fc9144::lIIlIIIIlllIlIII},7,$IIb39071a48a82a07eeb9256f406abebc5::IIIIIIIlllIlIIlI{$II8dae0e141ee45f5daba6a74e4a7c3b6f::IllllIIIIIlIllIl})->get->set( type => 'membership', user_id => $user->{id}, obj_id => $mem->{id}, obj_title => $mem->{url}, ); $obj->set(expires => ($in->{$k} || undef))->save; } } elsif ($k =~ /^assign_role_(\d+)/) { if (my $role = II982446f8950cc3dc59e487adba22df54::IIllIIllIIIlllll($IIb39071a48a82a07eeb9256f406abebc5::IIIllllIllIlIIIl{$II8dae0e141ee45f5daba6a74e4a7c3b6f::IlIllIIlIllIlIIl},20,$IIb39071a48a82a07eeb9256f406abebc5::IIIllllIllIlIIIl{$II982446f8950cc3dc59e487adba22df54::IIIIIIlIIlIlIIlI})->search(id => $1)->[0]) { my $obj = II982446f8950cc3dc59e487adba22df54::IIllIIllIIIlllll($II982446f8950cc3dc59e487adba22df54::lllllllIIlllIIIl{$II982446f8950cc3dc59e487adba22df54::IllllIlIIIlIIIII},107,$II982446f8950cc3dc59e487adba22df54::lllllllIIlllIIIl{$II720d6e18aa34327713eb014408fc9144::IIllllllIIllllll})->search( user_id => $user->{id}, role_id => $role->{id}, )->[0] || II982446f8950cc3dc59e487adba22df54::lllIllIIIlllIIIl($II720d6e18aa34327713eb014408fc9144::lIIllIIIlIlIlIIl{$II8dae0e141ee45f5daba6a74e4a7c3b6f::IllIlIIllIlIIllI},107,$II720d6e18aa34327713eb014408fc9144::lIIllIIIlIlIlIIl{$IIb39071a48a82a07eeb9256f406abebc5::llIIIIIIlIllIlIl})->get->set( user_id => $user->{id}, role_id => $role->{id}, role_title => $role->{title}, ); $obj->set(expires => ($in->{$k} || undef))->save; } } elsif ($k =~ /^assign_affprog_(\d+)/) { if (my $affprog = II720d6e18aa34327713eb014408fc9144::lIIlIIlIIIIlIIIl($IIb39071a48a82a07eeb9256f406abebc5::lllIlIIlIIIlIlll{$II8dae0e141ee45f5daba6a74e4a7c3b6f::IllIlIIllIlIIllI},77,$IIb39071a48a82a07eeb9256f406abebc5::lllIlIIlIIIlIlll{$II720d6e18aa34327713eb014408fc9144::llIlIIIIIIlIIIIl})->search(id => $1)->[0]) { my $obj = II982446f8950cc3dc59e487adba22df54::lllllIllIlIllllI($II982446f8950cc3dc59e487adba22df54::IIlIllIIIllllIIl{$II720d6e18aa34327713eb014408fc9144::llIlIlIIIIIlIIlI},157,$II982446f8950cc3dc59e487adba22df54::IIlIllIIIllllIIl{$IIb39071a48a82a07eeb9256f406abebc5::llIIllIlIIlIllII})->search( user_id => $user->{id}, affprog_id => $affprog->{id}, )->[0] || II720d6e18aa34327713eb014408fc9144::IlIlIlIIIIllIlII($II720d6e18aa34327713eb014408fc9144::IIllIllllIlllIIl{$IIb39071a48a82a07eeb9256f406abebc5::lIIIlIllllIIlIll},157,$II720d6e18aa34327713eb014408fc9144::IIllIllllIlllIIl{$II720d6e18aa34327713eb014408fc9144::llIIIIIIIlllIIII})->get->set( user_id => $user->{id}, affprog_id => $affprog->{id}, affprog_title => $affprog->{title}, ); $obj->set(expires => ($in->{$k} || undef))->save; } } } return +{ ID => $user->id }; } 1; 