>
> I copied the getNodeInfoForAutoReg function into custom.pm and added the
> following right after the %node_info hash decleration ...
>
> # Set category for user directly after registering
> # Custom code by Jake 5-7-12
> my $category = "guest";
> my @temp_user = split('@',lc($user_name));
>
> if ($temp_user[1] eq "cru") {
> $category = "student";
> }
>
> if (($temp_user[1] eq "umhb.edu") || ($temp_user[1] eq "umhb")) {
> $category = "staff";
> }
>
> $node_info{'category'} = $category;
>
Looks fine to me.
One small thing. If you have other actions leading to auto registration
(a violation with action=autoreg) then you should be defensive about
$user_name being undef.
Adding a if (defined($user_name)) { ... } around the whole block would
prevent that problem.
Regards,
--
Olivier Bilodeau
[email protected] :: +1.514.447.4918 *115 :: www.inverse.ca
Inverse inc. :: Leaders behind SOGo (www.sogo.nu) and PacketFence
(www.packetfence.org)
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
PacketFence-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/packetfence-users