Discussion:
[software/adminpanel] branch master updated (ff7c769 -> 0cc90ff)
root-odJJhXpcy38dnm+
2014-10-11 11:13:22 UTC
Permalink
This is an automated email from the git hooks/post-receive script.

anaselli pushed a change to branch master
in repository software/adminpanel.

from ff7c769 first attempt to hide some system group with 499 < gid < 1000
new 0cc90ff Better group filtering

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
lib/AdminPanel/Module/Users.pm | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
--
Mageia Git Monkeys.
root-odJJhXpcy38dnm+
2014-10-11 11:13:23 UTC
Permalink
This is an automated email from the git hooks/post-receive script.

anaselli pushed a commit to branch master
in repository software/adminpanel.

commit 0cc90fff930e9ece8b1e987a4331b6cbe2f61533
Author: Angelo Naselli <anaselli-***@public.gmane.org>
Date: Sat Oct 11 13:13:03 2014 +0200

Better group filtering
---
Commit Link:
http://gitweb.mageia.org/software/adminpanel/commit/?id=0cc90fff930e9ece8b1e987a4331b6cbe2f61533

lib/AdminPanel/Module/Users.pm | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/lib/AdminPanel/Module/Users.pm b/lib/AdminPanel/Module/Users.pm
index 12925e1..b32b948 100644
--- a/lib/AdminPanel/Module/Users.pm
+++ b/lib/AdminPanel/Module/Users.pm
@@ -601,7 +601,7 @@ sub _addGroupDialog {
## check data
my $groupname = $groupName->value();
my ($continue, $errorString) = $self->sh_users->valid_groupname($groupname);
- my $nm = $continue && $self->sh_users->groupNameExist($groupname);
+ my $nm = $continue && $self->sh_users->groupNameExists($groupname);
if ($nm) {
$groupName->setValue("");
$errorString = $self->loc->N("Group already exists, please choose another Group Name");
@@ -1200,8 +1200,17 @@ sub _refreshGroups {
if ($filtergroups && $g->Gid($self->sh_users->USER_GetValue) > 499 && $g->Gid($self->sh_users->USER_GetValue) < 1000) {
my $groupname = $g->GroupName($self->sh_users->USER_GetValue);
my $l = $self->sh_users->ctx->LookupUserByName($groupname);
- next if ! defined($l);
- next LOOP if $l->HomeDir($self->sh_users->USER_GetValue) =~ /^\/($|var\/|run\/)/ || $l->LoginShell($self->sh_users->USER_GetValue) =~ /(nologin|false)$/;
+ if (!defined($l)) {
+ my $members = $self->sh_users->ctx->EnumerateUsersByGroup($groupname);
+ next LOOP if !scalar(@{$members});
+ foreach my $username (@$members) {
+ my $userEnt = $self->sh_users->ctx->LookupUserByName($username);
+ next LOOP if $userEnt->HomeDir($self->sh_users->USER_GetValue) =~ /^\/($|var\/|run\/)/ || $userEnt->LoginShell($self->sh_users->USER_GetValue) =~ /(nologin|false)$/;
+ }
+ }
+ else {
+ next LOOP if $l->HomeDir($self->sh_users->USER_GetValue) =~ /^\/($|var\/|run\/)/ || $l->LoginShell($self->sh_users->USER_GetValue) =~ /(nologin|false)$/;
+ }
}

push @GroupReal, $g if $g->GroupName($self->sh_users->USER_GetValue) =~ /^\Q$strfilt/;
--
Mageia Git Monkeys.
Loading...