<& /Admin/Elements/Header, Title => loc("Apple GSX") &> <& /Elements/Tabs &> % unless ($ok) { <&| /Widgets/TitleBox, title => loc('Authentication failure'), class => "error" &> Credentials below are incorrect! % }
<& /Elements/Submit, Name => "Update", Label => loc('Update') &>
<%init> $m->clear_and_abort(403) unless $session{'CurrentUser'}->HasRight( Object => RT->System, Right => 'SuperUser', ); my $config = RT->System->FirstAttribute('AppleGSXOptions'); $config = $config ? $config->Content : {}; if ($ARGS{Update}) { $config->{UserId} = $UserId; $config->{Password} = $Password if $Password; $config->{ServiceAccountNo} = $ServiceAccountNo; RT->System->SetAttribute( Name => 'AppleGSXOptions', Content => $config ); } my $gsx = RT::Extension::Assets::AppleGSX->Client; my $ok = $config->{UserId} && $config->{Password} && $config->{ServiceAccountNo} && $gsx->Authenticate; $UserId = $config->{UserId}; $ServiceAccountNo = $config->{ServiceAccountNo}; <%args> $UserId => "" $Password => "" $ServiceAccountNo => ""