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