From a2df8385c36f166d65a447aab4e081961abad5a2 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 9 Sep 2012 03:14:41 +0200 Subject: Adding a "Cancel" button. --- lib/FPanel/Interface.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib/FPanel') diff --git a/lib/FPanel/Interface.pm b/lib/FPanel/Interface.pm index 8087cb9..053e1a2 100644 --- a/lib/FPanel/Interface.pm +++ b/lib/FPanel/Interface.pm @@ -149,9 +149,12 @@ sub EditDomain : Runmode { my ($ul,$ud) = split /\@/, $self->authen->username, 2; my $d = (split /\//, $ENV{PATH_INFO}, 3)[1]; - my $fp = Fripost::Schema::->SASLauth( $self->authen->username, %CFG ); my $q = $self->query; + return $self->redirect($q->url .'/') if defined $q->param('cancel'); + + my $fp = Fripost::Schema::->SASLauth( $self->authen->username, %CFG ); + my $error; # Tells whether the change submission has failed. if (defined $q->param('submit')) { # Changes have been submitted: process them @@ -200,9 +203,12 @@ sub EditLocal : Runmode { my ($ul,$ud) = split /\@/, $self->authen->username, 2; my ($null,$d,$l,$crap) = split /\//, $ENV{PATH_INFO}, 4; - my $fp = Fripost::Schema::->SASLauth( $self->authen->username, %CFG ); my $q = $self->query; + return $self->redirect($q->url.'/'.$d.'/') if defined $q->param('cancel'); + + my $fp = Fripost::Schema::->SASLauth( $self->authen->username, %CFG ); + my $error; # Tells whether the change submission has failed. if (defined $q->param('submit')) { # Changes have been submitted: process them @@ -330,6 +336,8 @@ sub AddLocal : Runmode { my $d = (split /\//, $ENV{PATH_INFO}, 3)[1]; my $q = $self->query; + return $self->redirect($q->url.'/'.$d.'/') if defined $q->param('cancel'); + my $t = $q->param('t') // die "Undefined type"; my $error; # Tells whether the change submission has failed. if (defined $q->param('submit')) { -- cgit v1.2.3