I want hotspot status page to show prepaid time value

How can i customize my hotspot status page to show the prepaid time during customer login like welcome username?

As far as I know there are no built in variables that contain that information

I can only think of one way to make this work - use a RADIUS attribute to pass back the necessary value and use the following syntax to print it on the page:

• radius<id> - show the attribute identified with <id> in text string form (in case RADIUS
authentication was used; "" otherwise)
• radius<id>u - show the attribute identified with <id> in unsigned integer form (in case
RADIUS authentication was used; "0" otherwise)
• radius<id>-<vnd-id> - show the attribute identified with <id> and vendor ID <vnd-id> in text
string form (in case RADIUS authentication was used; "" otherwise)
• radius<id>-<vnd-id>u - show the attribute identified with <id> and vendor ID <vnd-id> in
unsigned integer form (in case RADIUS authentication was used; "0" otherwise)

If you run your own RADIUS server (not User Manager), that should be do-able somehow, particularly with a database backend as you can write a custom queries to return a usable format.

If you’re using User Manager, and if it returns such an attribute (and that’s a big if - maybe it sends it back via Session-Timeout to enforce the session to not go over the allotted time frame) it’ll probably return the value in seconds. Your own RADIUS server might, too. In that case you should be able to write it into an HTML tagged field and then use JavaScript via onLoad to parse it out into something more human-readable.

Hope that helps.

not quiet understood

Turns out that

a) User Manager does return the credited time left via Session-Timeout
b) It returns it in a human readable format
c) The Router keeps the value updated over time.

So edit your status.html and simply insert the following variable:

Credited time left: $(session-timeout)

With every refresh you’ll see how many days, hours, minutes and seconds the user has left.

Check the script below. I want the Welcome $(username) to be Welcome $(uptime Limit) i have tried all i could but not to no avail.

$(if login-by-mac != ‘yes’)
Welcome $(username)

$(endif) $(if blocked == ‘yes’) $(elif refresh-timeout) $(endif)
IP address: $(ip)
bytes up/down: $(bytes-in-nice) / $(bytes-out-nice)
connected: $(uptime)
status:
advertisement required
status refresh: $(refresh-timeout)
$(if login-by-mac != ‘yes’)
$(endif)

So replace $(username) with $(session-timeout) like I posted.

@fewi

Thanks so much. It really works,

How can i set my credit to expire within some days? Like 1hour to expire 3days.

hey firewall
that has to do with the uptime and credit limit:

Like 1hour to expire 3days

when you create the credit, on credit limit you write 3d (3 days) after that you go to add the batch of users and you write on uptime limit 1h (1 hour) then you will have your users to have 1 hour of internet with a expiration of 3 days after the first login