--- lib\TWiki.pm Mon Dec 03 22:59:42 2001 +++ lib\TWiki.pm Wed Jan 23 00:17:12 2002 @@ -822,8 +822,24 @@ my $host = ""; my $port = 80; my $path = ""; + my $user = ""; + my $pass = ""; - if( $theUrl =~ /http\:\/\/([^\:]+)\:([0-9]+)(\/.*)/ ) { + # RNF 22 Jan 2002 Handle http://user:pass@host + if( $theUrl =~ /http\:\/\/(.+)\:(.+)\@([^\:]+)\:([0-9]+)(\/.*)/ ) { + $user = $1; + $pass = $2; + $host = $3; + $port = $4; + $path = $5; + + } elsif( $theUrl =~ /http\:\/\/(.+)\:(.+)\@([^\/]+)(\/.*)/ ) { + $user = $1; + $pass = $2; + $host = $3; + $path = $4; + + } elsif( $theUrl =~ /http\:\/\/([^\:]+)\:([0-9]+)(\/.*)/ ) { $host = $1; $port = $2; $path = $3; @@ -831,13 +847,16 @@ } elsif( $theUrl =~ /http\:\/\/([^\/]+)(\/.*)/ ) { $host = $1; $path = $2; - + } else { $text = showError( "Error: Unsupported protocol. (Must be 'http://domain/...')" ); return $text; } + + # $text = "User: $user\nPass: $pass\nHost: $host\nPort: $port\nPath: $path\n"; + # return $text; - $text = &TWiki::Net::getUrl( $host, $port, $path ); + $text = &TWiki::Net::getUrl( $host, $port, $path, $user, $pass ); $text =~ s/\r\n/\n/gos; $text =~ s/\r/\n/gos; $text =~ s/^(.*?\n)\n(.*)/$2/os;