summaryrefslogtreecommitdiffstats
path: root/drakwizard.pl
diff options
context:
space:
mode:
Diffstat (limited to 'drakwizard.pl')
-rwxr-xr-xdrakwizard.pl17
1 files changed, 14 insertions, 3 deletions
diff --git a/drakwizard.pl b/drakwizard.pl
index 05c2e9c4..72740c0a 100755
--- a/drakwizard.pl
+++ b/drakwizard.pl
@@ -76,10 +76,21 @@ sub wizard {
my $page = $o->{pages}{welcome};
$::Wizard_title = $o->{name};
$::Wizard_pix_up = $o->{defaultimage};
+ check_rpm($o->{needed_rpm}) if $o->{needed_rpm};
+ if (defined $o->{init}) {
+ my ($res, $msg) = &{$o->{init}};
+ if (!$res) {
+ $in->ask_okcancel("error", $msg);
+ exit if ! $::testing
+ }
+ }
+ print "root $> allow_user $o->{allow_user} testing $::testing\n";
+ if ($> && !$o->{allow_user} && !$::testing) {
+ $in->ask_okcancel("error", N('You need to be root to run this wizard'));
+ exit;
+ }
my $next = 'welcome';
my @steps;
- check_rpm($o->{needed_rpm}) if $o->{needed_rpm};
- defined $o->{init} and &{$o->{init}};
while (1) {
undef $::Wizard_no_previous;
undef $::Wizard_no_cancel;
@@ -107,7 +118,7 @@ sub wizard {
}
my $a = $in->ask_from($o->{name}, $page->{name}, $data2);
if ($a) {
- push @steps, $next;
+ push @steps, $next if !$page->{ignore} && $steps[$#steps] ne $next;
$next = defined $page->{post} ? $page->{post}() : 0;
defined $o->{pages}{$next} or $next = $page->{next};
} else {