pfSense Gold Subscription

Author Topic: Captive Portal with registration option  (Read 1868 times)

0 Members and 1 Guest are viewing this topic.

Offline el02154

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Captive Portal with registration option
« on: July 11, 2012, 12:11:25 pm »
Hello,

I want to include a registration form to CP. The idea is to use FreeRadius MySQL database installed in pfsense to write new users using php script. I have installed FReeradius and enable Mysql but I do not know how to connect to the database in order to see the schema and with this way decide the php variables. Can anyone help me?


Offline Nachtfalke

  • Hero Member
  • *****
  • Posts: 2754
  • Karma: +1/-0
    • View Profile
Re: Captive Portal with registration option
« Reply #1 on: July 11, 2012, 12:24:15 pm »
Hello,

I want to include a registration form to CP. The idea is to use FreeRadius MySQL database installed in pfsense to write new users using php script. I have installed FReeradius and enable Mysql but I do not know how to connect to the database in order to see the schema and with this way decide the php variables. Can anyone help me?

Freeradius2 does not have any kind of database included. It just has modules to connect to a MySQL or PostgreSQL database.
It is the same with LDAP - freeradius does not have an LDAP serve rincluded but only the module to connect to an LDAP server.
But you can install a mysql database by hand on pfsense but this is not recommended - better use another external server and run the database there and just connect freeradius to this database.

The database sheme can be found here:
pfsense 2.1
Code: [Select]
/usr/pbi/freeradius-i386/share/examples/freeradius/raddb/sql/
/usr/pbi/freeradius-amd64/share/examples/freeradius/raddb/sql/
pfsense 2.0.x
Code: [Select]
/usr/local/share/examples/freeradius/raddb/sql/

Offline el02154

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Captive Portal with registration option
« Reply #2 on: July 11, 2012, 12:47:53 pm »
Hello,

I want to include a registration form to CP. The idea is to use FreeRadius MySQL database installed in pfsense to write new users using php script. I have installed FReeradius and enable Mysql but I do not know how to connect to the database in order to see the schema and with this way decide the php variables. Can anyone help me?

Freeradius2 does not have any kind of database included. It just has modules to connect to a MySQL or PostgreSQL database.
It is the same with LDAP - freeradius does not have an LDAP serve rincluded but only the module to connect to an LDAP server.
But you can install a mysql database by hand on pfsense but this is not recommended - better use another external server and run the database there and just connect freeradius to this database.

The database sheme can be found here:
pfsense 2.1
Code: [Select]
/usr/pbi/freeradius-i386/share/examples/freeradius/raddb/sql/
/usr/pbi/freeradius-amd64/share/examples/freeradius/raddb/sql/
pfsense 2.0.x
Code: [Select]
/usr/local/share/examples/freeradius/raddb/sql/

I see...Thank you very much for your help. So if i create a user in Freeradius via pfsense where this account is saved? Sorry for asking but i have no idea about FreeRadius.

Offline Nachtfalke

  • Hero Member
  • *****
  • Posts: 2754
  • Karma: +1/-0
    • View Profile
Re: Captive Portal with registration option
« Reply #3 on: July 11, 2012, 02:11:50 pm »
if you create a user in "Users" then this user will be saved in a file called "users".
pfsense 2.0.x
Code: [Select]
/usr/local/etc/raddb/users

pfsense 2.1
Code: [Select]
/usr/pbi/freeradius-i386/etc/raddb/users
/usr/pbi/freeradius-amd64/etc/raddb/users
And after adding/deleteing a user the server needs to be restarted to take effect.