Samba/setPass.pm

filter: Statementstmt 32.3% 11 / 34 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 31.9% 15 / 47 CC 5 SCAR 29.5
CC
5
Cov
26%
plugin
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 19.1
« Samba/makeSambaAccount.pm ↑ Summary
1 package Plugtools::Plugins::Samba::setPass;
2  
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use Plugtools::Plugins::Samba;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 =head1 NAME
8  
9 Plugtools::Plugins::Samba::setPass - A Samba password setting plugin for Plugtools.
10  
11 =head1 VERSION
12  
13 Version 0.0.0
14  
15 =cut
16  
17 2 our $VERSION = '0.0.0';
18  
19  
20 =head1 SYNOPSIS
21  
22 This sets the required password attributes for use with Samba.
23  
24 This is for use with userSetPass.
25  
26 =head1 FUNCTIONS
27  
28 =head2 plugin
29  
30 The function that will be called by Plugtools.
31  
32 use Plugtools::Plugins::Samba::setPass;
33 %returned=Plugtools::Plugins::Samba::setPass->plugin(\%opts, \%args);
34
35 if($returned{error}){
36 print "Error!\n";
37 }
38  
39 =cut
40  
41 0 ▶sub plugin{
Subroutine plugin: not called CC=5 SCAR=34.0
Pod documented
42 0 my %opts;
43 0 ▶ if(defined($_[1])){
Branch: 1 branch
BranchTrueFalseTotal
if (defined $_[1]) 0 0 0
44 0 %opts= %{$_[1]};
45 0 }; my %args;
46 0 ▶ if(defined($_[2])){
Branch: 1 branch
BranchTrueFalseTotal
if (defined $_[2]) 0 0 0
47 0 %args= %{$_[2]};
48 };
49
50 0 my %returned;
51 0 $returned{error}=undef;
52  
53 my $pts = Plugtools::Plugins::Samba->new({
54 pt=>$opts{self},
55 ldap=>$opts{ldap}
56 0 });
57 0 ▶ if ($pts->{error}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($pts->{"error"}) 0 0 0
58 0 $returned{error}=1;
59 $returned{errorString}='Unable to create new Plugtools::Plugins::Samba object. $pts->{error}="'.
60 0 $pts->{error}.'" $pts->{errorString}="'.$pts->{errorString}.'"';
61 0 warn('Plugtools-Plugins-Samba-setPass plugin:1: '.$returned{errorString});
62 0 return %returned;
63 }
64  
65 $pts->setPassEntry({
66 entry=>$opts{entry},
67 pass=>$args{pass},
68 0 });
69 0 ▶ if ($pts->{error}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($pts->{"error"}) 0 0 0
70 0 $returned{error}=1;
71 $returned{errorString}='Plugtools::Plugins::Samba->setPassEntry errored. $pts->{error}="'.
72 0 $pts->{error}.'" $pts->{errorString}="'.$pts->{errorString}.'"';
73 0 warn('Plugtools-Plugins-Samba-setPass plugin:1: '.$returned{errorString});
74 0 return %returned;
75 }
76  
77 0 return %returned;
78 }
79  
80 =head1 ERROR CODES
81  
82 =head2 1
83  
84 Unable to create new Plugtools::Plugins::Samba object.
85  
86 =head2 2
87  
88 setPassEntry errored
89  
90 =head1 AUTHOR
91  
92 Zane C. Bowers, C<< <vvelox at vvelox.net> >>
93  
94 =head1 BUGS
95  
96 Please report any bugs or feature requests to C<bug-plugtools-plugins-samba at rt.cpan.org>, or through
97 the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Plugtools-Plugins-Samba>. I will be notified, and then you'll
98 automatically be notified of progress on your bug as I make changes.
99  
100  
101  
102  
103 =head1 SUPPORT
104  
105 You can find documentation for this module with the perldoc command.
106  
107 perldoc Plugtools::Plugins::Samba::setPass
108  
109  
110 You can also look for information at:
111  
112 =over 4
113  
114 =item * RT: CPAN's request tracker
115  
116 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Plugtools-Plugins-Samba>
117  
118 =item * AnnoCPAN: Annotated CPAN documentation
119  
120 L<http://annocpan.org/dist/Plugtools-Plugins-Samba>
121  
122 =item * CPAN Ratings
123  
124 L<http://cpanratings.perl.org/d/Plugtools-Plugins-Samba>
125  
126 =item * Search CPAN
127  
128 L<http://search.cpan.org/dist/Plugtools-Plugins-Samba/>
129  
130 =back
131  
132  
133 =head1 ACKNOWLEDGEMENTS
134  
135  
136 =head1 COPYRIGHT & LICENSE
137  
138 Copyright 2009 Zane C. Bowers, all rights reserved.
139  
140 This program is free software; you can redistribute it and/or modify it
141 under the same terms as Perl itself.
142  
143  
144 =cut
145  
146 2 1; # End of Plugtools::Plugins::Samba::setPass
« Samba/makeSambaAccount.pm ↑ Summary