%# %# $Id$ %# % layout 'default'; % title 'Maacom'; % use Mojo::Util qw(dumper); % my $u = $c->app->user; % my $name = $c->req->param('trusted_name'); % my $trusted_id = $c->req->param('trusted_id') || 0; % my $profile = $u->trusted_profile($trusted_id); % if ($profile) { % my $cid = $u->trusted_exist($name); % if ($cid) {
Host <%= $name %> already exists
% } % unless ($cid) { % my $res = $u->trusted_update($trusted_id, name => $name); % if ($res) {
Host <%= $name %> has been updated.
% } % unless ($res) {
Host <%= $name %> was not updated.
% } % } % } % unless ($profile) {
Host with id <%= $trusted_id %> not exist
% } %#EOF