aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2016-01-01 22:14:27 +0100
committerAngelo Naselli <anaselli@linux.it>2016-01-01 22:14:27 +0100
commit5f7348b098482f5574990c0fb746250b8bcb4723 (patch)
tree126f6b50ecfea56fb66b1500546565f842160501 /lib
parent7fb29198221a44489dbbdd346087cb12a9d484d8 (diff)
downloadmanatools-5f7348b098482f5574990c0fb746250b8bcb4723.tar
manatools-5f7348b098482f5574990c0fb746250b8bcb4723.tar.gz
manatools-5f7348b098482f5574990c0fb746250b8bcb4723.tar.bz2
manatools-5f7348b098482f5574990c0fb746250b8bcb4723.tar.xz
manatools-5f7348b098482f5574990c0fb746250b8bcb4723.zip
Added config dir management
Diffstat (limited to 'lib')
-rw-r--r--lib/ManaTools/Module/Users.pm40
1 files changed, 23 insertions, 17 deletions
diff --git a/lib/ManaTools/Module/Users.pm b/lib/ManaTools/Module/Users.pm
index 81b6108c..9e04a2a5 100644
--- a/lib/ManaTools/Module/Users.pm
+++ b/lib/ManaTools/Module/Users.pm
@@ -83,8 +83,17 @@ with 'ManaTools::LoggingRole';
has 'configDir' => (
is => 'ro',
isa => 'Str',
+ lazy => 1,
+ builder => '_configDirBuilder',
);
+sub _configDirBuilder {
+ my $self = shift();
+ my $confDir = $self->commandline()->conf_dir() || $self->defaultConfigDir();
+
+ return $confDir;
+}
+
with 'ManaTools::ConfigDirRole';
has 'moduleName' => (
@@ -180,25 +189,22 @@ sub _SharedUGUIInitialize {
}
-#=============================================================
-
-=head1 METHODS
-
-=cut
-
-=head2 new - additional parameters
-
-=head3 config_file
+# configuration file name
+has 'config_file' => (
+ is => 'ro',
+ isa => 'Str',
+ lazy => 1,
+ init_arg => undef,
+ builder => '_config_fileBuilder',
+);
- optional parameter to set the configuration file name
+sub _config_fileBuilder {
+ my $self = shift();
+ my $confDir = $self->configPathName();
-=cut
+ return $confDir . "/manauser";
+}
-has 'config_file' => (
- is => 'rw',
- isa => 'Str',
- default => '/etc/sysconfig/manauser',
-);
#=============================================================
@@ -2519,7 +2525,7 @@ sub _manageUsersDialog {
my $sysfilter = 1;
if (-e $self->config_file) {
my $prefs = Config::Auto::parse($self->config_file);
- $sysfilter = ($prefs->{FILTER} eq 'true' or $prefs->{FILTER} eq 'true' or $prefs->{FILTER} eq '1');
+ $sysfilter = ($prefs->{FILTER} eq 'true' or $prefs->{FILTER} eq 'TRUE' or $prefs->{FILTER} eq '1');
}
$self->set_widget(filter_system => $factory->createCheckBox($head_align_left, $self->loc->N("Filter system users"),
$sysfilter));