send redirect after client params update
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 9 Oct 2010 12:34:44 +0000 (12:34 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 9 Oct 2010 12:34:44 +0000 (12:34 +0000)
lib/PXElator/httpd.pm

index 675e428..a7a1d00 100644 (file)
@@ -366,7 +366,12 @@ warn "XXX pids = ", dump( $daemons::pids );
                        my $config = delete $conf->{config};
 
                        my @editable = ( qw/hostname config homepage/, grep { m{^\Q$config\E} } keys %$conf );
-                       client::conf( $ip, $_ => $param->{$_} ) foreach @editable;
+                       my @update = grep { defined $param->{$_} } @editable;
+                       if ( @update ) {
+                               client::conf( $ip, $_ => $param->{$_} ) foreach @update;
+                               print $client redirect("$url/client/$ip");
+                               return;
+                       }
 
                        my $nmap = qq|<a href=/nmap?scan=$ip>nmap</a>|;
                        my @table = (