diff options
Diffstat (limited to 'usr/src/libpiny/lib/Piny/User.pm')
-rw-r--r-- | usr/src/libpiny/lib/Piny/User.pm | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/usr/src/libpiny/lib/Piny/User.pm b/usr/src/libpiny/lib/Piny/User.pm index e0687a3..f9a5f0d 100644 --- a/usr/src/libpiny/lib/Piny/User.pm +++ b/usr/src/libpiny/lib/Piny/User.pm @@ -77,6 +77,32 @@ sub remove_group { }; }; +sub has_group { + my ( $s, $group ) = @_; + + foreach my $owngroup ( $s->groups( ) ) { + return if $owngroup->gid( ) == $group->gid( ); + }; + + return; +}; + +# Class methods + +sub all_users { + my ( $class ) = @_; + + endpwent( ); + + my @ret; + + while ( my @info = getpwent( ) ) { + push( @ret, $class->new( uid => $info[2] ) ); + }; + + return @ret; +}; + # Builder methods # If constructed with just one argument, then |