Thinking about getting a mikrotik router for a small project ..
but I wanted to know if the following in any way possible w/ Mikrotik Hotspot feature?
Users connecto to wifi w/o pass
sees the captive portal w/ ads (basically a website remotely hosted) for x seconds
So basically what i need to do is:
Going thru the docs I can't find anything about "wait time" for the hotspot feature... But I was thinking it would be nice if I could simply code the captive portal website w/ javascript timeout that would call a function that triggers the Mikrotik router to allow access..
Now since I don't think there's any exposed/public methods i could call that would tell the router to "OK allow access now" on the specific user viewing the Portal, perhaps i could set 1 user/pass for all guests of the router, then have a hidden form of user/pass pre-filled in.. and then have javascript trigger "submit form" when I'm ready?
How am I doing so far? Would love to be guided....
You have to create(or you can download from internet) hotspot folder in MikroTik, and in login.html
<form action="http://10.5.50.1/login" method="post"> //http://10.5.50.1 your server ip
<input type="hidden" name="username" value="admin" />
<input type="hidden" name="password" />
<input type="hidden" name="dst" value="www.yourwebsite.com" />
<input type="hidden" name="popup" value="false" />
<button type="submit">Continue</button>
</form>
<script type="text/javascript">
function doLogin()
{
document.sendin.username.value = document.login.username.value;
document.sendin.password.value =
hexMD5('\011\373\054\364\002\233\266\263\270\373\173\323\234\313\365\337\356');
document.sendin.submit();
}
</script>
run this function on document load it will automatically logged in and will redirect you to this given address in form on this page you can show advertisment for 5 seconds and after 5 second redirect to google.com