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