diff options
author | Guilhem Moulin <guilhem.moulin@fripost.org> | 2012-09-09 03:14:41 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem.moulin@fripost.org> | 2012-09-09 03:14:41 +0200 |
commit | a2df8385c36f166d65a447aab4e081961abad5a2 (patch) | |
tree | 680f3e181c1a0b92ba87dec2ebdb581d45bbac6b /lib | |
parent | 6a2e29067e5cfa456de8c43076b6d06ce571be82 (diff) |
Adding a "Cancel" button.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/FPanel/Interface.pm | 12 |
1 files changed, 10 insertions, 2 deletions
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')) { |