| 1 | package URI::smb; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use parent 'URI::_login'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 1 | our $VERSION = '5.37'; | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 1 | ▶ | sub default_port {445} | ||||||||||||||||||||||||||
|
Subroutine
default_port: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 3 | ▶ | sub user { | ||||||||||||||||||||||||||
|
Subroutine
user: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 13 | 3 | my $self = shift; | |||||||||||||||||||||||||||
| 14 | 3 | my $new = shift; | |||||||||||||||||||||||||||
| 15 | 3 | my ($user, $authdomain) = _parse_user($self->SUPER::user()); | |||||||||||||||||||||||||||
| 16 | 3 | ▶ | if ($new) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 17 | 1 | ▶ | $self->SUPER::user($authdomain ? "$authdomain;$new" : $new); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 18 | 1 | $user = $new; | |||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||
| 20 | 3 | return $user; | |||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 4 | ▶ | sub authdomain { | ||||||||||||||||||||||||||
|
Subroutine
authdomain: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 24 | 4 | my $self = shift; | |||||||||||||||||||||||||||
| 25 | 4 | my $new = shift; | |||||||||||||||||||||||||||
| 26 | 4 | my ($user, $authdomain) = _parse_user($self->SUPER::user()); | |||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | # it must not be possible to set authdomain without user | ||||||||||||||||||||||||||||
| 29 | 4 | ▶ | if ($user && $new) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$user and $new
MC/DC100%2/2
$user and $new
$user
$new
Truth table100%3/3
A and B
A= $userB= $new
| |||||||||||||||||||||||||||||
| 30 | 1 | $self->SUPER::user("$new;$user"); | |||||||||||||||||||||||||||
| 31 | 1 | $authdomain = $new; | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | 4 | return $authdomain; | |||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 1 | ▶ | sub sharename { | ||||||||||||||||||||||||||
|
Subroutine
sharename: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 37 | 1 | return (shift->path_segments)[1]; | |||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 7 | ▶ | sub _parse_user { | ||||||||||||||||||||||||||
|
Subroutine
_parse_user: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||
| 41 | 7 | ▶ | my $input = shift or return; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 42 | 3 | my ($authdomain, $user) = split ';', $input, 2; | |||||||||||||||||||||||||||
| 43 | 3 | ▶ | return $user ? ($user, $authdomain) : $authdomain; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 1 | 1; | |||||||||||||||||||||||||||
| 47 | __END__ | ||||||||||||||||||||||||||||