username support. Start

This commit is contained in:
Difrex(Denis Zheleztsov) 2014-05-06 11:57:48 +04:00
parent 1c26ccdcc3
commit c2b787df8e
4 changed files with 16 additions and 5 deletions

View File

@ -91,7 +91,8 @@ sub create_base {
my $dbh = DBI->connect( "dbi:SQLite:dbname=$first_sqlite", "", "" );
print "Create database schema\n";
my $q_table
= "create table passwords(name VARCHAR(32), resource TEXT, password TEXT)";
= "create table passwords(name VARCHAR(32), username VARCHAR(32),
resource TEXT, password TEXT)";
$dbh->do($q_table);
print "Encrypt database...\n";

View File

@ -62,6 +62,7 @@ sub save {
my $resource = $store->{resource};
my $password = $store->{password};
my $generate = $store->{gen};
# my $username = $store->{username};
if ( $generate == 1 ) {
$password = Password->generate();

View File

@ -7,7 +7,7 @@ Simple password manager writed in perl.
## Perl modules
cpan install Module::Name.
cpan install Module::Name
Not recommended. Please use you package manager.
@ -23,7 +23,15 @@ On Debian-based systems:
apt-get install libtext-clip-perl class-dbi-sqlite-perl
# Changelog
## 0.0.1-alpha
* Small fix in GPG.pm
* PM is working.
# TODO
* Username support
* Store decrypted DB into RAM not in /tmp/
* Different keys selection
* Different keys selection

5
pm.pl
View File

@ -17,6 +17,7 @@ Simple password manager writed in Perl.
-n [Name of resource] name of resource
-w store new password
-l [Link] link to resource
-u username
-p [Password] password
if key not selected PM generate secure password
and copy it to xclipboard
@ -44,11 +45,11 @@ EOF
}
sub init() {
my $opt_string = 'swn:l:p:rhvo';
my $opt_string = 'swn:l:p:rhvou';
getopts("$opt_string") or usage();
our (
$opt_s, $opt_w, $opt_n, $opt_r, $opt_l,
$opt_p, $opt_h, $opt_v, $opt_o
$opt_p, $opt_h, $opt_v, $opt_o, $opt_u
);
print "Simple password manager writed in Perl.\nVersion: "