From af2b1cf7299943a6a5b9fddfeb3c9bb5e1ef4931 Mon Sep 17 00:00:00 2001 From: Daouda Lo Date: Sat, 25 Sep 2004 21:56:01 +0000 Subject: - perl-checko --- mdkonline_tui | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'mdkonline_tui') diff --git a/mdkonline_tui b/mdkonline_tui index 4958eeb8..8ba38279 100755 --- a/mdkonline_tui +++ b/mdkonline_tui @@ -50,9 +50,10 @@ my %choices = ( ); my $choice = $choices{account}; -my ($wiz, $login, $nlogin, $password, $npassword, $boxname, $cfmpassword, $email, $is_success, $key); +my ($wiz, $login, $nlogin, $password, $npassword, $boxname, $cfmpassword, $email, $is_success, $key, $r); +my %countries = map { lang::c2name($_) => $_ } lang::list_countries(); -sub read_conf { +sub read_conf() { my $wideconf = '/etc/sysconfig/mdkonline'; my %t = getVarsFromSh($wideconf); my $host = chomp_(`hostname`); @@ -75,11 +76,11 @@ sub send_conf { my $uplink = $online_link . 'wizard.php'; my $pp = md5_hex($pass); my $res; my $w = $in->wait_message(N("Please wait"), N("Reading configuration\n")); - mdkonline::report_config("$confdir/$log.$pass.$box.online.log"); - my $tag = { submit => "upload_wizard", wizard => ["$confdir/$log.$pass.$box.online.log.bz2.uue"] }; + mdkonline::report_config("$confdir/$log.$pp.$box.online.log"); + my $tag = { submit => "upload_wizard", wizard => ["$confdir/$log.$pp.$box.online.log.bz2.uue"] }; undef $w; my $ww = $in->wait_message(N("Please wait"), N("Reading configuration\n")); - ($res, $key) = mdkonline::send_config($link, $tag); + ($res, $key) = mdkonline::send_config($uplink, $tag); mdkonline::hw_upload($login, $pass, $boxname); undef $ww; $res @@ -95,7 +96,7 @@ $wiz = { }, choices => { name => N("Account creation or authentication"), - data => [ { val => \$choice, type => 'list', list => [values %choices ] } ], + data => [ { val => \$choice, type => 'list', list => [ values %choices ] } ], post => sub { +{ reverse %choices }->{$choice} }, }, account => { @@ -144,8 +145,7 @@ $wiz = { }, end => { pre => sub { - my $r = send_conf($login, $password, $boxname); - my %countries = map { lang::c2name($_) => $_ } lang::list_countries(); + $r = send_conf($login, $password, $boxname); }, name => sub { if ($r eq 'TRUE' && $key) { @@ -155,11 +155,12 @@ $wiz = { } }, data => sub { - $r eq 'TRUE' && $key and - [ - { label => N("Country"), val => \&lang::c2name(lang::read('', $>)->{country}) , type => "combo", - list => [ sort keys %countries ], not_edit => 0 } - ]; + if (($r eq 'TRUE') && $key) { + [ + { label => N("Country"), val => \&lang::c2name(lang::read('', $>)->{country}) , type => "combo", + list => [ sort keys %countries ], not_edit => 0 } + ] + } }, end => 1, no_back => 1, -- cgit v1.2.1