Excellent, thanks that's working just fine.
I added a line in /usr/local/pf/lib/pf/node.pm into the node_register
subroutine as below:
# do not check for max_node if it's for auto-register
if ( is_max_reg_nodes_reached($mac, $pid, $info{'category'},
$info{'category_id'}) ) {
$logger->error( "max nodes per pid met or exceeded - registration
of $mac to $pid failed" );
return (0);
}
}
$info{'pid'} = $pid;
$info{'status'} = 'reg';
$info{'regdate'} = mysql_date();
$info{'unregdate'} = '2015-08-08';
Thanks for the advice, hopefully in the future I'll be able to do this using
the auth sources.
Cheers,
Andi
From: Louis Munro [mailto:[email protected]]
Sent: 14 August 2014 18:22
To: [email protected]
Subject: Re: [PacketFence-users] unregister users when not using sources
Hi Andy,
Normally the unregistration date is set when matching an authentication rule.
If no rule match then no unregdate will be added.
If you want to set it manually, look at node_modify in lib/pf/node.pm.
You can pass it a value for the unregdate.
See lib/pf/vlan.pm (around line 400) for an example:
my %info = (
'unregdate' => $value,
'category' => $role,
'autoreg' => 'yes',
);
if (defined $role) {
%info = (%info, (category => $role));
}
node_modify($mac,%info);
Regards,
--
Louis Munro
[email protected]<mailto:[email protected]> ::
www.inverse.ca<http://www.inverse.ca>
+1.514.447.4918 *125 :: +1 (866) 353-6153
Inverse inc. :: Leaders behind SOGo (www.sogo.nu<http://www.sogo.nu>) and
PacketFence (www.packetfence.org<http://www.packetfence.org>)
On 2014-08-14, at 11:01 , "Morris, Andi"
<[email protected]<mailto:[email protected]>> wrote:
Hi all,
I'm using packetfence version 4.2.1 but I'm using custom.pm rather than the
sources to process my users. The reason being I couldn't get sources to do what
I want, which was essentially just separate eduroam home users to eduroam
visiting users. However I've just realised that this doesn't give any nodes an
unregistration date.
I used to do this using expire_deadline in pf.conf, but I see that no longer
exists.
Is there a way that I can set a node to expire after a certain amount of time?
Cheers,
Andi
-------------------------------------
Andi Morris
IT Security Officer
Cardiff Metropolitan University
T: 02920 205720
E: [email protected]<mailto:[email protected]>
--------------------------------------
------------------------------------------------------------------------------
_______________________________________________
PacketFence-users mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/packetfence-users
------------------------------------------------------------------------------
_______________________________________________
PacketFence-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/packetfence-users