Skip Menu |

This queue is for tickets about the Tk-RemoteFileSelect CPAN distribution.

Report information
The Basics
Id: 28935
Status: open
Priority: 0/
Queue: Tk-RemoteFileSelect

People
Owner: rkies [...] cpan.org
Requestors: DOUGW [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.60
Fixed in: (no value)



Subject: Default login entry values
Supply default logins and passwords by host.
Subject: RemoteFileSelect.diff
--- RemoteFileSelect.pm Tue Aug 21 15:31:18 2007 +++ RemoteFileSelect.pm Tue Aug 21 16:37:19 2007 @@ -117,6 +117,43 @@ The initial value of the remote user ID. +=item Name: B<useridvariable> + +=item Switch: B<-useridvariable> + +Variable to return the userid entered. + +=item Name: B<passwordvariable> + +=item Switch: B<-passwordvariable> + +Variable to return the password entered. + +=item Name: B<ftpvariable> + +=item Switch: B<-ftpvariable> + +Variable to return the ftp connection object. + +=item Name: B<hostdefaults> + +=item Switch: B<-hostdefaults> + +Hash reference of default userid's and passwords by host in the form: + + $host_defaults = { + host1 => { + userid => "UserName1", + password => "Password1", + }, + host2 => { + userid => "UserName2", + password => "Password2", + }, + }; + +Either key (userid, password) is optional. + =item Name: B<dirlistlabel> =item Switch: B<-dirlistlabel> @@ -283,6 +320,14 @@ $transcript = $cw -> cget( '-transcript' ); $cw -> configure( -hostname => $hostid, -transcript => $transcript ); + if ( my $hosts = $cw -> cget( '-hostdefaults' ) ) { + if ( my $host_defaults = $hosts->{$hostid} ) { + my $user_var = $cw -> cget( '-useridvariable' ); + $$user_var = $host_defaults->{userid}; + my $passwd_var = $cw -> cget( '-passwordvariable' ); + $$passwd_var = $host_defaults->{password}; + } + } my $logindlg = $cw -> Subwidget('logindialog'); return if ( ($resp = $logindlg -> Show ) =~ /Cancel/); $cw -> configure( -userid => ($logindlg -> Subwidget( 'uidentry' ) -> get), @@ -575,6 +620,12 @@ -> pack( -anchor => 'w' ); # login user/password dialog + my $user_ref = exists( $args->{-useridvariable} ) + ? $args->{-useridvariable} + : \my $tmp_user; + my $password_ref = exists( $args->{-passwordvariable} ) + ? $args->{-passworddvariable} + : \my $tmp_passwd; my $l = $w -> Component( DialogBox => 'logindialog', -title => 'Log in.', @@ -583,11 +634,13 @@ -text => 'Please enter your user name and password.' ) -> pack( -expand => '1', -fill => 'x' ); $l -> Component ( LabEntry => 'uidentry', - -labelVariable => \$w -> {'Configure'}{'-uidlabel'} ) + -labelVariable => \$w -> {'Configure'}{'-uidlabel'}, + -textvariable => $user_ref ) -> pack( -anchor => 'w', -expand => '1', -fill => 'x', -padx => 5, -pady => 5); $l -> Component( LabEntry => 'pwdentry', -labelVariable => \$w -> {'Configure'}{'-pwdlabel'}, + -textvariable => $password_ref, -show => '*' ) -> pack( -anchor => 'w', -expand => '1', -fill => 'x', -padx => 5, -pady => 5); @@ -632,6 +685,7 @@ -ftpvariable => ['PASSIVE', undef, undef, '' ], -useridvariable => ['PASSIVE', undef, undef, '' ], -passwordvariable => ['PASSIVE', undef, undef, ''], + -hostdefaults => ['PASSIVE', undef, undef, ''], DEFAULT => [ 'file_list' ], ); $w->Delegates(DEFAULT => 'file_list');
Ooof. s/passworddvariable/passwordvariable/ in the patch file. That's what I get for not fully testing.
Tell me what version of Perl and Perl/Tk this fix is intended for. Thanks.
Tell me what version of Perl and Perl/Tk this fix is intended for. Thanks.
Tell me what version of Perl and Perl/Tk this fix is intended for. Thanks.
On Tue Aug 21 19:41:46 2007, DOUGW wrote: Show quoted text
> Supply default logins and passwords by host.
I applied the patch against my copy of ActiveState (Perl 5.6.6, Tk 804.024 if I read that correctly), and it seemed not to resolve the issue. I'll upgrade my Perl, Perl/Tk and Tk-RemoteFileSelect from the CPAN archives and work on the modifications from those versions.