From 932318670257f3f7b4099ad714031b55b20ee607 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Mon, 28 Jun 2010 16:49:02 +0200 Subject: [PATCH] added remove profile link --- lib/MojoFacets/Profile.pm | 11 +++++++++++ templates/profile/index.html.ep | 6 +++++- 2 files changed, 16 insertions(+), 1 deletion(-) 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 @@ -- 2.20.1