- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 01:53 AM
Hello everyone.
I want to get the IP address of the connecting source using UI Script.
Specifically, I want to add a script to the UI script "sn_ex_sp.ec_url_whitelist" that is launched when the ESC login screen (/esc) is accessed, and implement logic to obtain the IP address of the connection source.
However, it seems that "session.getClientIP();" cannot be used in UI script, so I don't know how to get the IP address.
"session.getClientIP();" works fine in a script include, so it would be nice if I could call a specific script include from a UI script, but I don't know how to implement that.
Can anyone please help? Any information would be appreciated.
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2024 01:43 AM
I found a solution.
The function I wanted to implement this time was the "IP address acquisition logic" that runs when the ESC login screen is accessed.
To achieve this, I had to customize the "Login" widget placed on the ESC login screen, rather than using a UI script.
◆Steps
- Duplicate the "Login" widget.
- Add the following script to the server script.
var ipad = gs.getSession().getClientIP() - For each portal login page, replace the configured widget with the widget created in step 1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2024 01:43 AM
I found a solution.
The function I wanted to implement this time was the "IP address acquisition logic" that runs when the ESC login screen is accessed.
To achieve this, I had to customize the "Login" widget placed on the ESC login screen, rather than using a UI script.
◆Steps
- Duplicate the "Login" widget.
- Add the following script to the server script.
var ipad = gs.getSession().getClientIP() - For each portal login page, replace the configured widget with the widget created in step 1.