CP+FreeRadius+MySQL - Login page to let users to reset password

  • Hi.
    I have configured pfsense + captiveportal + freeradius + mysql + vhosts.
    i would like to permit users to change their own password through a web page stored in pfsense.

    i have created a table in "radius" db named "resetpsw" with 2 column: "username" and "reset". every user in "radcheck" table has a record in this table with the corresponding username and a "reset" value set to "0" or to "1" to force him to reset the password. (I manually change the value in the db to force him to reimputate a new password)

    My problem now is to insert the correct code in the captiveportal login page to check, before authenticate him, if the username has the "reset" value to "1" and redirect him to the reset password page.
    Any suggestions?


  • Hi,

    Sorry to say, but there is no work around for this:
    Write your own PHP code that a user can 'visit' from the login page.
    This extra page should communicate with your radius server.

    pfSense itself is a boatload of examples how to do so - look in the scripts already present.

  • hello,
    thanks for the reply.
    with some tests I have already managed to create a PHP page where entering credentials, it is checked whether the user must change his password (with the table "resetpsw"). Searching the internet I found a code to establish a connection to mysql and change the password.
    I do not know how to integrate this code in the login page and adapt it to run before the action $PORTAL_ACTION$ that authenticates the user.

Log in to reply