diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2004-01-28 11:30:15 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2004-01-28 11:30:15 +0000 |
commit | e56387cd4d995657f4200fb06a5cf798e23d9ec4 (patch) | |
tree | ebbe3e767b5c5dce2dd420e4923e4095a6580721 /perl-install/network/modem.pm | |
parent | 717dd0b2cedd23fae2272c57b7706f597d10ab68 (diff) | |
download | drakx-e56387cd4d995657f4200fb06a5cf798e23d9ec4.tar drakx-e56387cd4d995657f4200fb06a5cf798e23d9ec4.tar.gz drakx-e56387cd4d995657f4200fb06a5cf798e23d9ec4.tar.bz2 drakx-e56387cd4d995657f4200fb06a5cf798e23d9ec4.tar.xz drakx-e56387cd4d995657f4200fb06a5cf798e23d9ec4.zip |
simplify code through format callback (thus enabling to centralize translatable
strings, thus reducing error risk)
Diffstat (limited to 'perl-install/network/modem.pm')
-rw-r--r-- | perl-install/network/modem.pm | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/perl-install/network/modem.pm b/perl-install/network/modem.pm index ef916eb6a..dbeefe318 100644 --- a/perl-install/network/modem.pm +++ b/perl-install/network/modem.pm @@ -18,8 +18,7 @@ sub ppp_configure { any::devfssymlinkf($modem, 'modem') if $modem->{device} ne "/dev/modem"; - my %toreplace = map { $_ => $modem->{$_} } qw(auth AutoName connection dns1 dns2 domain IPAddr login passwd phone SubnetMask); - $toreplace{kpppauth} = ${{ N("Script-based") => 0, N("PAP") => 1, N("Terminal-based") => 2, N("CHAP") => 3, N("PAP/CHAP") => 4 }}{$modem->{auth}}; + my %toreplace = map { $_ => $modem->{$_} } qw(Authentication AutoName connection dns1 dns2 domain IPAddr login passwd phone SubnetMask); $toreplace{phone} =~ s/[a-zA-Z]//g; if ($modem->{auto_dns} ne N("Automatic")) { $toreplace{dnsserver} = join ',', map { $modem->{$_} } "dns1", "dns2"; @@ -32,7 +31,7 @@ sub ppp_configure { $toreplace{connection} ||= 'DialupConnection'; $toreplace{domain} ||= 'localdomain'; $toreplace{intf} ||= 'ppp0'; - $toreplace{papname} = ($modem->{auth} eq 'PAP' || $modem->{auth} eq 'CHAP') && $toreplace{login}; + $toreplace{papname} = $toreplace{login} if member($modem->{Authentication}, 1, 3, 4); # handle static/dynamic settings: if ($modem->{auto_ip} eq N("Automatic")) { @@ -92,7 +91,7 @@ END 'OK' 'ATDT$toreplace{phone}' 'CONNECT' '' END - if ($modem->{auth} eq 'Terminal-based' || $modem->{auth} eq 'Script-based') { + if (member($modem->{Authentication}, 0, 2)) { push @chat, <<END; 'ogin:--ogin:' '$toreplace{login}' 'ord:' '$toreplace{passwd}' @@ -129,7 +128,7 @@ Password=$toreplace{passwd} BeforeDisconnect= Command= ScriptCommands= -Authentication=$toreplace{kpppauth} +Authentication=$toreplace{Authentication} DNS=$toreplace{dnsserver} SubnetMask=$toreplace{SubnetMask} AccountingFile= |