From: Dobrica Pavlinusic Date: Mon, 28 Jun 2010 14:49:02 +0000 (+0200) Subject: added remove profile link X-Git-Url: http://git.rot13.org/?p=MojoFacets.git;a=commitdiff_plain;h=932318670257f3f7b4099ad714031b55b20ee607 added remove profile link --- diff --git a/lib/MojoFacets/Profile.pm b/lib/MojoFacets/Profile.pm index ecdd77e..c28e2c5 100644 --- a/lib/MojoFacets/Profile.pm +++ b/lib/MojoFacets/Profile.pm @@ -30,4 +30,15 @@ warn "XXX profile $profile\n"; ); } +sub remove { + my $self = shift; + + if ( my $profile = $self->param('profile') ) { + unlink "/tmp/MojoFacets.profile.$profile"; + rmtree $self->app->home->rel_dir('public') . "/profile/$profile"; + } + + $self->redirect_to('/profile'); +} + 1 diff --git a/templates/profile/index.html.ep b/templates/profile/index.html.ep index fea1ecb..f7cbe9e 100644 --- a/templates/profile/index.html.ep +++ b/templates/profile/index.html.ep @@ -3,7 +3,11 @@