Hello everyone,
I'm customizing my MikroTik HotSpot (RouterOS) and I need to display the user's profile name (e.g., "free", "premium", "gold", etc.) on the status page after login, or redirect users based on their profile.
What I want to achieve:
-
After a user logs in successfully, I want to know which HotSpot user profile they belong to (the profile set in /ip hotspot user profile)
-
I want to display their profile name on the status page
-
Or redirect users from different profiles to different pages
What I have tried:
I tried using $(profile) in alogin.html and status.html, but it only outputs $(profile) as plain text, not the actual value. Other variables like $(trial) show no, $(username) shows the username, and $(session-time-left) shows the time correctly.
My question:
Is there any way to get the profile name of the logged-in user in the HotSpot servlet pages?
-
What variable should I use in alogin.html or status.html?
-
Is the profile name even passed to these pages, or is it only available through the API or via /ip hotspot active?
I've checked the MikroTik documentation at https://help.mikrotik.com/docs/spaces/ROS/pages/87162881/Hotspot+customisation, but I didn't find a variable for the profile name .
What I've already read:
I found a forum discussion from 2011 where users discussed using $(if username == john) to redirect based on username . I also know that $(profile) appears as a parameter in the /ip hotspot active menu (read-only) but I'm not sure if it's available in servlet pages .
Questions:
-
Is there a variable like $(profile) that should work in HotSpot servlet pages?
-
If not, what is the recommended way to get the profile name?
-
Can I retrieve it through the RouterOS API using JavaScript in the servlet pages?
My RouterOS version:
RB1100AHx4 Dude Edition arm [6.48.6]
Thank you in advance for any help!