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

    Php coders I need help with these codes

    Scheduled Pinned Locked Moved Captive Portal
    1 Posts 1 Posters 1.3k 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.
    • C
      cruzades
      last edited by

      
      radius_database = /sr/local/etc/raddb/users  //this is the record of all radius users 
      cp_database = /var/db/captiveporta.db        //this is the record of logged-on clients
      
      radius_user = count(radius_database)
      cp_users = count(cp_database)
      
      for i = 1 to len(radius_user)
      	if radius_user[i][expiration] = today
      		for ii = 1 to len(cp_users)
      			if radius_user[i][username]=cp_users[ii][username]
      				captiveportal_disconnect_client(cp_users[ii][userid]
      			endif
      		next ii
      	endif
      next i
      
      close databases
      
      I will be using this in terminating current logged-on users if their account is expired at 00:00hrs.
      
      thanks and more power
      -cruzades[/i][/i]
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.