[prev in list] [next in list] [prev in thread] [next in thread] 

List:       packetfence-users
Subject:    [PacketFence-users] Choice of access duration together with "role choice"
From:       Diego_García_del_Río via PacketFence-users <packetfence-us
Date:       2021-02-01 14:43:12
Message-ID: CAPvw0ZE5W5vLit4zwU+JBwwrvG+3sfKjjZfmuRR3-7YEtDYV1w () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Everyone,

(sorry if it got double-posted, im not finding my previous email in the
archive nor did a get it back when posting)

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. The role part is easy as there
is a portal module specifically for it. But the Access duration /
unreg-date is a bit more complex.

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:

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

--- end config---

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 5133 on github)

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 the way, I tried using the "stone_role"  option but it didn't work.
(adding all the roles I want to keep in the stone_role part). In this case
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...

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


*Diego Garcia del Rio* | CTO | Mediatel S.A.

[Attachment #5 (text/html)]

<div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Everyone,<div><br></div><div>(sorry \
if it got double-posted, im not finding my previous email in the archive nor did a \
get it back when posting)</div><div><br></div><div>Im trying to achieve the \
following:</div><div><br></div><div>On the captive portal, I&#39;d have an admin user \
login and then select a Role and access duration for a particular device. The role \
part is easy as there is a portal module specifically  for it. But the Access \
duration / unreg-date is a bit more complex.</div><div><br></div><div>I got it \
working but I think im relying on a bit of a bug for it to \
work.</div><div><br></div><div>The following  is my relevant \
config:</div><div><br></div><div>--- Start \
config---</div><div><br></div>[Select-Role]<br>actions=<br>template=select-role.html<br>admin_role=IT<br>type=SelectRole<br>list_role= \
&lt;&lt;EOT<br>ALUMNOS<br>ADMINISTRATIVOS<br>INVITADOS<br>PROFESORES<br>REJECT<br>EOT<br>description=Seleccionar \
Rol<br><br>[Role-and-duration]<br>modules=default_login_policy,duration-choice,Select-Role<br>actions=<br>type=Chained<br>description=Selecionar \
Rol y duracion<br><br>[duration-choice]<br>modules=one-day,one-week,one-year<br>action \
s=<br>template=content-with-choice.html<br>show_first_module_on_default=disabled<br>type=Choice<br>description=Access \
duration<br><br>[one-day]<br>actions=set_access_duration(1DF+0D),set_role_on_not_found(INVITADOS)<br>stone_roles=<br>type=FixedRole<br>description=One \
Day Access<br><br>[one-week]<br>actions=set_access_duration(1WR+0W),set_role_on_not_found(INVITADOS)<br>stone_roles=<br>type=FixedRole<br>description=One \
Week Access<br><br>[one-year]<br>actions=set_access_duration(1Y+0Y),set_role_on_not_found(INVITADOS)<br>stone_roles=<br>type=FixedRole<br>description=One \
Year Access</div><div dir="ltr"><br></div><div dir="ltr">--- end \
config---<br></div><div dir="ltr"><br><div>I configured this using the GUI initially \
I was using the &quot;set_role&quot; 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 &quot;set_role(43)&quot; )</div><div>(see bug 5133 on \
github)</div><div><br></div><div>But If I was using the &quot;set_role&quot; option \
it would automatically  assign the duration and selected role (INVITADOS) and never \
move onto the &quot;Select-Role&quot; step. the node would always be registered as \
&quot;Invitados&quot;  with the chosen duration.</div><div><br></div><div>By the  \
way, I tried using the &quot;stone_role&quot;   option but it didn&#39;t work. \
(adding all the roles I want to keep in the stone_role part). In this case I would \
first do the &quot;select role&quot; option in the chain and then the &quot;fixed \
role&quot; to only set a duration but it doesnt seem to work...  \
</div><div><br></div><div>By changing the &quot;set_role&quot; action of the \
&quot;one-week&quot; / &quot;one-day&quot; / &quot;one-year&quot; choices to \
&quot;set_role_on_not_found&quot; 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.</div><div><br></div><div>Basically, is there any \
&quot;approved&quot; way of ONLY setting the unregistration_date   / access duation \
and obtaining the role from another step?</div><div><br></div><div>Thanks in \
advance!</div><font color="#888888">Diego</font></div><div dir="ltr"><font \
color="#888888"><br></font></div><div dir="ltr"><font \
color="#888888"><br></font></div><div><div dir="ltr" class="gmail_signature"><div \
dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span \
lang="ES-CO" style="font-size:12.8px;color:rgb(31,73,125)"><b>Diego Garcia del \
Rio</b></span><span lang="ES-CO" style="font-size:10pt;color:rgb(31,73,125)">  \
</span><span style="font-size:10pt;color:rgb(31,73,125)">| CTO | Mediatel S.A.  \
</span></div></div></div></div></div></div></div></div></div></div></div>





_______________________________________________
PacketFence-users mailing list
PacketFence-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/packetfence-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic