[BACK]Return to example3.pl CVS log [TXT][DIR] Up to [local] / palm / Palm-Keyring / examples

Diff for /palm/Palm-Keyring/examples/example3.pl between version 1.9 and 1.12

version 1.9, 2008/02/28 00:17:33 version 1.12, 2009/12/16 22:54:55
Line 1 
Line 1 
 #!/usr/bin/perl  #!/usr/bin/perl
 # $RedRiver: example3.pl,v 1.8 2008/02/27 23:54:02 andrew Exp $  # $RedRiver: example3.pl,v 1.11 2008/09/17 14:49:50 andrew Exp $
 ########################################################################  ########################################################################
 # palmkeyring.pl *** a command line client for Keyring databases.  # palmkeyring.pl *** a command line client for Keyring databases.
 #  #
Line 17 
Line 17 
 Getopt::Long::Configure('bundling');  Getopt::Long::Configure('bundling');
 use Term::ReadLine;  use Term::ReadLine;
   
 use YAML;  
   
 use Palm::PDB;  use Palm::PDB;
 use Palm::Keyring;  use Palm::Keyring;
   
Line 46 
Line 44 
 if ($Action_List) {  if ($Action_List) {
         show_list();          show_list();
 } elsif ($Action_Show) {  } elsif ($Action_Show) {
           push @{ $Names }, @ARGV;
         show_items($Names);          show_items($Names);
 } elsif (defined $Categories) {  } elsif (defined $Categories) {
         show_categories();          show_categories();
Line 94 
Line 93 
   
 sub show_items  sub show_items
 {  {
           get_password() || die "Couldn't decrypt file!";
         foreach (0..$#{ $pdb->{'records'} }) {          foreach (0..$#{ $pdb->{'records'} }) {
         my $r = $pdb->{'records'}->[$_];                  my $r = $pdb->{'records'}->[$_];
   
                 my $category =                  my $category =
                         $pdb->{'appinfo'}->{'categories'}->[ $r->{'category'} ]->{'name'};                          $pdb->{'appinfo'}->{'categories'}->[ $r->{'category'} ]->{'name'};
   
Line 109 
Line 108 
                 }                  }
                 next if ( @{ $Categories } || @{ $Names } ) && not $matched;                  next if ( @{ $Categories } || @{ $Names } ) && not $matched;
   
             get_password() || die "Couldn't decrypt file!";                  my $a = $pdb->Decrypt($r);
   
         my $a = $pdb->Decrypt($r);                  $matched = 0;
         $matched = 0;  
   
                 foreach my $account (@{ $Accounts }) {                  foreach my $account (@{ $Accounts }) {
                         $matched++ if uc($r->{plaintext}->{1}->{data}) eq uc($account);                          $matched++ if uc($a->{1}->{data}) eq uc($account);
                 }                  }
                 next if ( @{ $Accounts } ) && not $matched;                  next if ( @{ $Accounts } ) && not $matched;
   

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.12

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>