Copy password fix

This commit is contained in:
Difrex(Denis Zheleztsov) 2014-05-12 13:46:23 +04:00
parent 820abf1636
commit 6e32360a35
2 changed files with 13 additions and 6 deletions

View File

@ -36,12 +36,12 @@ sub show {
# Query # Query
my $query_string; my $query_string;
if ( defined($username) ) { if ( defined($username) ) {
$query_string = "select name, resource, password from passwords $query_string = "select id, name, resource, password from passwords
where name='$name' and username='$username'"; where name='$name' and username='$username'";
} }
else { else {
$query_string $query_string
= "select name, resource, password from passwords where name='$name'"; = "select id, name, resource, password from passwords where name='$name'";
} }
my $mdo_q = { my $mdo_q = {

15
pm.pl
View File

@ -36,13 +36,17 @@ Examples:
\tpm.pl -s -n LOR \tpm.pl -s -n LOR
\tPassword copied to xclipboard.\n\t\tURI is http://linux.org.ru/ \tPassword copied to xclipboard.\n\t\tURI is http://linux.org.ru/
Copy password and open link:
\tpm.pl -s -n LOR -o
\tPassword copied to clipboard. Trying to open uri.
Store new password: Store new password:
\tpm.pl -w -n PRON -l http://superpronsite.com/ -p my_secret_password \tpm.pl -w -n PRON -l http://superpronsite.com/ -p my_secret_password
\tPassword for resource PRON is stored into DB! \tPassword for resource PRON is stored into DB!
Copy password and open link: Remove password:
\tpm.pl -s -n LOR -o \tpm.pl -r -i 13
\tPassword copied to clipboard. Trying to open uri. \tPassword was removed!
EOF EOF
exit 1; exit 1;
@ -108,7 +112,10 @@ elsif ( defined($opt_r) and defined($opt_i) ) {
my $store_h = { id => $opt_i, }; my $store_h = { id => $opt_i, };
$pass->remove($store_h) == 0 or die "Oops! 105: pm.pl. $!\n"; $pass->remove($store_h) == 0 or die "Oops! 111: pm.pl. $!\n";
print color 'bold red';
print "Password was removed!\n";
print color 'reset';
} }
elsif ( defined($opt_w) elsif ( defined($opt_w)
and defined($opt_n) and defined($opt_n)