Hi David,
this is exactly what we are working on.
We made a branch (fix/mandatory_fields) that fix that. If you want you
can try to apply the patch of this branch to your setup
(https://patch-diff.githubusercontent.com/raw/inverse-inc/packetfence/pull/516.diff).
Also it will be available in the incoming 5.1 release.
Regards
Fabrice
Le 2015-05-06 21:30, David Murrell a écrit :
Hi,
I'm a bit stuck. For a openday here on campus for prospective
students, (using packetfence 4.7.0) marketing wants visting students
to have wifi internet access on the day in return for some extra data
gathered via a custom portal page.
-- this might be important? I'm not using the default portal, but a
custom one specific for the day.
This is fine. Portal submit + dynamic vlan switch on valid auth +
dhcp + dynamic deregister in the gui for bad clients works
brilliantly. So brilliantly in fact, I'm going to replace our other
radius + eduroam connection handling and NPS wired switch auth backend
with it.
Where I'm stuck: I'm trying to store extra data from the portal page
into the database so that we can give it to marketing to do
after-the-event marketing to students.
If I add something like this to Portal Profiles and
Pages/openday/Files/guest.html: (a contrived example, cough)
<span>School</span>
<input class="field" name="custom_field_1"
type="custom_field_1" value="" /><br/>
The field pops up on the portal page, I can add data, and mash the
register button, and then the custom_field_1 data goes into a black
hole somewhere. I can see the page submitting the data via the post
request.
If I cause the page to not submit by not having all the mandatory
fields filled, the custom_field_1 field doesn't include the submitted
data in the result page, but the firstname field does.
If I extend the mandatory field list to include custom_field_1, then
it will show a warning if it does not contain data, but still won't
send the submitted data back on the "Missing mandatory parameter(s)"
result page.
I see the other data in the form being added to the database, (after
enabling TRACE) in the logging files:
==> logs/packetfence.log <==
attempt #0 to run query person_add_sql from module person
SQL statement (person_add_sql): INSERT INTO person
(pid, firstname, lastname, email, telephone,
company, address, notes, sponsor, anniversary,
birthday, gender, lang, nickname, cell_phone,
work_phone, title,
building_number, apartment_number, room_number,
custom_field_1, custom_field_2, custom_field_3,
custom_field_4, custom_field_5,
custom_field_6, custom_field_7, custom_field_8,
custom_field_9, portal, source)
VALUES
(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
SQL params (person_add_sql): [email protected]
<mailto:[email protected]>, first3, last3, [email protected]
<mailto:[email protected]>, 033333333, org3, <null>, email
activation. Date of arrival: 2015-05-07 12:45:41, <null>, <null>,
<null>, <null>, <null>, <null>, <null>, <null>, <null>, <null>,
<null>, <null>, <null>, <null>, <null>, <null>, <null>, <null>,
<null>, <null>, <null>, openday, email
person [email protected] <mailto:[email protected]> added
This is using the email source as it appears to captures more data,
not the null provisioner. - it also causes the guest.html section of
the portal to be used, rather than the login.html pages. I don't quite
understand that mapping, either.
Any help would be much appreciated,
Thanks in advance.
Cheers,
David Murrell
Systems Engineer - Linux
ITS Infrastructure
University of Waikato, NZ
Other files that may be of use:
[root@pktfence-guest pf]# cat conf/provisioning.conf
[accept]
type=accept
description=accept provisioner
oses=
category=guest
[openday]
filter=ssid:Open Day
mandatory_fields=email,firstname,lastname,organization,phone,custom_field_1
provisioners=accept
always_use_redirecturl=enabled
redirecturl=http://www.waikato.ac.nz
sources=email
logo=/content/images/coat-of-arms.png
dot1x_recompute_role_from_portal=0
filter_match_style=all
reuse_dot1x_credentials=0
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
PacketFence-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/packetfence-users
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
PacketFence-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/packetfence-users