aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extras/conf/manauser/manauser2
-rw-r--r--lib/ManaTools/Module/Users.pm40
2 files changed, 25 insertions, 17 deletions
diff --git a/extras/conf/manauser/manauser b/extras/conf/manauser/manauser
new file mode 100644
index 00000000..9be8ca12
--- /dev/null
+++ b/extras/conf/manauser/manauser
@@ -0,0 +1,2 @@
+#Filter out sytem users by default
+FILTER=true
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));