Community discussions

MikroTik App
 
wallpaper
just joined
Topic Author
Posts: 5
Joined: Tue Dec 02, 2014 6:37 pm

redirect user after reaching usage limit

Tue Dec 02, 2014 9:55 pm

Hi

Is there any way to do this? Currently when the usage limit is reached, the user gets kicked off, they then proceed to log back in and get the message, transfer limit exceeded. Instead of this I would like them to get redirected to a custom page.

Any help would be great.
 
technicarl
just joined
Posts: 13
Joined: Wed Nov 26, 2014 7:07 am

Re: redirect user after reaching usage limit

Fri Dec 05, 2014 5:35 am

Here's a sketch:

capture the log message - change the server profile assignment to one that uses alogin.html with redirect - put your redirect in walled garden.
 
technicarl
just joined
Posts: 13
Joined: Wed Nov 26, 2014 7:07 am

Re: redirect user after reaching usage limit

Fri Dec 05, 2014 7:19 am

modify this in login.html

$(if error)
<meta http-equiv="refresh" content="4; url=http://whatever/">
$(endif)
 
wallpaper
just joined
Topic Author
Posts: 5
Joined: Tue Dec 02, 2014 6:37 pm

Re: redirect user after reaching usage limit

Fri Dec 05, 2014 3:14 pm

I can see it happening in the log: login failed: transfer limit reached

But what would I do with that?

$(if error) just grabs any error but I want the specific error of transfer limit reached to only redirect. I thought alogin.html was used by default? Quite new to the hotspots sorry!
 
technicarl
just joined
Posts: 13
Joined: Wed Nov 26, 2014 7:07 am

Re: redirect user after reaching usage limit

Wed Dec 10, 2014 6:00 am

OK, if you are not in a big rush:

I am working on something similar so once I have a more detailed example I will make it available to you (once it works). I am not so hot on the html side so I need to figure out how to set up an html algorithm (not using the log entry). Basically I want to set up something like if $error="transfer limit reached"
redirect to other page
Maybe you can help me to help you help me help you :D
 
technicarl
just joined
Posts: 13
Joined: Wed Nov 26, 2014 7:07 am

Re: redirect user after reaching usage limit

Wed Dec 10, 2014 6:10 am

Try this..

$(if error == "Transfer limit reached")
 
boy1367
just joined
Posts: 9
Joined: Tue Feb 03, 2015 12:14 pm

Re: redirect user after reaching usage limit

Sat Feb 14, 2015 1:10 pm

Hi there
I am looking for a script
But I can not find in this forum