Ok. I'm terribly sorry for the multiple posts. It seems the mailing list was stuck.
On Mon, Feb 1, 2021, 13:14 Diego Garcia del Rio via PacketFence-users < [email protected]> wrote: > By the way, I tried using the "stone_role" option but it didn't work. > > I mean: I would first do the "select role" option in the chain and then > the "fixed role" to only set a duration but it doesnt seem to work... > > On Sun, Jan 31, 2021 at 7:15 PM Diego Garcia del Rio <[email protected]> > wrote: > >> Hi Everyone, >> >> Im trying to achieve the following: >> >> On the captive portal, I'd have an admin user login and then select a >> Role and access duration for a particular device. >> >> I got it working but I think im relying on a bit of a bug for it to work. >> >> The following is my relevant config: >> >> [Select-Role] >> actions= >> template=select-role.html >> admin_role=IT >> type=SelectRole >> list_role= <<EOT >> ALUMNOS >> ADMINISTRATIVOS >> INVITADOS >> PROFESORES >> REJECT >> EOT >> description=Seleccionar Rol >> >> [Role-and-duration] >> modules=default_login_policy,duration-choice,Select-Role >> actions= >> type=Chained >> description=Selecionar Rol y duracion >> >> [duration-choice] >> modules=one-day,one-week,one-year >> actions= >> template=content-with-choice.html >> show_first_module_on_default=disabled >> type=Choice >> description=Access duration >> >> [one-day] >> actions=set_access_duration(1DF+0D),set_role_on_not_found(INVITADOS) >> stone_roles= >> type=FixedRole >> description=One Day Access >> >> [one-week] >> actions=set_access_duration(1WR+0W),set_role_on_not_found(INVITADOS) >> stone_roles= >> type=FixedRole >> description=One Week Access >> >> [one-year] >> actions=set_access_duration(1Y+0Y),set_role_on_not_found(INVITADOS) >> stone_roles= >> type=FixedRole >> description=One Year Access >> >> I configured this using the GUI initially I was using the "set_role" >> configured from the GUI. But there is a bug in the GUI where the ID and not >> the name is being set (so it was configuring something like "set_role(43)" ) >> (see bug https://github.com/inverse-inc/packetfence/issues/5133) >> >> But If I was using the "set_role" option it would automatically assign >> the duration and selected role (INVITADOS) and never move onto the >> "Select-Role" step. the node would always be registered as "Invitados" with >> the chosen duration. >> >> By changing the "set_role" action of the "one-week" / "one-day" / >> "one-year" choices to "set_role_on_not_found" I got it working... but I >> think im just being lucky / hitting some bug / something that is letting me >> connect but it wasnt really the indended functionality. >> >> Basically, is there any "approved" way of ONLY setting the >> unregistration_date / access duation and obtaining the role from another >> step? >> >> Thanks in advance! >> Diego >> >> >> >> >> >> >> _______________________________________________ > PacketFence-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/packetfence-users >
_______________________________________________ PacketFence-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/packetfence-users
