Francois:

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;

What do you think?


Jake Sallee
Godfather of Bandwidth
System Engineer
University of Mary Hardin-Baylor
900 College St.
Belton TX. 76513
Fone: 254-295-4658
Phax: 254-295-4221
HTTP://WWW.UMHB.EDU


-----Original Message-----
From: Francois Gaudreault [mailto:[email protected]] 
Sent: Monday, May 07, 2012 7:23 AM
To: [email protected]
Subject: Re: [PacketFence-users] Assigning users a category

Hi Jake,

> My 802.1x users are auto registered since they are obviously genuine 
> users as they have already passed the 802.1x auth process. However, I 
> do not think I am able to set the user category in the same block of 
> code that we use to determine the vlan because that part if the API is 
> not exposed to the custom vlan assignment. Which is logical since the 
> user's category should have already been set when the user was registered.
>
> I would like to be able to set the user's category based on the users 
> name (which holds the domain info EX: [email protected]
> <mailto:[email protected]>) in both cases, in the same way.
>
> Where could I place my code so that no matter what auth mechanism the 
> users uses they will still get assigned to a category?
Override the getNodeInfoForAutoReg in vlan/custom.pm, and you should be all set 
:)

Let me know if you need a code example.

Thanks!


--
Francois Gaudreault, ing. jr
[email protected]  ::  +1.514.447.4918 (x130) ::  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

------------------------------------------------------------------------------
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

Reply via email to