Project

General

Profile

Actions

Feature #3136

closed

Captive Portal Increment Id

Added by Aye Can almost 12 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Captive Portal
Target version:
-
Start date:
08/08/2013
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:

Description

Assign the Pass-though Mac | Allowed IP Address | Allowed Hostnames static id's
that always increases when adding data rather then relaying on the foreach array
that dynamically asigning the $_GET id.

This can cause problems per say when you scrape the data to obtain the id for
a row delete. Since the id's change each time you add or remove a row and depending
on what current id or ip,hostname,mac number is being removed causes all the
remaining id's each time a data row is added or removed.

In the end it can cause the wrong id to be deleted.

Adding a numeric increment in the config and assign each data row its very own id
will correct this from happing. Since per say id 20 will never be used again it.

Even if the id reaches a silly number such as 100,000,000 its just a nine digit
number stored in the config array. No worse then a timestamp.

Actions #1

Updated by Aye Can almost 12 years ago

Correction | Old
causes all the
remaining id's each time a data row is added or removed

Correction | New
causes all the
remaining id's to change each time a data row is added or removed

Actions #2

Updated by Chris Buechler almost 12 years ago

  • Target version deleted (2.1)
  • Affected Version deleted (2.1)
Actions #3

Updated by A FL almost 7 years ago

I would vote for a "reject"/"won't fix".

What you want is to update pfSense settings using a script, which is completly possible but not officially supported nor recommanded. So if you really want to create a script, you need to addapt this script to make it work with pfSense, and not the opposite.

Plus...as you mentionned, every time you add or delete a row, the numeric id is updated meaning you need to add one or subract one to the array's length. This is easy to handle in a script.

'''here is an example, in python'''

function fetchFromPfSense():
    # for demonstration purpose. in real script you would need to make an http request.
    return ["aa:bb:cc:dd:ee:00","aa:bb:cc:dd:ee:01","aa:bb:cc:dd:ee:02","aa:bb:cc:dd:ee:03","aa:bb:cc:dd:ee:04"]

macList = fetchFromPfSense()

for id in range(0,len(macList)):
    print(macList[id])
    if macList[id] == "aa:bb:cc:dd:ee:03" or macList[id] == "aa:bb:cc:dd:ee:04": 
        removeMac(id) # this function should make an HTTP request to delete the MAC matching this ID
        del macList[id]
        id = id-1

'''This script will delete aa:bb:cc:dd:ee:03 and aa:bb:cc:dd:ee:04'''

Actions #4

Updated by A FL almost 7 years ago

Jim Pingle this can be closed

Actions #5

Updated by Jim Pingle almost 7 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF