diff options
Diffstat (limited to 'perl')
| -rw-r--r-- | perl/lib/Wallet/Report.pm | 37 | 
1 files changed, 28 insertions, 9 deletions
| diff --git a/perl/lib/Wallet/Report.pm b/perl/lib/Wallet/Report.pm index bf48308..2382d87 100644 --- a/perl/lib/Wallet/Report.pm +++ b/perl/lib/Wallet/Report.pm @@ -175,6 +175,20 @@ sub objects_unused {      return (\%search, \%options);  } +# Return the SQL statement to find all fiel objects that have been created +# but have never had information stored (via store). +sub objects_unstored { +    my ($self) = @_; +    my @objects; + +    my %search = (ob_stored_on => undef, +                  ob_type      => 'file'); +    my %options = (order_by => [ qw/ob_type ob_name/ ], +                   select   => [ qw/ob_type ob_name/ ]); + +    return (\%search, \%options); +} +  # Returns a list of all objects stored in the wallet database in the form of  # type and name pairs.  On error and for an empty database, the empty list  # will be returned.  To distinguish between an empty list and an error, call @@ -190,7 +204,7 @@ sub objects {      if (!defined $type || $type eq '') {          ($search_ref, $options_ref) = $self->objects_all;      } else { -        if ($type ne 'unused' && @args != 1) { +        if ($type ne 'unused' && $type ne 'unstored' && @args != 1) {              $self->error ("object searches require one argument to search");          } elsif ($type eq 'type') {              ($search_ref, $options_ref) = $self->objects_type (@args); @@ -202,6 +216,8 @@ sub objects {              ($search_ref, $options_ref) = $self->objects_acl (@args);          } elsif ($type eq 'unused') {              ($search_ref, $options_ref) = $self->objects_unused (@args); +        } elsif ($type eq 'unstored') { +            ($search_ref, $options_ref) = $self->objects_unstored (@args);          } else {              $self->error ("do not know search type: $type");          } @@ -633,14 +649,17 @@ Returns a list of all objects matching a search type and string in the  database, or all objects in the database if no search information is  given. -There are five types of searches currently.  C<type>, with a given type, -will return only those entries where the type matches the given type. -C<owner>, with a given owner, will only return those objects owned by the -given ACL name or ID.  C<flag>, with a given flag name, will only return -those items with a flag set to the given value.  C<acl> operates like -C<owner>, but will return only those objects that have the given ACL name -or ID on any of the possible ACL settings, not just owner.  C<unused> will -return all entries for which a get command has never been issued. +There are several types of searches.  C<type>, with a given type, will +return only those entries where the type matches the given type. +C<owner>, with a given owner, will only return those objects owned by +the given ACL name or ID.  C<flag>, with a given flag name, will only +return those items with a flag set to the given value.  C<acl> operates +like C<owner>, but will return only those objects that have the given +ACL name or ID on any of the possible ACL settings, not just owner. +C<unused> will return all entries for which a get command has never +been issued.  C<unstored> will return all entries for which a store +command has never been issued (limited to file type since storing isn't +needed for other types).  The return value is a list of references to pairs of type and name.  For  example, if two objects existed in the database, both of type C<keytab> | 
