Hi i was trying to change a few thing on my Hospot page, but i can’t seem to find the codes i need.
I would like to know if there is any way to have the login form present and working in all of the hotspot’s pages (except the alogin.html of course) and allow the user to login from it, or if the users are only allowed to login from the login.html page?
Also if there is a way to login from any hospot page, i would like to know the variables that i can use to check the user status (Logged in or not) for the If-Then-Else variables that i want to use.
This is an example of the If-Then-Else that i want to use:
If “user logged in”:
Show user info like username, IP and MAC
If “user not logged in”:
Show the login Form and some info like IP and MAC
This is my current hotspot page:
Thank you for your attention, best regards,
Paulo Brinca.
It’s even simpler then that. Basically the hotspot will do the work for you. It will display login.html if the user is not logged in, and display rstatus.html (or status.html) if the user is logged in, automatically when requesting the router.
One of the questions is if the user has to login from the login.html or not.
My hotspot has standalone user registration, wich means that users create their accounts to use the internet (yes, it is a free hotspot, no charges). After that they will stay in the registration page with the login form, but that login is not working right now…
The other question is related to the detection of the user status.
Since this hotspot will have more contents i would like to allow users to browse the different hotspot pages and have their account info on the top if they are logged in, or the login form if they are not logged in.
I have tryed with the logged-in variable, but without sucess.
An example would help since i have been around this all day, and may be doing something wrong
The user logs in by submitting - via POST or GET - the username and password variables to /login. It is irrelevant what the referrer is for that resource.
All variables are available on all pages served by the Hotspot servlet.
I am not going to question you, but could you please download my hotspot template and test it to check, i am not able to login from the User registration page (called “registar.html”).
I don’t have anything on this machine that can read RAR files. Please post the source code of the HTML page that is giving you trouble in line wrapped in
I don’t have anything on this machine that can read RAR files.
I recommend 7zip. It reads all archive formats and it’s free and stable software with no ads. And RAR is a good format, better than ZIP. I think 7zip’s own format could be even better than RAR but not sure.
Just my advice, since I use login-by=http-chap and fewi uses login-by=http-pap, insure the md5.js file is in the correct directory. In your html code:
In this case, the md5.js file should be in the /hotspot/javascript/ directory. If it is in the same directory as the login.html doc (like on the router in the /hotspot directory), it should be
src=“/md5.js”
Thanks SurferTim the md5.js is inside the javascript folder, and this code is the same as the login.html, the only thing that changes is the content of
Since the “login.html” is working, the “registar.html” should also be allowing the user to login from there…
I would like to know if i post the files can someone please take a look at the code and possibly test it in their hotspot…
@normis - Do you wan’t me to remove the code from above and place a .txt file with it?
Did you do what fewi suggested? Try the login from that page and check the log. I’m fairly certain fewi will ask if you tried that. You should be able to test it by calling it from a client machine. http://192.168.0.1/registrar.html
Change the ip to your router’s hotspot address.
You are aware that the hotspot will call login.html when the requested page is redirected. You will either need to rename your doc login.html, or redirect the login.html page to your new page with Javascript.
ADD: I don’t know if the variables $(chap-id) and $(chap-challenge) will be correct on the registrar.html doc. You might want to “View Source” on that page when it loads to insure those are there.
What Tim said. Always check the logs when testing. Also, try it with PAP instead of CHAP and see if that works to determine if the md5 algorithm is the root of your issue.
That means there’s either a problem how you’re integrating the md5.js, or the $(chap-id) variables aren’t getting populated as Tim hinted towards. Look at the page in source view on the test client and see if the variable is filled out - if it’s not, CHAP can’t work.
A simple “no worries” workaround would be if you had an SSL certificate you can use on the Hotspot. PAP is perfectly safe over SSL/TLS, and pages for PAP are much easier to write and debug than CHAP ones.
If there was no “function doLogin” script, then the $(chap-id) variable was blank. You will need to replace the login.html with your page. I would save the original login.html page in case you need a reference for your new page, and something to go back to if yours doesn’t work like you expected.
Then try again. Same thing. Check “View Source”, then try the login and check the log.
I enable the hotspot and radius logging when testing.
There is a “function doLogin” script, the page’s HTML is a few posts above.
I have checked everything (according to my knowledge), and i can’t find the error, it should be working, but for some reason users can only login using the login.html file, no other file allows the users to login, imagine i would like the user to login from login2.html while login.html had some hotspot intro…