Retry after REJECT: edit bad input instead of aborting

This commit is contained in:
Juerd Waalboer 2019-11-03 00:13:43 +01:00
parent e00fc00664
commit d8dfc2cde2
3 changed files with 41 additions and 7 deletions

View file

@ -8,7 +8,7 @@ sub command :Tab(adduser) {
$command eq 'adduser' or return NEXT;
if ($cart->size) {
return REJECT, "Create the account *before* scanning things.";
return ABORT, "Create the account *before* scanning things.";
}
return "Name for the new account", \&username;

View file

@ -29,6 +29,11 @@ sub hook_reject {
_log("REJECT [$plugin] $reason");
}
sub hook_retry {
my ($class, $plugin, $reason, $abort) = @_;
_log("RETRY [$plugin] $reason");
}
sub hook_user_created {
my ($class, $username) = @_;
_log("NEWUSER $username");