diff --git a/pptp-client/CHANGELOG b/pptp-client/CHANGELOG index 2e2767bd3..59d22b651 100644 --- a/pptp-client/CHANGELOG +++ b/pptp-client/CHANGELOG @@ -2,3 +2,5 @@ Moved code for connecting a PPTP tunnel to a separate function, so it can be called by other modules. ---- Changes since 1.190 ---- A PPTP tunnel can now be configured to activate at boot time. +---- Changes since 1.390 ---- +When connecting a PPTP tunnel, an optional override password can be entered. This allows you to avoid storing the PPTP password in a configuration file. Thanks to Nicolas Ledoux for this patch. diff --git a/pptp-client/conn.cgi b/pptp-client/conn.cgi index b08d99cb4..684dc5123 100755 --- a/pptp-client/conn.cgi +++ b/pptp-client/conn.cgi @@ -25,7 +25,29 @@ $| = 1; print "",&text('conn_cmd', "$config{'pptp'} $tunnel->{'server'} ". "call $in{'tunnel'}"),"

\n"; -($ok, @status) = &connect_tunnel($tunnel); +# If a password is passed, use it to temprarily overwrite the one in +# the secrets file +if ($in{'cpass'}) { + $login = &find("name", $tunnel->{'opts'}); + $sn = $login ? $login->{'value'} : &get_system_hostname(1); + &lock_file($config{'pap_file'}); + @secs = &list_secrets(); + ($sec) = grep { $_->{'client'} eq $sn } @secs; + $oldsecret = $sec->{'secret'}; + $sec->{'secret'} = $in{'cpass'}; + &change_secret($sec); + &flush_file_lines(); + ($ok, @status) = &connect_tunnel($tunnel); + $sec->{'secret'} = $oldsecret; + &change_secret($sec); + &flush_file_lines(); + &unlock_file($config{'pap_file'}); + &lock_file($config{'pap_file'}); + } +else { + ($ok, @status) = &connect_tunnel($tunnel); + } + if ($ok) { # Worked! Tell user print "",&text('conn_ok', "$status[0]", diff --git a/pptp-client/index.cgi b/pptp-client/index.cgi index ea343ae3e..f827eb5d5 100755 --- a/pptp-client/index.cgi +++ b/pptp-client/index.cgi @@ -62,7 +62,9 @@ else { $config{'tunnel'} eq $t->{'name'} ? "selected" : "", $t->{'name'}; } - print "\n"; + print "\n"; + print $text{'index_pass'}," ",&ui_password("cpass", undef, 10); + print "\n"; print "$text{'index_conndesc'} \n"; } diff --git a/pptp-client/lang/en b/pptp-client/lang/en index 5e3544a03..4debcab1e 100644 --- a/pptp-client/lang/en +++ b/pptp-client/lang/en @@ -7,6 +7,7 @@ index_none=No PPTP tunnels have been defined yet. index_tunnel=Tunnel $1 index_add=Add a new PPTP VPN tunnel. index_conn=Connect to: +index_pass=with optional password: index_conndesc=Click this button to connect the selected PPTP VPN tunnel using its current configuration. index_disc=Disconnect from: index_discdesc=Click this button to disconnect the selected currently active PPTP VPN tunnel and remove all routes through it.