I added validation to the phone field by modifying
/usr/local/pf/html/captive-portal/lib/captiveportal/Form/Authentication.pm. The
entry is now restricted to 10 digits without dashes.
The my %skip hash should look like this:
my %skip = (
email => 1,
telephone => 1,
map { $_ => 1 } @pf::person::NON_PROMPTABLE_FIELDS,
);
I added this line above the mobilprovider line:
has_field 'fields[telephone]' => (label => 'Telephone', apply => [{ check =>
qr/^[2-9]{2}[0-9]{8}$/, message => 'Must be 10 digits (without dashes)' } ] );
From: Morgan, Joel P.
Sent: Wednesday, August 3, 2016 6:12 PM
To: [email protected]
Subject: [PacketFence-users] phone number in SMS registration
I'm running Packetfence 6.2 on CentOS 6.8.
I noticed that when entering a phone number in the SMS registration screen,
both ###-###-#### and ########## formats for a phone number are accepted. One
phone number registered in each format creates two different user accounts. Is
there a way to validate the input, or filter it to standardize the number
format?
------------------------------------------------------------------------------
_______________________________________________
PacketFence-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/packetfence-users