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

    CP wit a password of the day

    Scheduled Pinned Locked Moved Captive Portal
    4 Posts 3 Posters 587 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.
    • T
      toga735
      last edited by

      Hello,

      has anyone from the community build a captive Portal authentication method with Password of the day ? I would like to implement a solution with a list of Password for next 90 or 120 days with individual Passwords for each day.

      Has any had the same idea and found a good solution?

      Thanks & Kind regards

      toga735

      1 Reply Last reply Reply Quote 0
      • The Computer GuyT
        The Computer Guy
        last edited by

        Yes, I did something similar, customer wanted a quarterly password.

        I simply created four users, q1, q2, q3 & q4

        Then on the portal page, a little php to work out the quarter number, username field is then a hidden field.

        It'll take you a while to add a user for each day though!

        1 Reply Last reply Reply Quote 0
        • The Computer GuyT
          The Computer Guy
          last edited by

          Just to expand on the answer a little more, now that I'm on my laptop and not my phone -

          $user_array = array ( 	1  => 'q1',
          							2  => 'q2',
          							3  => 'q3',
          							4  => 'q4'
          						);
          
          function CurrentQuarter(){
               $n = date('n');
               if($n < 4){
                    return "1";
               } elseif($n > 3 && $n <7){
                    return "2";
               } elseif($n >6 && $n < 10){
                    return "3";
               } elseif($n >9){
                    return "4";
               }
          }
          $current_user = $user_array[CurrentQuarter()];
          

          Then as the "User" field, I did -

          1 Reply Last reply Reply Quote 0
          • S
            seanpearman
            last edited by

            We've done something similar using RADIUS and a custom CP page.

            • cron creates a username and password
            • cron emails that username and password to a distribution list (could also use digital signage)
            • cron deletes the previous days password
            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.