diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2004-02-14 01:07:14 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2004-02-14 01:07:14 +0000 |
commit | a5f46234bc3b8ac3983d9afa23405292105a4c7e (patch) | |
tree | 652f45df2280ff35b216a57dfec2922cd415d1d1 | |
parent | 251105d1307f182f1dfe03ff3dffdcb0a22b956c (diff) | |
download | drakwizard-a5f46234bc3b8ac3983d9afa23405292105a4c7e.tar drakwizard-a5f46234bc3b8ac3983d9afa23405292105a4c7e.tar.gz drakwizard-a5f46234bc3b8ac3983d9afa23405292105a4c7e.tar.bz2 drakwizard-a5f46234bc3b8ac3983d9afa23405292105a4c7e.tar.xz drakwizard-a5f46234bc3b8ac3983d9afa23405292105a4c7e.zip |
example of use of "complete" callback
-rwxr-xr-x | postfix_wizard/Postfix.pm | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/postfix_wizard/Postfix.pm b/postfix_wizard/Postfix.pm index 9e04696f..46991f39 100755 --- a/postfix_wizard/Postfix.pm +++ b/postfix_wizard/Postfix.pm @@ -83,7 +83,13 @@ $o->{pages} = { pre => sub { $o->{var}{wiz_mail_masquerade} ||= get_mail_masquerade(); }, - post => \&check_masquerade, + complete => sub { + print "in is $::in\n"; + if ($o->{var}{wiz_mail_masquerade} !~ /\w+\.\w+$/) { + $::in->ask_warn(N("Error"), N("Masquerade should be a valid domain name such as \"mydomain.com\"!")); + return 1; + } + }, data => [ { label => N("Masquerade domain name:"), val => \$o->{var}{wiz_mail_masquerade} }, ], @@ -93,10 +99,6 @@ $o->{pages} = { name => N("Warning:") . "\n\n" . N("You entered an empty address for the mail gateway.") . "\n\n" . N("Your choice can be accepted, but this will not allow you to send mail outside your local network. Press next to continue, or back to enter a value."), next => 'summaryext', }, - masquerade_not_good => { - name => N("Error.") . "\n\n" . N("Masquerade not good!"), - next => 'external' - }, error_sendmail => { name => N("Error, sendmail is installed, please remove it before install and configure Postfix"), no_back => 1, @@ -172,10 +174,6 @@ sub check_sendmail { undef $w; } -sub check_masquerade { - $o->{var}{wiz_mail_masquerade} or return 'masquerade_not_good'; - $o->{var}{wiz_mail_masquerade} =~ /\w+\.\w+$/ or return 'masquerade_not_good'; -} sub check_relay { $o->{var}{wiz_ext_mail_relay} or return 'warning'; |