Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

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

    Scheduled Pinned Locked Moved Captive Portal
    3 Posts 2 Posters 1.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      dimoz
      last edited by

      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?

      thanks

      1 Reply Last reply Reply Quote 0
      • GertjanG Online
        Gertjan
        last edited by

        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.

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        1 Reply Last reply Reply Quote 0
        • D Offline
          dimoz
          last edited by

          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.
          thanks

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.