Added support for configuration files
This commit is contained in:
@@ -119,7 +119,7 @@ sub new {
|
||||
$self->{'cursor'} = Gtk2::Gdk::Cursor->new('left-ptr');
|
||||
$self->{'rootwin'} = Gtk2::Gdk->get_default_root_window();
|
||||
|
||||
# split window to add menu, toolbar and notebook
|
||||
# split window horizontal to add menu, toolbar and notebook
|
||||
$self->{'mvb'} = Gtk2::VBox->new();
|
||||
$self->{'mw'}->add($self->{'mvb'});
|
||||
|
||||
|
||||
@@ -21,11 +21,38 @@ use strict;
|
||||
package HELPERS;
|
||||
|
||||
use POSIX;
|
||||
use Config::Tiny;
|
||||
|
||||
my $version = "0.1";
|
||||
my $true = 1;
|
||||
my $false = undef;
|
||||
|
||||
#
|
||||
# read global configuration file
|
||||
#
|
||||
sub read_global_cfg {
|
||||
my $cfg = Config::Tiny->read("/etc/tinyca/tinyca.cnf", 'utf8');
|
||||
return ($cfg);
|
||||
}
|
||||
|
||||
#
|
||||
# read a per CA configuration
|
||||
#
|
||||
sub read_cfg {
|
||||
my $base = shift;
|
||||
my $cfg = Config::Tiny->read($base."/tinyca.cnf", 'utf8');
|
||||
return ($cfg);
|
||||
}
|
||||
|
||||
#
|
||||
# read per user configuration
|
||||
# e.g. last used ca, last window position
|
||||
#
|
||||
sub read_user_cfg {
|
||||
my $cfg = Config::Tiny->read($ENV{HOME}."/.tinycarc", 'utf8');
|
||||
return ($cfg);
|
||||
}
|
||||
|
||||
#
|
||||
# generate filename from Subject-DN
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user