Skip to content
Snippets Groups Projects
Commit 64fafac1 authored by Robert Anderson's avatar Robert Anderson
Browse files

Add attributes as hash

parent 836a1846
No related branches found
No related tags found
No related merge requests found
...@@ -90,7 +90,7 @@ sub init ...@@ -90,7 +90,7 @@ sub init
SELECT SELECT
Name, Operator, Value Name, Operator, Value
FROM FROM
@TP@users_attributes @TP@user_attributes
WHERE WHERE
UserID = %{user.ID} UserID = %{user.ID}
'; ';
...@@ -174,6 +174,8 @@ sub get ...@@ -174,6 +174,8 @@ sub get
$template->{'user'}->{'Username'} = $user->{'Username'}; $template->{'user'}->{'Username'} = $user->{'Username'};
$template->{'user'}->{'ID'} = $user->{'_UserDB_Data'}->{'id'}; $template->{'user'}->{'ID'} = $user->{'_UserDB_Data'}->{'id'};
# Attributes to return
my %attributes = ();
# Replace template entries # Replace template entries
my @dbDoParams = templateReplace($config->{'userdb_get_group_attributes_query'},$template); my @dbDoParams = templateReplace($config->{'userdb_get_group_attributes_query'},$template);
...@@ -186,10 +188,10 @@ sub get ...@@ -186,10 +188,10 @@ sub get
# Loop with group attributes # Loop with group attributes
while (my $row = $sth->fetchrow_hashref()) { while (my $row = $sth->fetchrow_hashref()) {
addAttribute($server,$user->{'Attributes'},$row); addAttribute($server,\%attributes,hashifyLCtoMC($row,qw(Name Operator Value)));
} }
$sth->DBFreeRes(); DBFreeRes($sth);
...@@ -204,13 +206,12 @@ sub get ...@@ -204,13 +206,12 @@ sub get
# Loop with group attributes # Loop with group attributes
while (my $row = $sth->fetchrow_hashref()) { while (my $row = $sth->fetchrow_hashref()) {
addAttribute($server,$user->{'Attributes'},$row); addAttribute($server,\%attributes,hashifyLCtoMC($row,qw(Name Operator Value)));
} }
$sth->DBFreeRes(); DBFreeRes($sth);
# return $userDetails; return \%attributes;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment