Discussion:
[software/adminpanel] branch master updated (6e6caf1 -> a905043)
root-odJJhXpcy38dnm+
2014-10-11 22:23:18 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 6e6caf1 unused code
new a905043 Added group name by ID into Shared

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 | 8 ++++----
lib/AdminPanel/Shared/Users.pm | 31 +++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+), 4 deletions(-)
--
Mageia Git Monkeys.
root-odJJhXpcy38dnm+
2014-10-11 22:23:19 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 a905043d0897d3b47729d3a6eccf794d542a45aa
Author: Angelo Naselli <anaselli-***@public.gmane.org>
Date: Sun Oct 12 00:22:53 2014 +0200

Added group name by ID into Shared
---
Commit Link:
http://gitweb.mageia.org/software/adminpanel/commit/?id=a905043d0897d3b47729d3a6eccf794d542a45aa

lib/AdminPanel/Module/Users.pm | 8 ++++----
lib/AdminPanel/Shared/Users.pm | 31 +++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/lib/AdminPanel/Module/Users.pm b/lib/AdminPanel/Module/Users.pm
index 217d46e..5335f0a 100644
--- a/lib/AdminPanel/Module/Users.pm
+++ b/lib/AdminPanel/Module/Users.pm
@@ -1756,8 +1756,8 @@ sub _userGroupsTabWidget {
$replace_pnt->deleteChildren();

my %userGroupsWidget;
- my $userEnt = $self->sh_users->ctx->LookupUserByName($userData->{username});
- my $lastchg = $userEnt->ShadowLastChange($self->sh_users->USER_GetValue);
+ my $userInfo = $self->sh_users->getUserInfo($userData->{username});
+ my $lastchg = $userInfo->{last_change};

my $layout = _labeledFrameBox($replace_pnt, $self->loc->N("Select groups that the user will be member of:"));

@@ -1783,8 +1783,8 @@ sub _userGroupsTabWidget {
$userGroupsWidget{members}->setNotify(1);
my $primgroup = '';
if ($userData->{primary_group} != -1) {
- my $Gent = $self->sh_users->ctx->LookupGroupById($userData->{primary_group});
- $primgroup = $Gent->GroupName($self->sh_users->USER_GetValue);
+ $DB::single = 1;
+ $primgroup = $self->sh_users->groupName($userData->{primary_group});
}

my $align = $factory->createLeft($layout);
diff --git a/lib/AdminPanel/Shared/Users.pm b/lib/AdminPanel/Shared/Users.pm
index 237fee9..9839f8b 100644
--- a/lib/AdminPanel/Shared/Users.pm
+++ b/lib/AdminPanel/Shared/Users.pm
@@ -573,6 +573,37 @@ sub groupID {

return undef;
}
+
+#=============================================================
+
+=head2 groupName
+
+=head3 INPUT
+
+$gid grou identifier
+
+=head3 OUTPUT
+
+group name or undef
+
+=head3 DESCRIPTION
+
+This method returns the group name for the given group
+identifier
+
+=cut
+
+#=============================================================
+sub groupName {
+ my ($self, $gid) = @_;
+
+ my $gr = $self->ctx->LookupGroupById($gid);
+ return $gr->GroupName($self->USER_GetValue) if ($gr);
+
+ return undef;
+}
+
+
#=============================================================

=head2 addGroup
--
Mageia Git Monkeys.
Loading...