Show username in pm -s -n

This commit is contained in:
Difrex 2016-05-13 12:46:48 +03:00
parent 4db1e9d6d3
commit 54272dc5cc
3 changed files with 8 additions and 5 deletions

View File

@ -123,13 +123,14 @@ sub mdo {
my $sth = $dbh->prepare($q);
$sth->execute();
my ( $id, $name, $resource, $password ) = $sth->fetchrow_array();
my ( $id, $name, $resource, $password, $username ) = $sth->fetchrow_array();
my $q_hash = {
id => $id,
name => $name,
resource => $resource,
password => $password,
username => $username
};
return $q_hash;
}

View File

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

6
pm.pl
View File

@ -54,8 +54,10 @@ if ( defined($opt_s) and defined($opt_n) and !defined($opt_o) ) {
$copy->copy($get_pass);
print colored( "Password copied to xclipboard.", 'green' );
print "\nURI is ";
print "\nURI: ";
print colored( $get_h->{resource} . "\n", 'bold blue' );
print "User: ";
print colored( $get_h->{username} . "\n", 'bold yellow');
}
else {
print colored( "Warning! Password will show to terminal!", 'red' );
@ -160,4 +162,4 @@ elsif ( defined($opt_b) ) {
}
else {
$usage->show();
}
}