my $nonfatal=shift;
my $canedit;
- my $callback;
run_hooks(canedit => sub {
return if defined $canedit;
my $ret=shift->($page, $q, $session);
$canedit=1;
}
elsif (ref $ret eq 'CODE') {
+ $ret->() unless $nonfatal;
$canedit=0;
- $callback->() unless $nonfatal;
}
elsif (defined $ret) {
- $canedit=0;
error($ret) unless $nonfatal;
+ $canedit=0;
}
}
});
}
elsif ($form->submitted eq 'Save Preferences' && $form->validate) {
foreach my $field (qw(email subscriptions)) {
- if (defined $form->field($field) && length $form->field($field)) {
+ if (defined $form->field($field)) {
userinfo_set($user_name, $field, $form->field($field)) ||
error("failed to set $field");
}
elsif ($do eq 'create' || $do eq 'edit') {
cgi_editpage($q, $session);
}
- elsif (defined $session->param("postsignin")) {
+ elsif (defined $session->param("postsignin") || $do eq 'postsignin') {
cgi_postsignin($q, $session);
}
else {