File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
html/captive-portal/lib/captiveportal/PacketFence/Controller Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ sub is_lost_stolen {
93
93
sub userIsAuthenticated : Private {
94
94
my ( $self , $c ) = @_ ;
95
95
my $pid = $c -> user_session-> {" username" } // $c -> {_session }-> {username };
96
- my @person_nodes = person_nodes ($pid );
96
+ my @person_nodes = person_reg_nodes ($pid );
97
97
my @nodes ;
98
98
foreach my $person_node (@person_nodes ) {
99
99
my $node = node_view($person_node -> {mac });
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ BEGIN {
37
37
person_view_simple
38
38
person_modify
39
39
person_nodes
40
+ person_reg_nodes
40
41
person_security_events
41
42
person_cleanup
42
43
persons_without_nodes
@@ -282,6 +283,27 @@ sub person_nodes {
282
283
return @{$iter -> all // []};
283
284
}
284
285
286
+ sub person_reg_nodes {
287
+ my ($pid ) = @_ ;
288
+ my ($status , $iter ) = pf::dal::node-> search(
289
+ -where => {
290
+ pid => $pid ,
291
+ },
292
+ -columns => [qw( mac pid notes regdate unregdate status user_agent computername device_class time_balance bandwidth_balance) ],
293
+ # To avoid join
294
+ -from => pf::dal::node-> table,
295
+ -with_class => undef ,
296
+ -where => {
297
+ status => " reg" ,
298
+ },
299
+ );
300
+ if (is_error($status )) {
301
+ return ;
302
+ }
303
+
304
+ return @{$iter -> all // []};
305
+ }
306
+
285
307
=head2 person_unassign_nodes
286
308
287
309
unassign the nodes of a person
You can’t perform that action at this time.
0 commit comments